Data management method based on ownership QoS (Quality of Service) in subscription publishing mechanism

By introducing ownership QoS into the publish-subscribe mechanism and setting the ownership value and type of topic data, the data consistency problem when multiple publishers update is solved, which simplifies application logic, improves data consistency, and meets the data communication needs between devices.

CN121691079APending Publication Date: 2026-03-17CHINA HELICOPTER RES & DEV INST
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In a publish-subscribe mechanism, when multiple publishers update the same topic data simultaneously, the subscribers cannot guarantee data consistency, leading to disordered order or inconsistency, which requires complex application-layer logic to manage.

Method used

By adopting the ownership QoS approach, the ownership value of topic data is set on the publishing end, and the ownership QoS type is configured on the subscription end. Data consistency is ensured through a filtering mechanism, supporting both shared and exclusive data reception methods, and simplifying the upper-layer application logic.

Benefits of technology

It achieves data consistency, reliability, and security in complex scenarios, simplifies the processing logic of upper-layer applications, and meets the data communication needs between devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121691079A_ABST
    Figure CN121691079A_ABST
Patent Text Reader

Abstract

The invention provides a data management method based on ownership QoS (Quality of Service) in a subscription publishing mechanism. The method comprises the following steps: step 1, setting an ownership weight of theme data published by a publishing end; step 2, configuring the ownership QoS type of the theme data received by the subscription end; step 3, the subscription terminal screens the theme data according to the ownership QoS type of the theme data and the ownership weight of the theme data; through the method, the upper-layer application can select a sharing type or an exclusive type according to a use scene, aiming at the exclusive type and each piece of owned data, the existence of a unique sequence can be ensured, the data consistency is ensured, meanwhile, the processing logic of the upper-layer application is also simplified, and the use is more flexible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and specifically relates to a data management method based on ownership QoS in a publish-subscribe mechanism. Background Technology

[0002] The publish-subscribe mechanism is a commonly used message communication mechanism, widely used in distributed systems and message middleware. It greatly benefits system decoupling and increases system scalability. However, during transmission, when multiple publishers update the same topic data at the same time, if the subscriber does not have a coordination mechanism, it will cause the subscriber to receive values ​​in the wrong order or inconsistently, and strong data consistency cannot be guaranteed. The subscriber needs to implement complex management logic at the application layer. Summary of the Invention

[0003] Purpose of the invention: Based on the above problems, this paper designs a specific implementation method of ownership QoS based on the publish-subscribe mechanism, supporting shared and exclusive types, which respectively represent the subscriber receiving all data from matching publishers and receiving only data from the publisher with the highest weight. Through this method, upper-layer applications can choose between shared and exclusive types according to the use case. For exclusive types, each piece of data owned can be guaranteed to have a unique sequence, ensuring data consistency, while also simplifying the processing logic of upper-layer applications and making it more flexible to use.

[0004] This application provides a data management method based on ownership QoS in a publish-subscribe mechanism, the method comprising: Step 1: Set the ownership value of the topic data published on the publishing platform; Step 2: Configure the ownership QoS type of the topic data received by the subscriber; Step 3: The subscriber filters the topic data based on the ownership QoS type and ownership weight of the topic data.

[0005] Preferably, the ownership value is an integer value greater than or equal to 0. The larger the ownership value, the higher the ownership strength. The publishing end with higher ownership strength can cover the data of the publishing end with lower ownership strength.

[0006] Preferably, the range of the ownership value is [0, 255].

[0007] Preferably, the ownership QoS type includes shared and exclusive types.

[0008] Preferably, the shared type means that the subscriber receives data from all matching publishers, and the exclusive type means that it only receives data from the publisher with the highest weight.

[0009] Preferably, the method further includes: In the QoS configuration, privilege priority is set. The privilege priority of a topic can only be enabled by one node. If the node sets the privilege priority for this topic, then the data published by the node should be received optimally.

[0010] Preferably, the method further includes: If the subscription is shared, then all data on this topic published by all publishers will be stored in the cache; If the subscription is exclusive, then only the data from that privileged node will be received and cached, while data from other nodes will be discarded.

[0011] Preferably, step 3 includes: Filter the received topic data according to different configurations; If the subscription is configured as shared, all topic data will be sent to the user. If the subscription is configured as exclusive, the implementation of exclusive ownership is mainly implemented on the receiving end. That is, all topic data will still be sent to the subscription end via the network, and then processed differently after being received on the subscription end. a) If the data ownership value is greater than or equal to the value, update the ownership value and notify the user of the data; if the data ownership value is less than the maximum value of the record, discard all cached data for that topic on that node and do not submit it to the user again. b) If the node with the highest priority does not send topic data for a long time, it will only receive data from the second highest priority node and wait for the highest priority node to come online before resuming the reception of data from that node. c) By maintaining the weight mapping table when unmatching, the peer with the highest current priority can be dynamically maintained. When the peer with the highest priority is unmatched, it is deleted from the mapping table, and the priority of the mapping table header is naturally adjusted at this time. d) If the subscriber has all ownership values ​​> 0, no privilege priority is set, and it receives topic data from multiple publishers simultaneously, then it will only receive topic data from the publisher with the highest ownership value currently online; if the subscriber has all ownership values ​​0, no privilege priority is set, and it receives topic data from multiple publishers simultaneously, then it will receive topic data from all online publishers; if the subscriber has set a privilege priority, and the publisher corresponding to that privilege priority is online, then it will only receive topic data of that privilege priority.

[0012] This application has the following technical effects: This application provides an ownership QoS method for data distribution services, designing a scientific and reasonable method for ownership usage of multiple publishers publishing the same topic. The technology mentioned in this application has already been tested in several embedded systems. By setting ownership for publish / subscribe topics, it not only simplifies upper-layer application logic and processing overhead but also ensures data consistency, reliability, and security in various complex scenarios, demonstrating good performance and meeting the data communication needs between devices. Attached Figure Description

[0013] Figure 1 This is a schematic diagram of a shared ownership configuration provided in an embodiment of this application; Figure 2 This is a schematic diagram of an exclusive ownership configuration provided in an embodiment of this application; Figure 3 This is an ownership QoS data flow diagram provided in an embodiment of this application. Detailed Implementation Please see Figures 1-3 Based on data distribution services, this invention includes the following: 1) Functional Overview Ownership QoS (OWNERSHIP QoS) supports shared and exclusive modes, which mean that the subscriber receives data from all matching publishers and only receives data from the publisher with the highest weight, respectively.

[0014] Ownership QoS configuration ownership weight value, which is an integer value not less than 0, with a weight value range of [0, 255]. The larger the value, the higher the ownership strength. Publishers with higher ownership strength can cover the data of publishers with lower ownership strength.

[0015] 2) Processing flow The upper-layer application sets the theme ownership value, whether to bind privilege priority, and privilege priority value.

[0016] The ownership value on the subscription side indicates whether it should handle the ownership value on the publishing side: (1) When the subscription weight is configured to 0, it indicates a shared type, which is the default configuration. This means that the receiver can receive sample data from all matching counterparts. Figure 1 ; (2) When the subscriber weight is configured to be greater than 0, it indicates an exclusive type. Under this configuration, the subscriber will only receive the topic data with the highest weight among all matching counterparts. Figure 2 This illustrates a scenario where the subscriber's weight is 1, and one publisher's weight is 4, which is greater than the other publisher's weight of 1. In this case, when both publishers send data simultaneously, the subscriber will only receive the sample data with the larger weight on the left.

[0017] 3) Setting privilege priority Privilege priority can be set in the QoS configuration. A topic's privilege priority can only be enabled by one node. If a node has a privilege priority set for this topic, then the data published by that node should be optimally received. If the subscriber is shared, all data published by all publishers on this topic will be cached; if the subscriber is exclusive, only data from the privileged node will be received and cached, discarding data from other nodes. The privilege priority weight table data structure is shown in Table 1.

[0018] Table 1. Privilege Priority Weight Table Data Structure Definition

[0019] 4) Inter-node topic subscription ownership QoS software unit design a) Design for inserting peer information into the weight table of the publishing end. Input data: A table containing the IDs and ownership values ​​of all peer nodes in the subscribed topic, the peer node ID to be inserted, and the peer ownership value to be inserted. Output data: Maximum weight in the weight table, number of peers for this subscribed topic in the weight table, and a table of all submitted data sequence numbers for the current subscribed topic from all peers. Processing procedure: i. Locate the peer node information in the ownership value table; ii. If it does not exist, insert it into the ownership and value table in ascending order of peer node ID, synchronously update the submitted data sequence number of the peer, and increment the number of peers subscribing to the topic by 1; iii. Update the maximum weight in the current subscribed topic weight table.

[0020] b) Privilege Priority Subscription Theme Binding Design Input data: Subscribed topic ID, privilege priority weight Output data: Privilege priority weight table pointer, number of privilege priority topics Return value: 0 for success / -1 for failure Processing procedure: Look up the subscription topic ID in the privilege priority weight table; If it does not exist, insert the topic ID information and privilege priority weight information in ascending order of the subscribed topic ID; The number of privileged priority topics is increased by 1.

[0021] c) Privilege and Priority Peer Information Binding Design Input data: Subscribed topic ID, peer node ID, ownership value Output data: Privilege priority weight table pointer Return value: 0 for success / -1 for failure Processing procedure: Search for the subscription topic ID in the privilege priority weight table; return -1 if it does not exist. Determine if the current weight is within the privileged priority range of the subscribed topic. If so, bind the node ID and return 0; otherwise, return -1. d) Privilege and Priority Peer Online Information Judgment Design Input data: Subscribe to the topic Return value: 0 (online) / -1 (offline) Processing procedure: Search for the subscription topic ID in the privilege priority weight table. If it exists, return 0; otherwise, return -1.

[0022] 5) Design of QoS software units for segmented topic subscription ownership Determine whether the current topic data has the right to be forwarded to the destination partition based on the topic ID and the subscription node ID. Input data: Subscribed topic ID, topic message content, message source partition ID Return value: 0 - authorized to forward / -1 - unauthorized to forward Processing procedure: Determine if you have permission to subscribe to the current topic; return -1 if you do not. If the current topic ownership is non-exclusive, return 0; If the current message source partition is registered as a privileged ownership level, return 0; If the current subscriber has exclusive ownership, the current message source partition has the highest ownership, and the peer has no privileged priority, return 0; Otherwise, return -1.

[0023] 6) Software unit design for clearing ownership and rights values ​​when the peer node goes offline a) Update the ownership value table of subscribed topics Input data: Peer node ID Processing procedure: Determine whether the current peer is in the ownership and weight table of each subscribed topic. If it exists, clear the corresponding weight table to zero. Reorder the ownership and rights of each subscribed topic after clearing them according to the node ID; Each subscribed topic receives a new ownership and value table.

[0024] b) Update the maximum ownership value across all peers for each subscribed topic. Input data: Peer node ID Processing procedure: Iterate through the ownership value table of the subscribed topics to obtain the maximum ownership value of the peer.

[0025] c) Clear privilege priority weights Input data: Peer node ID Processing procedure: Search for the peer node ID in the privilege priority weight table. If it exists, clear the privilege priority weight to 0.

[0026] This application provides an ownership QoS method for data distribution services, designing a scientific and reasonable method for ownership usage of multiple publishers publishing the same topic. The technology mentioned in this application has already been tested in several embedded systems. By setting ownership for publish / subscribe topics, it not only simplifies upper-layer application logic and processing overhead but also ensures data consistency, reliability, and security in various complex scenarios, demonstrating good performance and meeting the data communication needs between devices.

Claims

1. A method for data management based on ownership QoS in a subscription publication mechanism, characterized in that, The method comprises: Step 1, setting the ownership weight value of the topic data published by a publishing end; Step 2, configuring the ownership QoS type of the topic data received by a subscribing end; Step 3, the subscribing end filters the topic data according to the ownership QoS type of the topic data and the ownership weight value of the topic data.

2. The method of claim 1, wherein, The ownership weight value is an integer value greater than or equal to 0, and the greater the ownership weight value, the higher the ownership strength, and the publishing end with higher strength ownership can cover the data of the publishing end with lower strength ownership.

3. The method of claim 2, wherein, The interval of the ownership weight value is [0, 255].

4. The method of claim 3, wherein, The ownership QoS type comprises a shared type and an exclusive type.

5. The method of claim 4, wherein, The shared type means that the subscribing end receives all the matching publishing end data, and the exclusive type means that only the data of the publishing end with the highest weight value is received.

6. The method of claim 5, wherein, The method further comprises: Setting a priority in the QoS configuration, and the priority of a topic can only be enabled by one node, if the node sets the priority for the topic, the data published by the node should be optimally received.

7. The method of claim 6, wherein, The method further comprises: If the subscribing end is of the shared type, all the topic data published by the publishing end is stored in the cache; If the subscribing end is of the exclusive type, only the data of the priority node is received and stored, and the data of other nodes is discarded.

8. The method of claim 7, wherein, The step 3 comprises: Filtering the received topic data according to different configurations; If the subscribing end is configured as the shared type, all the topic data is notified to the user; If the subscribing end is configured as the exclusive type, the implementation of the exclusive type ownership is mainly realized at the receiving end, that is, all the topic data is still sent to the subscribing end through the network, and then the subscribing end distinguishes and processes the received data; a) if the data ownership weight value is greater than or equal to the value, the ownership weight value is updated, and the data is notified to the user, if the data ownership weight value is less than the maximum value recorded, all the data of the node on the topic cached is discarded, and is no longer submitted to the user; b) if the node with the highest weight value does not occur for a long time, only the data with the second highest priority is received, and the data of the node with the highest priority is restored after the node with the highest priority is online; c) the weight value mapping table is maintained when the matching is released, the opposite end with the current maximum priority can be dynamically maintained, when the opposite end with the maximum priority is released, the opposite end is deleted from the mapping table, and the priority of the head of the mapping table is naturally adjusted; d) if the subscribing end is configured with the ownership weight value>0, the priority is not set, and the topic data from multiple publishing ends is received, only the topic data of the publishing end with the highest ownership weight value online is received; if the subscribing end is configured with the ownership weight value of 0, the priority is not set, and the topic data from multiple publishing ends is received, all the topic data of the online publishing end is received; if the subscribing end sets the priority, and the publishing end corresponding to the priority is online, only the priority topic data is received.

Citation Information

Patent Citations

  • Information publishing and subscribing system capable of classified pushing, and information publishing and subscribing method

    CN113536102A

  • High-availability DDS protocol conversion gateway

    CN116388938A