对话机器人框架中的并发机器人状态

Concurrency Bot state in Dialog Bot Framework

我正在构建一个使用对话框与客户端交互的机器人,现在,我正在 IDialogContext[=20] 中使用 PrivateConversationData =] 来存储客户开始与我的机器人聊天时的一些参数。然而,正如我读过 User State Document,他们说:

The maximum amount of data that you can store in each store for a user or conversation is 32 KB. For example, you can store 32 KB of data for User A on channel ABC, 32 KB of data for User A in a private conversation on channel ABC, and 32 KB of data for Conversation 1 on channel ABC.

那么如果许多客户端同时与我的机器人聊天并且我的代码存储了一些参数来查询我的数据库会发生什么,如果下一个客户端与我的机器人通信并使用相同的设置一些参数我的数据是否会丢失名字也是?我很困惑,是每个与机器人聊天的客户端都有自己的 PrivateConversationData 还是所有与机器人连接的客户端都将访问唯一的 PrivateConversationData

PrivateConversationData 存储对于关键用户 + 对话是唯一的,所以不,您的客户不会只访问一个 PrivateConversationData

If you want to save state data for a user on a channel that IS specific to a conversation, use the Private Conversation data store

但是,根据您的写作,似乎在您的案例中使用 UserData 存储会更好,因为您存储在数据包中的数据似乎并不特定于对话。

If you want to save state data for a user on a channel that is NOT specific to a conversation, use the User Data store

查看 State sample to review this concepts. Also, if you want to use a custom storage for the state, review the Custom State 示例。