DDS QoS - RELIABILITY

https://download.csdn.net/download/eidolon_foot/12568768

14. RELIABILITY

OpenDDS Developer's Guide(OpenDDS Version 3.14)
The RELIABILITY policy applies to the topic, data reader, and data writer entities via the reliability member of their respective QoS structures. Below is the IDL related to the reliability QoS policy:
可靠性策略通过其各自QoS结构的可靠性成员而适用于主题、数据读取器和数据写入器实体。 以下是与可靠性QoS策略相关的IDL:
enum ReliabilityQosPolicyKind {
BEST_EFFORT_RELIABILITY_QOS,
RELIABLE_RELIABILITY_QOS
};
struct ReliabilityQosPolicy {
ReliabilityQosPolicyKind kind;
Duration_t max_blocking_time;
};
This policy controls how data readers and writers treat the data samples they process. The “best effort” value ( BEST_EFFORT_RELIABILITY_QOS ) makes no promises as to the reliability of the samples and could be expected to drop samples under some circumstances. The “reliable” value ( RELIABLE_RELIABILITY_QOS ) indicates that the service should eventually deliver all values to eligible data readers.
此策略控制数据读取器和写入器如何处理他们处理的数据样本。 “尽力而为”值(BEST_EFFORT_RELIABILITY_QOS)对样本的可靠性没有任何保证,在某些情况下可能会丢弃样本。 “可靠”值(RELIABLE_RELIABILITY_QOS)表示该服务最终应将所有值传递给合格的数据读取器。
The max_blocking_time member of this policy is used when the history QoS policy is set to “keep all” and the writer is unable to proceed because of resource limits. When this situation occurs and the writer blocks for more than the specified time, then the write fails with a timeout return code. The default for this policy for data readers and topics is “best effort,” while the default value for data writers is “reliable.”
当历史QoS策略设置为“全部保留”并且写入器由于资源限制而无法继续时,将使用此策略的max_blocking_time成员。 如果发生这种情况,并且写入器阻塞的时间超过了指定的时间,则写入将失败,并返回超时返回代码。 数据读取器和主题的此策略的默认值为“尽力而为”,而数据写入器的默认值为“可靠”。
This policy is considered during the creation of associations between data writers and data readers. The value of both sides of the association must be compatible in order for an association to be created. The reliability kind of data writer must be greater than or equal to the value of data reader.
在创建数据写入者和数据读取者之间的关联时会考虑此策略。 关联双方的值必须兼容才能创建关联。 数据写入器的可靠性类型必须大于或等于数据读取器的值。
Data Distribution Service Version 1.4( formal/2015-04-10)
This policy indicates the level of reliability requested by a DataReader or offered by a DataWriter . These levels are ordered, BEST_EFFORT being lower than RELIABLE. A DataWriter offering a level is implicitly offering all levels below.
此策略指示DataReader请求或DataWriter提供的可靠性级别。 这些级别是有序的,BEST_EFFORT低于RELIABLE。 提供级别的DataWriter隐式提供下面的所有级别。
The setting of this policy has a dependency on the setting of the RESOURCE_LIMITS policy. In case the RELIABILITY kind is set to RELIABLE the write operation on the DataWriter may block if the modification would cause data to be lost or else cause one of the limits in specified in the RESOURCE_LIMITS to be exceeded. Under these circumstances, the RELIABILITY max_blocking_time configures the maximum duration the write operation may block.
此策略的设置取决于RESOURCE_LIMITS策略的设置。 如果将RELIABILITY类型设置为RELIABLE,则如果修改将导致数据丢失或导致超出RESOURCE_LIMITS中指定的限制之一,则可能会阻止对DataWriter的写操作。 在这些情况下,RELIABILITY max_blocking_time配置写操作可能阻塞的最大持续时间。
If the RELIABILITY kind is set to RELIABLE, data-samples originating from a single DataWriter cannot be made available to the DataReader if there are previous data-samples that have not been received yet due to a communication error. In other words, the service will repair the error and re-transmit data-samples as needed in order to re-construct a correct snapshot of the DataWriter history before it is accessible by the DataReader .
如果将RELIABILITY类型设置为RELIABLE,则由于通讯错误而无法接收到以前的数据样本,则无法使源自单个DataWriter的数据样本对DataReader可用。 换句话说,该服务将修复错误并根据需要重新传输数据样本,以便在DataReader对其进行访问之前重建DataWriter历史记录的正确快照。
If the RELIABILITY kind is set to BEST_EFFORT, the service will not re-transmit missing data-samples. However for data- samples originating from any one DataWriter the service will ensure they are stored in the DataReader history in the same order they originated in the DataWriter . In other words, the DataReader may miss some data-samples but it will never see the value of a data-object change from a newer value to an order value.
如果将RELIABILITY类型设置为BEST_EFFORT,则该服务将不会重新传输丢失的数据样本。 但是,对于源自任何一个DataWriter的数据样本,服务将确保以与源自DataWriter的顺序相同的顺序将它们存储在DataReader历史记录中。 换句话说,DataReader可能会丢失一些数据样本,但它永远不会看到数据对象的值从较新的值更改为订单值。
The value offered is considered compatible with the value requested if and only if the inequality “offered kind >= requested kind ” evaluates to ‘TRUE.’ For the purposes of this inequality, the values of RELIABILITY kind are considered ordered such that BEST_EFFORT < RELIABLE.
当且仅当不等式“提供的种类> =请求的种类”评估为“ TRUE”时,才认为提供的值与请求的值兼容。出于这种不等式的目的,将RELIABILITY类型的值视为有序的,使得BEST_EFFORT <RELIABLE 。

用ChatGPT

《OpenDDS Developer's Guide》:

这段文本来自《OpenDDS Developer's Guide》版本3.14,介绍了可靠性(RELIABILITY)QoS策略。下面是对上述文本的中文翻译及解释:
### 可靠性(RELIABILITY)
可靠性策略通过各自QoS结构体中的reliability成员应用于主题(topic)、数据读取者(data reader)和数据写入者(data writer)实体。以下是与可靠性QoS策略相关的IDL定义:

enum ReliabilityQosPolicyKind {
  BEST_EFFORT_RELIABILITY_QOS,
  RELIABLE_RELIABILITY_QOS
};

struct ReliabilityQosPolicy {
  ReliabilityQosPolicyKind kind;
  Duration_t max_blocking_time;
};

这一策略控制着数据读取者和写入者处理数据样本的方式。“最大努力”(BEST_EFFORT_RELIABILITY_QOS)不对样本的可靠性作出承诺,在某些情况下可能会丢弃样本。“可靠”的值(RELIABLE_RELIABILITY_QOS)表明服务应该最终将所有值传递给符合条件的数据读取者。
当历史(history)QoS策略设置为“保留所有”(keep all),且由于资源限制无法进行写入操作时,max_blocking_time成员被用来设置。当出现这种情况且写入者阻塞时间超过指定的时间,则写入操作以超时错误码失败。数据读取者和主题的此策略默认值为“最大努力”,而数据写入者的默认值为“可靠”。
在创建数据写入者和数据读取者之间的关联时,会考虑这一策略。两侧的值必须兼容才能创建关联。数据写入者的可靠性级别必须大于或等于数据读取者的值。
### 解释
可靠性QoS策略决定了DDS实体传输数据时的可靠性等级,它可以设置为“最大努力”或“可靠”:
- **最大努力(BEST_EFFORT_RELIABILITY_QOS)**:在这种模式下,数据的传输不保证完全可靠,可能会在网络拥堵或系统资源紧张时丢失数据。
- **可靠(RELIABLE_RELIABILITY_QOS)**:在这种模式下,如果条件允许,DDS会尝试确保所有的数据样本都能被传送到接收者那里。
max_blocking_time是一个控制写入者阻塞行为的设置,当写入者因为达到资源限制而不能继续发送数据时,如果阻塞超过了`max_blocking_time`所规定的时间,写入操作就会因为超时而失败。
可靠性QoS策略在数据写入者和数据读取者建立通信关系时非常重要,因为它们的设置需要相互匹配。通常,数据写入者的可靠性级别应该至少和数据读取者相等,才能确保数据能够可靠地传输。

《Data Distribution Service (DDS)》Version 1.4 :

这是《数据分发服务(DDS)》版本1.4 OMG文件编号:formal/2015-04-10中有关可靠性(RELIABILITY)策略的描述。下面提供该段落的中文翻译以及解释。
中文翻译:
2.2.3.14 可靠性
此策略指示数据读取器(DataReader)请求的或数据写入器(DataWriter)提供的可靠性水平。这些水平是有序的,其中BEST_EFFORT低于RELIABLE。数据写入器提供一个水平时,隐式地也提供了所有低于该水平的水平。
此策略的设置依赖于RESOURCE_LIMITS策略的设置。在可靠性(RELIABILITY)种类设置为RELIABLE的情况下,如果修改将导致数据丢失或超出在RESOURCE_LIMITS中指定的任何限制,数据写入器上的写操作可能会阻塞。在这种情况下,RELIABILITY max_blocking_time配置了写操作可能阻塞的最大持续时间。
如果可靠性(RELIABILITY)种类设置为RELIABLE,那么由于通信错误而尚未接收到的先前的数据样本,单个数据写入器产生的数据样本不会对数据读取器可用。换句话说,服务将修复错误并重新传输数据样本(如有必要),以便在数据样本对数据读取器可访问之前重建数据写入器历史记录的正确快照。
如果可靠性(RELIABILITY)种类设置为BEST_EFFORT,服务将不会重新传输缺失的数据样本。但是,对于来自任何一个数据写入器的数据样本,服务将确保它们按照在数据写入器中产生的相同顺序存储在数据读取器历史中。换句话说,数据读取器可能会错过一些数据样本,但它永远不会看到数据对象的值从一个更新的值变为一个旧的值。
只有当不等式“提供的种类 >= 请求的种类”评估为“TRUE”时,所提供的值才被认为与所请求的值兼容。为了这个不等式的目的,可靠性(RELIABILITY)的值被认为是有序的,如此即BEST_EFFORT < RELIABLE。
解释:
这段文字描述了DDS中的“可靠性”(RELIABILITY)QoS策略,该策略定义了数据在DDS系统中的传输可靠性级别。有两种可靠性级别:BEST_EFFORT(最佳努力)和RELIABLE(可靠)。最佳努力级别不保证数据样本被传输,可能会在某些情况下丢弃数据;而可靠级别则要求系统必须最终将所有数据样本传递给符合条件的DataReader。
可靠性策略的设置受到资源限制(RESOURCE_LIMITS)策略设置的影响。RELIABLE级别可能导致写入操作阻塞,以防止数据的丢失或超出资源限制。在这种情况下,max_blocking_time决定了写入操作可以阻塞的最大时间长度。
如果设置为RELIABLE级别,为了保证数据的一致性,服务会确保在错误被修复之前,由同一个DataWriter生成的数据样本不会被DataReader所访问。这意味着DDS会尝试重传数据以恢复完整的数据序列。
如果设置为BEST_EFFORT级别,DDS不会重传丢失的数据样本,但是会保证数据样本按照在DataWriter中的生成顺序存储在DataReader的历史记录中。
兼容性检查是基于提供和请求的可靠性级别,只有提供的级别大于等于请求的级别时,才被认为是兼容的。在这里,BEST_EFFORT级别被认为是低于RELIABLE级别。

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

109702008

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值