NodeCache 云解决方案提供商NodeCache CSP

NodeCache 配置服务提供程序用于管理客户端缓存。The NodeCache configuration service provider is used to manage the client cache. 此配置服务提供程序仅由企业管理服务器使用。This configuration service provider is to be used only by enterprise management servers. 它提供抽象级别,将节点列表的管理与特定备份存储分离。It provides a level of abstraction that decouples the management of the node list from a specific backing store. 它将客户端缓存与服务器端缓存同步。It synchronizes the client cache with the server side cache. 它还提供用于监视设备端缓存更改的 API。It also provides an API for monitoring device-side cache changes.

NodeCache 支持比较哈希值而不是实际节点值:NodeCache supports the comparison of hash values instead of actual node values:

<Type xmlns="syncml:metinf">
application/x-nodemon-sha256
</type>

NodeCache 将哈希值并与服务器向下发送的哈希值进行比较。NodeCache will hash the values and compare with a hash value that was sent down by the server. 这支持以递归状态检查父节点及其子节点。This supports checking a parent node and its children recursively.

下面以树格式显示 NodeCache 配置服务提供程序。The following shows the NodeCache configuration service provider in tree format.

./User/Vendor/MSFT
NodeCache
----ProviderID
--------CacheVersion
--------ChangedNodes
--------ChangedNodesData
--------Nodes
------------NodeID
----------------NodeURI
----------------ExpectedValue
----------------AutoSetExpectedValue


./Device/Vendor/MSFT
NodeCache
----ProviderID
--------CacheVersion
--------ChangedNodes
--------ChangedNodesData
--------Nodes
------------NodeID
----------------NodeURI
----------------ExpectedValue
----------------AutoSetExpectedValue


./User/Vendor/MSFT
./Device/Vendor/MSFT
NodeCache
----ProviderID
--------CacheVersion
--------ChangedNodes
--------ChangedNodesData
--------Nodes
------------NodeID
----------------NodeURI
----------------ExpectedValue
----------------AutoSetExpectedValue

./Device/Vendor/MSFT 和 ./User/Vendor/MSFT./Device/Vendor/MSFT and ./User/Vendor/MSFT
必需。Required. NodeCache 对象的根节点。The root node for the NodeCache object. 支持的操作为 Get。Supported operation is Get. 此配置服务提供程序仅用于企业设备管理。This configuration service provider is used for enterprise device management only. 这是一个预定义的 MIME 类型,用于用 OMA DM 语法标识此托管对象。This is a predefined MIME type to identify this managed object in OMA DM syntax.

ProviderIDProviderID
可选。Optional. 每个 DM 服务器的组设置。Group settings per DM server. 每组设置都通过服务器的提供程序 ID 进行区分。Each group of settings is distinguished by the server’s Provider ID. 它应是注册过程中通过w7 应用程序配置服务提供程序 XML 提供的 DM 服务器PROVIDER-ID值。It should be the same DM server PROVIDER-ID value that was supplied through the w7 APPLICATION configuration service provider XML during the enrollment process. 仅支持一台企业管理服务器。Only one enterprise management server is supported. 也就是说 ,NodeCache下应该只有一个ProviderID节点。That is, there should be only one ProviderID node under NodeCache. 范围是动态的。Scope is dynamic.

支持的操作包括 Get、Add 和 Delete。Supported operations are Get, Add, and Delete.

*ProviderID*/CacheVersion*ProviderID*/CacheVersion
可选。Optional. 表示服务器设置的缓存版本的字符串。Character string representing the cache version set by the server. 范围是动态的。Scope is dynamic.

数据类型为 string。Data type is string. 支持的操作包括 Get、Add 和 Replace。Supported operations are Get, Add, and Replace.

*ProviderID*/ChangedNodes*ProviderID*/ChangedNodes
可选。Optional. 其值与** / NodeID/ExpectedValue**中指定的预期值的节点列表不匹配。List of nodes whose values do not match their expected values as specified in /NodeID/ExpectedValue. 范围是动态的。Scope is dynamic.

数据类型为 string。Data type is string. 支持的操作为 Get。Supported operation is Get.

*ProviderID*/ChangedNodesData*ProviderID*/ChangedNodesData
已添加到 Windows 10 版本 1703。Added in Windows 10, version 1703. 可选。Optional. 包含其值与 /NodeID/ExpectedValue 中指定的预期值的节点不匹配的 XML。XML containing nodes whose values do not match their expected values as specified in /NodeID/ExpectedValue.

支持的操作是 Get。Suppported operation is Get.

*ProviderID*/Nodes*ProviderID*/Nodes
必需。Required. 缓存节点的根节点。Root node for cached nodes. 范围是动态的。Scope is dynamic.

支持的操作为 Get。Supported operation is Get.

/Nodes/ NodeID/Nodes/NodeID
可选。Optional. 有关每个缓存节点的信息存储在服务器指定的 NodeID 下。Information about each cached node is stored under NodeID as specified by the server. 此值不能包含逗号。This value must not contain a comma. 范围是动态的。Scope is dynamic.

支持的操作包括 Get、Add 和 Delete。Supported operations are Get, Add, and Delete.

/NodeID/NodeURI/NodeID/NodeURI
必需。Required. 此节点的值是完整的 OMA DM 节点 URI。This node's value is a complete OMA DM node URI. 它可以在设备管理树中指定内部节点或叶节点。It can specify either an interior or leaf node in the device management tree. 范围是动态的。Scope is dynamic.

数据类型为 string。Data type is string. 支持的操作包括 Get、Add 和 Delete。Supported operations are Get, Add, and Delete.

/NodeID/ExpectedValue/NodeID/ExpectedValue
必需。Required. 这是服务器预期在设备上使用的值。This is the value that the server expects to be on the device. 当配置服务提供程序启动会话时,它会根据节点的默认值检查实际值。When the configuration service provider initiates a session, it checks the expected value against the node's actual value. 范围是动态的。Scope is dynamic. 支持的值是 string 和 x-nodemon-non不存在。Supported values are string and x-nodemon-nonexistent.

支持的操作包括 Get、Add 和 Delete。Supported operations are Get, Add, and Delete.

下面是将 ExpectedValue 设置为不存在的示例。Here's an example for setting the ExpectedValue to nonexistent.

<Add>
   <CmdID>10</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0002/ExpectedValue</LocURI>
      </Target>
      <Meta>
         <Format xmlns="syncml:metinf">chr</Format>
         <Type xmlns="syncml:metinf">application/x-nodemon-nonexistent</Type>
      </Meta>
   </Item>
</Add>

/NodeID/AutoSetExpectedValue/NodeID/AutoSetExpectedValue
已添加到 Windows 10 版本 1703。Added in Windows 10, version 1703. 必需。Required. 这会自动设置设备上的值,以匹配实际值的值。This automatically sets the value on the device to match the actual value of the node. 节点在 NodeURI 中指定。The node is specified in NodeURI.

支持的操作包括添加、获取和删除。Supported operations are Add, Get, and Delete.

与 NodeCache 配置服务提供程序的典型 DM 会话A typical DM session with the NodeCache configuration service provider

  1. 设备连接到 DM 服务器。The device connects to a DM server.

  2. 服务器通过为 ./Vendor/MSFT/NodeCache/ProviderID/CacheVersion LocURI 发出 Get 操作来查询NodeCache版本The server queries the NodeCache version by issuing a Get operation for ./Vendor/MSFT/NodeCache/ProviderID/CacheVersion LocURI

  3. 如果设备 CacheVersion 和服务器端缓存因 (崩溃或服务器崩溃) 不同,则服务器可以清除服务器端缓存并转到步骤 5。If the device CacheVersion and the server-side cache differ (due to a device crash or server crash), the server can clear the server-side cache and go to Step 5.

  4. 服务器更新服务器端缓存:The server updates the server-side cache:

    1. 为 ./Vendor/MSFT/NodeCache/ProviderID/ChangedNodes LocURI 发送 Get 操作Sends a Get operation for ./Vendor/MSFT/NodeCache/ProviderID/ChangedNodes LocURI

    2. 响应是已更改的节点 ID 的列表。Response is a list of changed node IDs. 列表中的每个 ID 对应于 ./Vendor/MSFT/NodeCache/ProviderID/Nodes 根下的节点Each ID in the list corresponds to a node under ./Vendor/MSFT/NodeCache/ProviderID/Nodes root

    3. 对于无效节点列表中的每个节点,服务器将发送一个命令实际值 GET 节点的节点。For each node in the invalid nodes list, the server sends a GET command to retrieve the actual value of the node. 例如, ,其中 是对应于无效缓存节点的完整设备 GET <NodeURI> NodeURI LocURI。For example, GET <NodeURI>, where NodeURI is a full device LocURI that corresponds to the invalid cache node.

    4. 服务器端缓存中的节点使用从设备接收的实际值进行更新。Nodes in the server-side cache are updated with the actual values received from the device.

    5. 对于每个更新的节点,会向设备发送命令以 REPLACE 更新设备端缓存:For each updated node, a REPLACE command is sent to the device to update the device-side cache:

      REPLACE ./Vendor/MSFT/NodeCache/ProviderID/Nodes/NodeID/ExpectedValue => ActualValue

    6. 将创建一个新的缓存版本并发送到设备:A new cache version is created and sent to the device:

      REPLACE ./Vendor/MSFT/NodeCache/ProviderID/CacheVersion => new_version

      new_version该值由服务器存储。The new_version value is stored by the server.

  5. 管理服务器从服务器端缓存检索相应的值:The management server retrieves the corresponding value from the server-side cache:

    1. 如果服务器端缓存中已存在值,请从服务器端缓存中检索值,而不是访问设备。If a value already exists in the server-side cache, retrieve the value from the server-side cache instead of going to the device.

    2. 如果服务器端缓存中不存在值,请执行下列操作:If a value does not exist in the server-side cache, do the following:

      1. 在服务器端缓存中创建具有唯一 NodeID 的新条目。Create a new entry with a unique NodeID in the server-side cache.

      2. 查询设备以检索 实际值 URI。Query the device to retrieve the actual value of the URI.

      3. 使用 NodeID 值在 ./Vendor/MSFT/NodeCache/ProviderID/Nodes 下创建新 节点。Create a new node under ./Vendor/MSFT/NodeCache/ProviderID/Nodes with NodeID value.

      4. 为 ./Vendor/MSFT/NodeCache/ProviderID/Nodes/ NodeID 节点设置NodeURIExpectedValue。 **Set up NodeURI and ExpectedValue for the ./Vendor/MSFT/NodeCache/ProviderID/Nodes/NodeID node.

      5. 更新 CachedNodes 版本。Update the CachedNodes version.

OMA DM 示例OMA DM examples

为节点缓存创建设置:Creating settings for node caching:

<Add>
   <CmdID>2</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1</LocURI>
      </Target>
      <Meta>
         <Format xmlns="syncml:metinf">node</Format>
      </Meta>
   </Item>
</Add>
<Add>
   <CmdID>4</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0001</LocURI>
      </Target>
      <Meta>
         <Format xmlns="syncml:metinf">node</Format>
      </Meta>
   </Item>
</Add>
<Add>
   <CmdID>5</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0001/NodeURI</LocURI>
      </Target>
      <Data>./Vendor/MSFT/DeviceLock/Provider/MDMSRV1/DevicePasswordEnabled</Data>
   </Item>
</Add>
<Add>
   <CmdID>6</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0001/ExpectedValue</LocURI>
      </Target>
      <Data>0</Data>
   </Item>
</Add>
<Add>
   <CmdID>8</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0002</LocURI>
      </Target>
      <Meta>
         <Format xmlns="syncml:metinf">node</Format>
      </Meta>
   </Item>
</Add>
<Add>
   <CmdID>9</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0002/NodeURI</LocURI>
      </Target>
      <Data>
         ./Vendor/MSFT/DeviceLock/Provider/MDMSRV1/AlphanumericDevicePasswordRequired
      </Data>
   </Item>
</Add>
<Add>
   <CmdID>10</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0002/ExpectedValue</LocURI>
      </Target>
      <Data>0</Data>
   </Item>
</Add>

获取提供程序 ID MDMSRV1 下的节点、缓存版本、已更改的节点、节点、预期值:Getting nodes under Provider ID MDMSRV1, cache version, changed nodes, node, expected value:

<Get>
   <CmdID>18</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1</LocURI>
      </Target>
   </Item>
</Get>
<Get>
   <CmdID>19</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/CacheVersion</LocURI>
      </Target>
   </Item>
</Get>
<Get>
   <CmdID>20</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/ChangedNodes</LocURI>
      </Target>
   </Item>
</Get>
<Get>
   <CmdID>21</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0001</LocURI>
      </Target>
   </Item>
</Get>
<Get>
   <CmdID>22</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0001/ExpectedValue</LocURI>
      </Target>
   </Item>
</Get>

替换缓存版本、节点 URI 和预期值:Replacing the cache version, node URI, and expected value:

<Replace>
   <CmdID>2</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/CacheVersion</LocURI>
      </Target>
      <Data>SCCM0001@!Replace</Data>
   </Item>
</Replace>
<Replace>
   <CmdID>2</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0001/NodeURI</LocURI>
      </Target>
      <Data>./Vendor/MSFT/DeviceLock/DeviceValue/AllowSimpleDevicePassword</Data>
    </Item>
</Replace>
<Replace>
   <CmdID>2</CmdID>
   <Item>
      <Target>
         <LocURI>./Vendor/MSFT/NodeCache/MDMSRV1/Nodes/Node_0001/ExpectedValue</LocURI>
      </Target>
      <Data>2</Data>
   </Item>
</Replace>

对于 AutoSetExpectedValue,包含空数据的 Replace 操作将查询 ./DevDetail/Ext/Microsoft/DeviceName。For AutoSetExpectedValue, a Replace operation with empty data will query the ./DevDetail/Ext/Microsoft/DeviceName.

          <Add>
            <CmdID>2001</CmdID>
            <Item>
              <Target>
                <LocURI>./Vendor/MSFT/NodeCache/MDM%20SyncML%20Server/Nodes/20</LocURI>
              </Target>
              <Meta>
                <Format xmlns="syncml:metinf">node</Format>
              </Meta>
            </Item>
          </Add>
          <Add>
            <CmdID>2002</CmdID>
            <Item>
              <Target>
                <LocURI>./Vendor/MSFT/NodeCache/MDM%20SyncML%20Server/Nodes/20/NodeURI</LocURI>
              </Target>
              <Data>./DevDetail/Ext/Microsoft/DeviceName</Data>
            </Item>
          </Add>
          <Replace>
            <CmdID>2003</CmdID>
            <Item>
              <Target>
               <LocURI>./Vendor/MSFT/NodeCache/MDM%20SyncML%20Server/Nodes/20/AutoSetExpectedValue</LocURI>
              </Target>
              <Data></Data>
            </Item>
          </Replace>

对 ./Vendor/MSFT/NodeCache/MDM%20SyncML%20Server/Nodes/20/ExpectedValue 执行 Get 操作将返回调用 AutoSet 时设备名称的名称。A Get operation on ./Vendor/MSFT/NodeCache/MDM%20SyncML%20Server/Nodes/20/ExpectedValue returns what the Device Name was when the AutoSet was called.

ChangedNodesData 上的 Get 操作返回编码的 XML。A Get operation on the ChangedNodesData returns an encoded XML. 下面是一个示例:Here is example:

<Nodes><Node Id="10" Uri=""></Node><Node Id="20" Uri="./DevDetail/Ext/Microsoft/DeviceName">U09NRU5FV1ZBTFVF</Node></Nodes>

它表示:It represents this:

<Nodes>
    <Node Id="10" Uri=""></Node>
    <Node Id="20" Uri="./DevDetail/Ext/Microsoft/DeviceName">U09NRU5FV1ZBTFVF</Node>
</Nodes>

Id 是由 MDM 服务器添加的节点 ID,Uri 是节点跟踪的路径。Id is the node ID that was added by the MDM server, and Uri is the path that the node is tracking. 如果未设置 Uri,则节点将始终报告为已更改,如 Node id 10 中一样。If a Uri is not set, the node will always be reported as changed, as in Node id 10.

节点标记内的值是由 Uri 返回的 实际值,这意味着对于 Node Id 20,DeviceName 与之前预期的内容不匹配,并且设备名称现在为 U09NRU5FV1ZBTFTFTF,而不是之前的名称。The value inside of the node tag is the actual value returned by the Uri, which means that for Node Id 20 the DeviceName did not match what was previously expected, and the device name is now U09NRU5FV1ZBTFVF instead of what it was previously.

配置服务提供程序参考Configuration service provider reference