CN105763607A - Subscription content acquisition method, equipment and system - Google Patents
Subscription content acquisition method, equipment and system Download PDFInfo
- Publication number
- CN105763607A CN105763607A CN201610082114.4A CN201610082114A CN105763607A CN 105763607 A CN105763607 A CN 105763607A CN 201610082114 A CN201610082114 A CN 201610082114A CN 105763607 A CN105763607 A CN 105763607A
- Authority
- CN
- China
- Prior art keywords
- content
- serial number
- node
- value
- list item
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/562—Brokering proxy services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
一种订阅内容获取方法、设备及系统,用于解决在根节点向订阅节点发送新内容时若订阅节点不在线,则会收不到根节点发送的新内容的问题。该方法包括:中间节点接收订阅节点发送的第一请求消息;中间节点确定存储了用于处理第一部分内容的第一表项,则中间节点根据第一请求消息携带的内容更新第一表项;第一表项包括第一部分内容的标识;中间节点接收备份节点发送的第二部分内容;第二部分内容包括具有第一序列号的第一内容,第一部分内容是第二部分内容的子集;中间节点根据更新后的第一表项包括的路由信息,将第二部分内容发送给订阅节点。
A subscription content acquisition method, device and system are used to solve the problem that if the subscription node is not online when the root node sends new content to the subscription node, the new content sent by the root node will not be received. The method includes: the intermediate node receives the first request message sent by the subscribing node; the intermediate node determines that the first entry for processing the first part of content is stored, and the intermediate node updates the first entry according to the content carried in the first request message; The first entry includes the identifier of the first part of the content; the intermediate node receives the second part of the content sent by the backup node; the second part of the content includes the first content with the first serial number, and the first part of the content is a subset of the second part of the content; The intermediate node sends the second part of content to the subscribing node according to the routing information included in the updated first entry.
Description
技术领域technical field
本发明涉及通信领域,特别涉及一种订阅内容获取方法、设备及系统。The present invention relates to the communication field, and in particular to a method, device and system for acquiring subscribed content.
背景技术Background technique
目前,在信息中心网络(Information-centricNetworking,ICN)中,用户可以订阅自己感兴趣的内容。比如,ICN中根据内容的不同,可以设置多个会和节点(Rendezvousnode,RN),或者也可以将其称为根节点,不同的RN可以存储不同的内容,例如有些RN可以存储体育类的内容,有些RN可以存储财经类的内容订阅,等等,一般来说,当内容提供方有新内容时,都会向相应的RN推送新的内容。当用户想订阅相关内容的时候,可以向相应的RN进行订阅,这样,在RN收到内容提供方发布的内容后,可以向所有订阅相关内容的用户进行推送。Currently, in an Information-centric Networking (ICN), users can subscribe to content they are interested in. For example, in ICN, depending on the content, multiple meeting nodes (Rendezvousnode, RN) can be set up, or it can also be called the root node. Different RNs can store different content. For example, some RNs can store sports content. , some RNs can store financial content subscriptions, etc. Generally speaking, when content providers have new content, they will push new content to the corresponding RN. When a user wants to subscribe to relevant content, he can subscribe to the corresponding RN. In this way, after the RN receives the content published by the content provider, it can push it to all users who subscribe to the relevant content.
例如请参见图1A,节点1和节点2均在会和节点中订阅了体育类的内容,则在消息提供方(例如为图1A中的节点3)向会和节点推送体育类的新内容后,会和节点就可以将这些新内容分别发送给节点1和节点2。当然图1A是比较简略的图,在图1A示出的各个节点之间可能还会有一些中间节点,图1A中未画出。For example, please refer to Figure 1A, both Node 1 and Node 2 have subscribed to the content of sports in the meeting node, then after the message provider (such as node 3 in Figure 1A) pushes the new content of sports to the meeting node , and the nodes can send these new contents to node 1 and node 2 respectively. Of course, FIG. 1A is a relatively simple diagram, and there may be some intermediate nodes between the nodes shown in FIG. 1A , which are not shown in FIG. 1A .
然而,目前的订阅流程,如果RN在向订阅用户发送新的内容时订阅用户不在线,则订阅用户就可能收不到所订阅的内容,在订阅用户再次上线后,RN也不会再次向订阅用户发送之前已经发送过的内容,这样就会发生丢失信息的情况。以图1A为例,如果会和节点在向节点1和节点2发送新内容的时候节点2不在线,则节点2就收不到这部分新内容。However, in the current subscription process, if the subscriber is not online when the RN sends new content to the subscriber, the subscriber may not receive the subscribed content. After the subscriber goes online again, the RN will not submit the subscription again. The user sends content that has already been sent before, so the loss of information will occur. Taking Figure 1A as an example, if node 2 is not online when the meeting node sends new content to node 1 and node 2, node 2 cannot receive this part of the new content.
发明内容Contents of the invention
本发明实施例提供一种订阅内容获取方法、设备及系统,用于解决在根节点向订阅节点发送新内容时若订阅节点不在线,则会收不到根节点发送的新内容的问题。Embodiments of the present invention provide a subscription content acquisition method, device and system, which are used to solve the problem that if the subscription node is not online when the root node sends new content to the subscription node, the new content sent by the root node will not be received.
第一方面,提供第一种订阅内容获取方法,该方法包括:中间节点接收订阅节点发送的用于获取所订阅的第一部分内容的第一请求消息,中间节点确定存储了用于处理第一部分内容的第一表项,则中间节点根据第一请求消息携带的内容更新第一表项。之后,中间节点接收备份节点发送的第二部分内容,中间节点根据更新后的第一表项包括的中间节点到订阅节点的路由信息,将第二部分内容发送给订阅节点。其中,第一请求消息携带第一序列号,第一序列号为第一部分内容包括的第一内容的序列号,第一序列号为第一部分内容所包括的各内容的序列号中值最小的序列号。第一表项包括第一部分内容的标识。第二部分内容包括具有第一序列号的第一内容,第一部分内容是第二部分内容的子集。In the first aspect, a first method for obtaining subscribed content is provided, the method includes: an intermediate node receives a first request message sent by a subscribing node for obtaining the subscribed first part of content, and the intermediate node determines to store the first part of content for processing the first entry, the intermediate node updates the first entry according to the content carried in the first request message. Afterwards, the intermediate node receives the second part of content sent by the backup node, and the intermediate node sends the second part of content to the subscribing node according to the routing information from the intermediate node to the subscribing node included in the updated first entry. Wherein, the first request message carries a first serial number, the first serial number is the serial number of the first content included in the first part of content, and the first serial number is the sequence with the smallest value among the serial numbers of the contents included in the first part of content No. The first entry includes an identifier of the first part of content. The second portion of content includes first content with a first serial number, the first portion of content being a subset of the second portion of content.
本发明实施例中,订阅节点如果未收到某些内容,则订阅节点可以发送用于获取这些内容的请求消息(例如为第一请求消息),在第一请求消息中可以携带这部分内容的序列号中的最小序列号,这样订阅节点就可以接收这部分内容,从而,订阅节点即使离线,上线后也可以重新请求获得丢失的内容,或者订阅节点即使因为网络异常等原因未接收到一部分订阅内容,后续也可以重新请求获得这些内容,尽量避免内容丢失的情况。In the embodiment of the present invention, if the subscribing node does not receive certain content, the subscribing node may send a request message (for example, a first request message) for obtaining the content, and the first request message may carry the information of this part of the content The smallest serial number in the serial number, so that the subscribing node can receive this part of the content, so that even if the subscribing node is offline, it can re-request the lost content after going online, or even if the subscribing node does not receive part of the subscription due to network abnormalities and other reasons Content, you can also re-request to obtain the content in the future, so as to avoid the loss of content as much as possible.
结合第一方面,在第一方面的第一种可能的实现方式中,中间节点根据第一请求消息携带的内容更新第一表项,可以通过以下方式实现:中间节点判断第一表项中包括的序列号的值是否小于等于第一序列号的值,若第一表项中包括的序列号的值小于等于第一序列号的值,中间节点在第一表项中添加中间节点到订阅节点的路由信息,得到更新后的第一表项,且中间节点丢弃第一请求消息。With reference to the first aspect, in a first possible implementation of the first aspect, the intermediate node updates the first entry according to the content carried in the first request message, which may be implemented in the following manner: the intermediate node judges that the first entry includes Whether the value of the sequence number is less than or equal to the value of the first sequence number, if the value of the sequence number included in the first entry is less than or equal to the value of the first sequence number, the intermediate node adds the intermediate node to the subscribing node in the first entry routing information to obtain the updated first entry, and the intermediate node discards the first request message.
如果第一表项中包括的序列号的值小于等于第一序列号的值,则中间节点可以确定第一请求消息所请求的内容是第一表项所请求的内容的子集,则中间节点只需在第一表项中添加中间节点到该订阅节点的路由信息即可获得第一请求消息所请求的内容,而无需再转发第一请求消息,节省传输资源。If the value of the sequence number included in the first entry is less than or equal to the value of the first sequence number, the intermediate node may determine that the content requested by the first request message is a subset of the content requested by the first entry, and the intermediate node The content requested by the first request message can be obtained only by adding the routing information from the intermediate node to the subscribing node in the first entry, without forwarding the first request message, saving transmission resources.
结合第一方面,在第一方面的第二种可能的实现方式中,中间节点根据第一请求消息携带的内容更新第一表项,可以这样实现:中间节点判断第一表项中包括的序列号的值是否小于等于第一序列号的值,若第一表项中包括的序列号的值大于第一序列号的值,中间节点将第一表项中包括的序列号的值更新为第一序列号的值,在第一表项中添加中间节点到订阅节点的路由信息,得到更新后的第一表项。那么,在中间节点根据第一请求消息携带的内容更新第一表项之后,中间节点可以将第一请求消息转发给备份节点。In combination with the first aspect, in the second possible implementation of the first aspect, the intermediate node updates the first entry according to the content carried in the first request message, which can be implemented as follows: the intermediate node judges the sequence included in the first entry Whether the value of the number is less than or equal to the value of the first serial number, if the value of the serial number included in the first entry is greater than the value of the first serial number, the intermediate node will update the value of the serial number included in the first entry to the first The value of a sequence number, and the routing information from the intermediate node to the subscribing node is added to the first entry to obtain the updated first entry. Then, after the intermediate node updates the first entry according to the content carried in the first request message, the intermediate node may forward the first request message to the backup node.
即,如果第一表项中包括的序列号的值大于第一序列号的值,表明第一请求消息所请求的内容多于第一表项所请求的内容,那么中间节点可以修改第一表项中的序列号,并且将第一请求消息转发给备份节点,从而可以获得第一请求消息所请求的内容。这样,也无需增加新的表项,直接使用第一表项就可以完成后续对第一请求消息所请求的内容的转发。That is, if the value of the sequence number included in the first entry is greater than the value of the first sequence number, indicating that the content requested by the first request message is more than that requested by the first entry, the intermediate node can modify the first table The sequence number in the item, and forward the first request message to the backup node, so that the content requested by the first request message can be obtained. In this way, there is no need to add a new entry, and the subsequent forwarding of the content requested by the first request message can be completed by directly using the first entry.
结合第一方面或第一方面的第一种可能的实现方式或第二种可能的实现方式,在第一方面的第三种可能的实现方式中,在中间节点接收备份节点发送的所述第二部分内容之后,中间节点还可以确定第二部分内容包括的各内容的序列号中值最小的序列号等于更新后的第一表项中包括的序列号。With reference to the first aspect or the first possible implementation manner or the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the intermediate node receives the first possible implementation manner sent by the backup node. After the second part of content, the intermediate node may also determine that the serial number with the smallest value among the serial numbers of the contents included in the second part of content is equal to the serial number included in the updated first entry.
如果第二部分内容包括的各内容的序列号中值最小的序列号等于更新后的第一表项中包括的序列号,则中间节点可以确定第二部分内容是更新后的第一表项所请求的内容,这样中间节点才将第二部分内容转发给订阅节点,否则中间节点可以丢弃第二部分内容,通过这种方式可以提高转发的内容的准确性。If the serial number with the smallest value among the serial numbers of the contents included in the second part of content is equal to the serial number included in the updated first entry, the intermediate node can determine that the second part of the content is included in the updated first entry. The content of the request, so that the intermediate node forwards the second part of the content to the subscribing node, otherwise the intermediate node can discard the second part of the content, in this way the accuracy of the forwarded content can be improved.
结合第一方面,在第一方面的第四种可能的实现方式中,第一请求消息还携带第二序列号,第二序列号为第一部分内容包括的第二内容的序列号,第二序列号为第一部分内容所包括的各内容的序列号中值最大的序列号。With reference to the first aspect, in a fourth possible implementation of the first aspect, the first request message also carries a second serial number, the second serial number is the serial number of the second content included in the first part of content, and the second serial number The number is the serial number with the largest value among the serial numbers of the contents included in the first part of content.
第一请求消息除了可以携带第一序列号之外还可以携带第二序列号,这样订阅节点可以明确指示究竟需要哪些内容,从而可以使得接收的内容更符合订阅节点的要求。In addition to the first sequence number, the first request message may also carry the second sequence number, so that the subscribing node can clearly indicate what content is needed, so that the received content can better meet the requirements of the subscribing node.
结合第一方面或第一方面的第一种可能的实现方式至第四种可能的实现方式中的任一种可能的实现方式,在第一方面的第五种可能的实现方式中,在中间节点接收订阅节点发送的用于获取所订阅的第一部分内容的第一请求消息之后,中间节点还可以查询本地是否存储了第一部分内容,若本地未存储第一部分内容,则中间节点查询是否存储了用于处理第一部分内容的第一表项。Combining the first aspect or any of the first possible implementation manner to the fourth possible implementation manner of the first aspect, in the fifth possible implementation manner of the first aspect, in the middle After the node receives the first request message sent by the subscribing node for obtaining the subscribed first part of the content, the intermediate node can also query whether the first part of the content is stored locally. If the first part of the content is not stored locally, the intermediate node queries whether it is stored The first entry used to process the first part of content.
结合第一方面的第五种可能的实现方式,在第一方面的第六种可能的实现方式中,在中间节点查询本地是否存储了第一部分内容之后,若本地存储了第一部分内容,中间节点可以将第一部分内容发送给订阅节点。In combination with the fifth possible implementation of the first aspect, in the sixth possible implementation of the first aspect, after the intermediate node inquires whether the first part of content is stored locally, if the first part of content is stored locally, the intermediate node The first part of content can be sent to subscribing nodes.
即,中间节点接收第一请求消息之后,可以首先在本地查询是否存储了第一请求消息所请求的第一部分内容,如果本地存储了这些内容,则中间节点可以直接将本地存储的第一部分内容发送给订阅节点,无需再进行后面的流程,节省获取订阅内容的流程,提高获取订阅内容的效率,也节省传输资源。如果本地未存储这些内容,则中间节点可以继续进行后面的流程,以尽量保证订阅节点能够获取到第一部分内容。That is, after the intermediate node receives the first request message, it can first query locally whether the first part of the content requested by the first request message is stored locally. If the content is stored locally, the intermediate node can directly send the locally stored first part of the content to For subscribing nodes, there is no need to go through the following process, which saves the process of obtaining subscription content, improves the efficiency of obtaining subscription content, and saves transmission resources. If the content is not stored locally, the intermediate node can continue the following process to try to ensure that the subscribing node can obtain the first part of the content.
结合第一方面或第一方面的第一种可能的实现方式至第六种可能的实现方式中的任一种可能的实现方式,在第一方面的第七种可能的实现方式中,在中间节点根据第一请求消息携带的内容更新第一表项之前,中间节点还可以确定第一表项中包括的第三序列号的值是否小于等于第一序列号的值,及第一表项中包括的第四序列号的值是否大于等于第二序列号的值,若第一表项中包括的第三序列号的值小于等于第一序列号的值,及第一表项中包括的第四序列号的值大于等于第二序列号的值,中间节点在第一表项中添加中间节点到订阅节点的路由信息,得到更新后的第一表项,且中间节点丢弃第一请求消息。其中,第一表项包括第三序列号和第四序列号,第三序列号为第一表项所请求的内容的序列号中值最小的序列号,第四序列号为第一表项所请求的内容的序列号中值最大的序列号。Combining the first aspect or any one of the first possible implementation manner to the sixth possible implementation manner of the first aspect, in the seventh possible implementation manner of the first aspect, in the middle Before the node updates the first entry according to the content carried in the first request message, the intermediate node can also determine whether the value of the third sequence number included in the first entry is less than or equal to the value of the first sequence number, and whether the value of the third sequence number included in the first entry Whether the value of the fourth sequence number included is greater than or equal to the value of the second sequence number, if the value of the third sequence number included in the first entry is less than or equal to the value of the first sequence number, and the value of the first sequence number included in the first entry The value of the fourth sequence number is greater than or equal to the value of the second sequence number, the intermediate node adds the routing information from the intermediate node to the subscribing node in the first entry, obtains the updated first entry, and the intermediate node discards the first request message. Wherein, the first entry includes a third sequence number and a fourth sequence number, the third sequence number is the sequence number with the smallest value among the sequence numbers of the content requested by the first entry, and the fourth sequence number is the sequence number requested by the first entry. The serial number with the highest value among the serial numbers of the requested content.
即,除了第一请求消息可以携带两个序列号之外,中间节点中存储的表项也可以包括两个序列号,那么,在第一表项包括两个序列号、以及第一请求消息携带了两个序列号的前提下,中间节点可以判断第一请求消息所请求的内容是否是第一表项所请求的内容的子集,如果是,则中间节点只需在第一表项中添加中间节点到订阅节点的路由信息就可以在后续将得到的内容转发给订阅节点,无需再将第一请求消息向下转发,节省传输资源。That is, in addition to the first request message can carry two sequence numbers, the entry stored in the intermediate node can also include two sequence numbers, then, the first entry includes two sequence numbers, and the first request message carries On the premise that two serial numbers are provided, the intermediate node can judge whether the content requested by the first request message is a subset of the content requested by the first entry, and if so, the intermediate node only needs to add The routing information from the intermediate node to the subscribing node can then forward the obtained content to the subscribing node, without forwarding the first request message downwards, saving transmission resources.
结合第一方面的第七种可能的实现方式,在第一方面的第八种可能的实现方式中,若第一表项中包括的第三序列号的值大于第一序列号的值和/或第一表项中包括的第四序列号的值小于第二序列号的值,中间节点建立第二表项,第二表项包括第一部分内容的标识、第一序列号、第二序列号、及中间节点到订阅节点的路由信息,中间节点可以将第一请求消息转发给备份节点。With reference to the seventh possible implementation of the first aspect, in the eighth possible implementation of the first aspect, if the value of the third serial number included in the first entry is greater than the value of the first serial number and/or Or the value of the fourth sequence number included in the first entry is smaller than the value of the second sequence number, the intermediate node creates a second entry, and the second entry includes the identification of the first part of the content, the first sequence number, and the second sequence number , and routing information from the intermediate node to the subscribing node, the intermediate node may forward the first request message to the backup node.
即,如果第一请求消息所请求的内容不是第一表项所请求的内容的子集,则中间节点需要重新建立针对第一请求消息的表项,即第二表项,从而可以较为准确地获取第一部分内容。That is, if the content requested by the first request message is not a subset of the content requested by the first entry, the intermediate node needs to re-establish the entry for the first request message, that is, the second entry, so that the Get the content of the first part.
结合第一方面,在第一方面的第九种可能的实现方式中,在中间节点接收订阅节点发送的用于获取所订阅的第一部分内容的第一请求消息之后,若确定未存储用于处理第一部分内容的第一表项,则中间节点还可以建立第二表项,第二表项包括第一部分内容的标识、第一序列号、及中间节点到订阅节点的路由信息,中间节点可以将第一请求消息转发给备份节点。With reference to the first aspect, in the ninth possible implementation of the first aspect, after the intermediate node receives the first request message sent by the subscribing node for obtaining the subscribed first part of content, if it is determined that the The first entry of the first part of the content, the intermediate node can also create a second entry, the second entry includes the identifier of the first part of the content, the first serial number, and the routing information from the intermediate node to the subscribing node, and the intermediate node can set the The first request message is forwarded to the backup node.
即,如果未存储第一表项,则中间节点可以新建立针对第一请求消息的表项,即第二表项,从而可以较为准确地获取第一部分内容。That is, if the first entry is not stored, the intermediate node can newly create an entry for the first request message, that is, a second entry, so that the first part of content can be acquired more accurately.
结合第一方面的第九种可能的实现方式,在第一方面的第十种可能的实现方式中,第二表项还包括携带在第一请求消息中的第二序列号,第二序列号为第一部分内容包括的第二内容的序列号,第二序列号为第一部分内容所包括的各内容的序列号中值最大的序列号。With reference to the ninth possible implementation manner of the first aspect, in the tenth possible implementation manner of the first aspect, the second entry further includes a second sequence number carried in the first request message, and the second sequence number is the serial number of the second content included in the first part of content, and the second serial number is the serial number with the largest value among the serial numbers of the contents included in the first part of content.
如果第一请求消息中还携带第二序列号,那么中间节点在建立第二表项时也可以一并将第二序列号添加到第二表项中,从而能够实现更为准确地请求。If the first request message also carries the second sequence number, the intermediate node may also add the second sequence number to the second entry when creating the second entry, so as to realize a more accurate request.
第二方面,提供第二种订阅内容获取方法,该方法包括:订阅节点发送用于获取所订阅的第一部分内容的第一请求消息,订阅节点接收第二部分内容。其中,第一请求消息携带第一序列号,第一序列号为第一部分内容包括的第一内容的序列号,第一序列号为第一部分内容所包括的各内容的序列号中值最小的序列号,第二部分内容包括具有第一序列号的第一内容,第一部分内容是第二部分内容的子集。In a second aspect, a second method for obtaining subscribed content is provided. The method includes: a subscribing node sends a first request message for obtaining the subscribed first part of content, and the subscribing node receives the second part of content. Wherein, the first request message carries a first serial number, the first serial number is the serial number of the first content included in the first part of content, and the first serial number is the sequence with the smallest value among the serial numbers of the contents included in the first part of content number, the second part of content includes the first content with the first serial number, and the first part of content is a subset of the second part of content.
例如订阅节点可能因为离线或者因为网络异常等原因丢失了一部分订阅的内容,则订阅节点只需发送第一请求消息就可以获得所订阅的内容,方式较为简单。For example, the subscribing node may lose part of the subscribed content due to offline or network anomalies, and the subscribing node only needs to send the first request message to obtain the subscribed content, which is relatively simple.
结合第二方面,在第二方面的第一种可能的实现方式中,第一请求消息还携带第二序列号,第二序列号为第一部分内容包括的第二内容的序列号,第二序列号为第一部分内容所包括的各内容的序列号中值最大的序列号。With reference to the second aspect, in the first possible implementation of the second aspect, the first request message also carries a second serial number, the second serial number is the serial number of the second content included in the first part of the content, and the second serial number The number is the serial number with the largest value among the serial numbers of the contents included in the first part of content.
第一请求消息除了可以携带第一序列号之外还可以携带第二序列号,从而可以使得所请求的内容更为准确,更符合订阅节点的需求。In addition to carrying the first sequence number, the first request message may also carry the second sequence number, so that the requested content is more accurate and more in line with the requirements of the subscribing nodes.
结合第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,在订阅节点发送用于获取所订阅的第一部分内容的第一请求消息之前,订阅节点可以确定最新接收的两个内容的序列号不连续。With reference to the first possible implementation of the second aspect, in the second possible implementation of the second aspect, before the subscribing node sends the first request message for acquiring the subscribed first part of content, the subscribing node may It is determined that the sequence numbers of the two most recently received contents are not consecutive.
即,如果订阅节点确定最新接收的两个内容的序列号不连续,则订阅节点可以确定丢失了部分内容,在这种情况下,订阅节点可以发送第一请求消息,以请求获取丢失的内容。That is, if the subscribing node determines that the sequence numbers of the two newly received contents are not consecutive, the subscribing node may determine that part of the content is lost, and in this case, the subscribing node may send a first request message to request to obtain the missing content.
结合第二方面或第二方面的第一种可能的实现方式或第二种可能的实现方式,在第二方面的第三种可能的实现方式中,在订阅节点接收第二部分内容之后,订阅节点判断第二部分内容包括的各内容的序列号中值最小的序列号是否小于所述第一序列号,若第二部分内容包括的各内容的序列号中值最小的序列号小于第一序列号,订阅节点可以删除第二部分内容中的至少一个内容。其中,至少一个内容中值最小的序列号为第二部分内容包括的各内容的序列号中值最小的序列号,至少一个内容中值最大的序列号为第一序列号减1。In combination with the second aspect or the first possible implementation manner or the second possible implementation manner of the second aspect, in the third possible implementation manner of the second aspect, after the subscribing node receives the second part of content, subscribe The node judges whether the serial number with the smallest value among the serial numbers of the contents included in the second part of content is smaller than the first serial number, if the serial number with the smallest value among the serial numbers of the contents included in the second part of content is smaller than the first serial number number, the subscribing node can delete at least one content in the second part of content. Wherein, the serial number with the smallest value in at least one content is the serial number with the smallest value among the serial numbers of the contents included in the second part of content, and the serial number with the largest value in at least one content is the first serial number minus 1.
即,订阅节点可以从接收的内容中删除与之前接收的内容重复的内容,节省存储空间。That is, the subscribing node can delete content that is duplicated with previously received content from the received content, saving storage space.
第三方面,提供一种中间节点,该中间节点包括:存储器,用于存储指令;通信接口,用于接收订阅节点发送的用于获取所订阅的第一部分内容的第一请求消息;第一请求消息携带第一序列号,第一序列号为第一部分内容包括的第一内容的序列号,第一序列号为第一部分内容所包括的各内容的序列号中值最小的序列号;处理器,用于执行存储器存储的指令,确定存储了用于处理第一部分内容的第一表项,则根据第一请求消息携带的内容更新第一表项;第一表项包括第一部分内容的标识;通信接口,用于接收备份节点发送的第二部分内容;第二部分内容包括具有第一序列号的第一内容,第一部分内容是第二部分内容的子集;通信接口,用于根据更新后的第一表项包括的中间节点到订阅节点的路由信息,将第二部分内容发送给订阅节点。In a third aspect, an intermediate node is provided, and the intermediate node includes: a memory for storing instructions; a communication interface for receiving a first request message sent by a subscribing node for obtaining the subscribed first part of content; the first request The message carries a first serial number, the first serial number is the serial number of the first content included in the first part of content, and the first serial number is the serial number with the smallest value among the serial numbers of the contents included in the first part of content; the processor, An instruction for executing memory storage, determining that the first entry for processing the first part of the content is stored, then updating the first entry according to the content carried in the first request message; the first entry includes the identifier of the first part of the content; communicating The interface is used to receive the second part of the content sent by the backup node; the second part of the content includes the first content with the first serial number, and the first part of the content is a subset of the second part of the content; the communication interface is used to The routing information from the intermediate node to the subscribing node included in the first entry sends the second part of content to the subscribing node.
结合第三方面,在第三方面的第一种可能实现方式中,处理器可以用于根据第一请求消息携带的内容更新第一表项,包括:判断第一表项中包括的序列号的值是否小于等于第一序列号的值,若第一表项中包括的序列号的值小于等于所述第一序列号的值,在第一表项中添加中间节点到所述订阅节点的路由信息,得到更新后的第一表项,且丢弃第一请求消息。With reference to the third aspect, in a first possible implementation manner of the third aspect, the processor may be configured to update the first entry according to the content carried in the first request message, including: determining the sequence number included in the first entry Whether the value is less than or equal to the value of the first sequence number, if the value of the sequence number included in the first entry is less than or equal to the value of the first sequence number, add the route from the intermediate node to the subscribing node in the first entry information, obtain the updated first entry, and discard the first request message.
结合第三方面,在第三方面的第二种可能实现方式中,处理器用于根据第一请求消息携带的内容更新第一表项,包括:判断第一表项中包括的序列号的值是否小于等于第一序列号的值;若第一表项中包括的序列号的值大于第一序列号的值,将第一表项中包括的序列号的值更新为第一序列号的值,在第一表项中添加中间节点到所述订阅节点的路由信息,得到更新后的第一表项。通信接口还用于:在处理器根据第一请求消息携带的内容更新第一表项之后,将第一请求消息转发给备份节点。With reference to the third aspect, in a second possible implementation manner of the third aspect, the processor is configured to update the first entry according to the content carried in the first request message, including: judging whether the value of the sequence number included in the first entry is Less than or equal to the value of the first serial number; if the value of the serial number included in the first entry is greater than the value of the first serial number, update the value of the serial number included in the first entry to the value of the first serial number, The routing information from the intermediate node to the subscribing node is added to the first entry to obtain an updated first entry. The communication interface is further configured to: forward the first request message to the backup node after the processor updates the first entry according to the content carried in the first request message.
结合第三方面或第三方面的第一种可能实现方式或第二种可能实现方式,在第三方面的第三种可能实现方式中,处理器还用于:在通信接口接收备份节点发送的第二部分内容之后,确定第二部分内容包括的各内容的序列号中值最小的序列号等于更新后的第一表项中包括的序列号。With reference to the third aspect or the first possible implementation of the third aspect or the second possible implementation of the third aspect, in a third possible implementation of the third aspect, the processor is further configured to: receive at the communication interface the After the second part of content, it is determined that the serial number with the smallest value among the serial numbers of the contents included in the second part of content is equal to the serial number included in the updated first entry.
结合第三方面,在第三方面的第四种可能实现方式中,第一请求消息还携带第二序列号,第二序列号为第一部分内容包括的第二内容的序列号,第二序列号为第一部分内容所包括的各内容的序列号中值最大的序列号。With reference to the third aspect, in a fourth possible implementation of the third aspect, the first request message also carries a second serial number, the second serial number is the serial number of the second content included in the first part of content, and the second serial number It is the serial number with the largest value among the serial numbers of the contents included in the first part of content.
结合第三方面或第三方面的第一种可能的实现方式至第四种可能的实现方式中的任一种可能的实现方式,在第三方面的第五种可能实现方式中,处理器还用于:在通信接口接收订阅节点发送的用于获取所订阅的第一部分内容的第一请求消息之后,查询本地是否存储了第一部分内容,若本地未存储第一部分内容,则查询是否存储了用于处理第一部分内容的第一表项。In combination with the third aspect or any possible implementation manner of the first possible implementation manner to the fourth possible implementation manner of the third aspect, in a fifth possible implementation manner of the third aspect, the processor further Used for: after the communication interface receives the first request message sent by the subscribing node for obtaining the subscribed first part of the content, query whether the first part of the content is stored locally; if the first part of the content is not stored locally, then query whether the user It is used to process the first entry of the first part of content.
结合第三方面的第五种可能的实现方式,在第三方面的第六种可能实现方式中,处理器还用于:若本地存储了第一部分内容,则通过通信接口将第一部分内容发送给订阅节点。With reference to the fifth possible implementation of the third aspect, in a sixth possible implementation of the third aspect, the processor is further configured to: if the first part of content is stored locally, send the first part of content to the Subscribe to a node.
结合第三方面或第三方面的第一种可能的实现方式至第六种可能的实现方式中的任一种可能的实现方式,在第三方面的第七种可能实现方式中,处理器还用于:在根据第一请求消息携带的内容更新所述第一表项之前,确定第一表项中包括的第三序列号的值是否小于等于第一序列号的值,及第一表项中包括的第四序列号的值是否大于等于第二序列号的值。处理器用于根据第一请求消息携带的内容更新第一表项,包括:若第一表项中包括的第三序列号的值小于等于第一序列号的值,及第一表项中包括的第四序列号的值大于等于第二序列号的值,在第一表项中添加中间节点到订阅节点的路由信息,得到更新后的第一表项,且丢弃第一请求消息。其中,第一表项包括第三序列号和第四序列号,第三序列号为第一表项所请求的内容的序列号中值最小的序列号,第四序列号为第一表项所请求的内容的序列号中值最大的序列号。In combination with the third aspect or any possible implementation manner of the first possible implementation manner to the sixth possible implementation manner of the third aspect, in a seventh possible implementation manner of the third aspect, the processor further It is used to: before updating the first entry according to the content carried in the first request message, determine whether the value of the third sequence number included in the first entry is less than or equal to the value of the first sequence number, and the first entry Whether the value of the fourth serial number included in is greater than or equal to the value of the second serial number. The processor is configured to update the first entry according to the content carried in the first request message, including: if the value of the third sequence number included in the first entry is less than or equal to the value of the first sequence number, and the value included in the first entry The value of the fourth sequence number is greater than or equal to the value of the second sequence number, and the routing information from the intermediate node to the subscribing node is added to the first entry to obtain the updated first entry, and the first request message is discarded. Wherein, the first entry includes a third sequence number and a fourth sequence number, the third sequence number is the sequence number with the smallest value among the sequence numbers of the content requested by the first entry, and the fourth sequence number is the sequence number requested by the first entry. The serial number with the highest value among the serial numbers of the requested content.
结合第三方面的第七种可能的实现方式,在第三方面的第八种可能实现方式中,处理器还用于:若第一表项中包括的第三序列号的值大于第一序列号的值和/或第一表项中包括的第四序列号的值小于第二序列号的值,建立第二表项,第二表项包括所述第一部分内容的标识、第一序列号、第二序列号、及所述中间节点到订阅节点的路由信息,通信接口还用于将第一请求消息转发给备份节点。With reference to the seventh possible implementation of the third aspect, in an eighth possible implementation of the third aspect, the processor is further configured to: if the value of the third sequence number included in the first entry is greater than the value of the first sequence number and/or the value of the fourth sequence number included in the first entry is less than the value of the second sequence number, and a second entry is established, the second entry includes the identification of the first part of the content, the first sequence number , the second serial number, and routing information from the intermediate node to the subscribing node, and the communication interface is further configured to forward the first request message to the backup node.
结合第三方面,在第三方面的第九种可能实现方式中,处理器还用于:在通信接口接收订阅节点发送的用于获取所订阅的第一部分内容的第一请求消息之后,确定未存储用于处理所述第一部分内容的第一表项,则建立第二表项,第二表项包括第一部分内容的标识、第一序列号、及中间节点到订阅节点的路由信息,通信接口还用于将第一请求消息转发给备份节点。With reference to the third aspect, in a ninth possible implementation manner of the third aspect, the processor is further configured to: after the communication interface receives the first request message sent by the subscribing node for acquiring the subscribed first part of content, determine that the Store the first entry for processing the first part of content, then create a second entry, the second entry includes the identifier of the first part of content, the first serial number, and the routing information from the intermediate node to the subscribing node, and the communication interface It is also used to forward the first request message to the backup node.
结合第三方面的第九种可能实现方式,在第三方面的第十种可能实现方式中,第二表项还包括携带在第一请求消息中的第二序列号,第二序列号为第一部分内容包括的第二内容的序列号,第二序列号为第一部分内容所包括的各内容的序列号中值最大的序列号。With reference to the ninth possible implementation manner of the third aspect, in a tenth possible implementation manner of the third aspect, the second entry further includes a second sequence number carried in the first request message, and the second sequence number is The serial number of the second content included in the part of content, the second serial number is the serial number with the largest value among the serial numbers of the contents included in the first part of content.
第四方面,提供一种订阅节点,该订阅节点包括:存储器,用于存储指令,处理器,用于执行存储器存储的指令,生成用于获取所订阅的第一部分内容的第一请求消息,通信接口,用于发送该第一请求消息,还用于接收第二部分内容。其中,第一请求消息携带第一序列号,第一序列号为第一部分内容包括的第一内容的序列号,第一序列号为第一部分内容所包括的各内容的序列号中值最小的序列号,第二部分内容包括具有第一序列号的所述第一内容,第一部分内容是第二部分内容的子集。In a fourth aspect, a subscription node is provided, the subscription node includes: a memory for storing instructions, a processor for executing the instructions stored in the memory, generating a first request message for obtaining the subscribed first part of content, and communicating An interface, configured to send the first request message, and also configured to receive the second part of content. Wherein, the first request message carries a first serial number, the first serial number is the serial number of the first content included in the first part of content, and the first serial number is the sequence with the smallest value among the serial numbers of the contents included in the first part of content number, the second part of content includes the first content with the first serial number, and the first part of content is a subset of the second part of content.
结合第四方面,在第四方面的第一种可能的实现方式中,第一请求消息还携带第二序列号,第二序列号为第一部分内容包括的第二内容的序列号,第二序列号为第一部分内容所包括的各内容的序列号中值最大的序列号。With reference to the fourth aspect, in the first possible implementation of the fourth aspect, the first request message also carries a second serial number, the second serial number is the serial number of the second content included in the first part of the content, and the second serial number The number is the serial number with the largest value among the serial numbers of the contents included in the first part of content.
结合第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,订阅节点还包括存储器和处理器,其中,存储器用于存储指令,处理器用于执行存储器存储的指令,在通信接口发送用于获取所订阅的第一部分内容的第一请求消息之前,确定最新接收的两个内容的序列号不连续。With reference to the first possible implementation of the fourth aspect, in a second possible implementation of the fourth aspect, the subscribing node further includes a memory and a processor, where the memory is used to store instructions, and the processor is used to execute memory storage Before the communication interface sends the first request message for acquiring the subscribed first part of content, it is determined that the sequence numbers of the two newly received contents are not consecutive.
结合第四方面或第四方面的第一种可能的实现方式或第二种可能的实现方式,在第四方面的第三种可能的实现方式中,订阅节点还包括存储器和处理器,其中,存储器用于存储指令,处理器用于执行存储器存储的指令,在通信接口接收第二部分内容之后,判断第二部分内容包括的各内容的序列号中值最小的序列号是否小于第一序列号,若第二部分内容包括的各内容的序列号中值最小的序列号小于第一序列号,删除第二部分内容中的至少一个内容。其中,至少一个内容中值最小的序列号为第二部分内容包括的各内容的序列号中值最小的序列号,至少一个内容中值最大的序列号为第一序列号减1。With reference to the fourth aspect or the first possible implementation manner or the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, the subscribing node further includes a memory and a processor, wherein, The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory. After the communication interface receives the second part of the content, it is judged whether the serial number with the smallest value among the serial numbers of the contents included in the second part of the content is smaller than the first serial number, If the serial number with the smallest value among the serial numbers of the contents included in the second part of content is smaller than the first serial number, at least one content in the second part of content is deleted. Wherein, the serial number with the smallest value in at least one content is the serial number with the smallest value among the serial numbers of the contents included in the second part of content, and the serial number with the largest value in at least one content is the first serial number minus 1.
第五方面,提供一种内容订阅系统,该系统包括中间节点和备份节点。中间节点,用于接收订阅节点发送的用于获取所订阅的第一部分内容的第一请求消息,确定存储了用于处理第一部分内容的第一表项,则根据第一请求消息携带的内容更新第一表项。接收备份节点发送的第二部分内容,根据更新后的第一表项包括的中间节点到订阅节点的路由信息,将第二部分内容发送给订阅节点。其中,第一请求消息携带第一序列号,第一序列号为第一部分内容包括的第一内容的序列号,第一序列号为第一部分内容所包括的各内容的序列号中值最小的序列号,第一表项包括第一部分内容的标识,第二部分内容包括具有第一序列号的第一内容,第一部分内容是第二部分内容的子集。备份节点,用于得到第二部分内容,并将第二部分内容通过中间节点发送给订阅节点。In a fifth aspect, a content subscription system is provided, and the system includes an intermediate node and a backup node. The intermediate node is configured to receive the first request message sent by the subscribing node for acquiring the subscribed first part of content, determine that the first entry for processing the first part of content is stored, and then update the content according to the content carried in the first request message The first entry. The second part of content sent by the backup node is received, and the second part of content is sent to the subscribing node according to the routing information from the intermediate node to the subscribing node included in the updated first entry. Wherein, the first request message carries a first serial number, the first serial number is the serial number of the first content included in the first part of content, and the first serial number is the sequence with the smallest value among the serial numbers of the contents included in the first part of content number, the first entry includes the identifier of the first part of content, the second part of content includes the first content with the first serial number, and the first part of content is a subset of the second part of content. The backup node is used to obtain the second part of the content, and send the second part of the content to the subscribing node through the intermediate node.
其中,备份节点中存储的内容可以来自于根节点,根节点接收内容提供节点发布的内容后,可以根据本地的时间为接收的每个内容设置唯一的序列号,并可以将内容以及为内容设置的序列号均发送给备份节点,从而备份节点就可以保存各内容以及内容的序列号,在订阅节点请求获得内容时,备份节点可以将所请求的内容以及所请求的内容的序列号均发送给订阅节点。Among them, the content stored in the backup node can come from the root node. After receiving the content published by the content providing node, the root node can set a unique serial number for each content received according to the local time, and can set the content and The serial numbers of the content are sent to the backup node, so that the backup node can save the content and the serial number of the content. When the subscribing node requests the content, the backup node can send the requested content and the serial number of the requested content to Subscribe to a node.
第六方面,提供另一种中间节点,该中间节点可以包括用于执行第一方面的方法的功能单元。In a sixth aspect, another intermediate node is provided, and the intermediate node may include a functional unit for executing the method in the first aspect.
第七方面,提供另一种订阅节点,该订阅节点可以包括用于执行第二方面的方法的功能单元。In a seventh aspect, another subscribing node is provided, and the subscribing node may include a functional unit for executing the method of the second aspect.
第八方面,本发明实施例提供了一种计算机存储介质,用于储存为上述中间节点所用的计算机软件指令,其包含用于执行上述方面为中间节点所设计的程序。In an eighth aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions for the above-mentioned intermediate node, which includes a program designed for the intermediate node to execute the above-mentioned aspect.
第九方面,本发明实施例提供了一种计算机存储介质,用于储存为上述订阅节点所用的计算机软件指令,其包含用于执行上述方面为订阅节点所设计的程序。In a ninth aspect, an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the above-mentioned subscribing node, which includes a program designed for the subscribing node to execute the above aspect.
本发明实施例中,订阅节点如果未收到某些内容,则订阅节点可以发送第一请求消息,在第一请求消息中可以携带这部分内容的部分序列号,这样订阅节点就可以接收这部分内容,从而,订阅节点即使离线,上线后也可以重新请求获得丢失的内容,或者订阅节点即使因为网络异常等原因未接收到一部分订阅内容,后续也可以重新请求获得这些内容,尽量避免内容丢失的情况。In the embodiment of the present invention, if the subscribing node does not receive some content, the subscribing node can send a first request message, and the first request message can carry a part of the serial number of this part of the content, so that the subscribing node can receive this part Therefore, even if the subscribing node is offline, it can re-request for the lost content after going online, or even if the subscribing node does not receive part of the subscription content due to network abnormalities, etc., it can re-request the content in the future to avoid content loss as much as possible Condition.
本发明中,中间节点、订阅节点和备份节点的名字对设备本身不构成限定,在实际实现中,这些设备可以以其他名称出现。只要各个设备的功能和本发明类似,属于本发明权利要求及其等同技术的范围之内。In the present invention, the names of intermediate nodes, subscribing nodes and backup nodes do not limit the devices themselves, and these devices may appear with other names in actual implementation. As long as the functions of each device are similar to those of the present invention, they fall within the scope of the claims of the present invention and their equivalent technologies.
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。These or other aspects of the present invention will be more clearly understood in the description of the following embodiments.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例中所需要使用的附图作简单地介绍,显而易见地,下面所介绍的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings required in the embodiments of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1A为ICN网络的示意图;FIG. 1A is a schematic diagram of an ICN network;
图1B为本发明实施例提供的ICN网络的架构图;FIG. 1B is a structural diagram of an ICN network provided by an embodiment of the present invention;
图2为本发明实施例提供的中间节点的一种实现方式的示意图;FIG. 2 is a schematic diagram of an implementation manner of an intermediate node provided by an embodiment of the present invention;
图3为本发明实施例提供的一种订阅内容获取方法的交互图;FIG. 3 is an interaction diagram of a method for acquiring subscribed content provided by an embodiment of the present invention;
图4为本发明实施例提供的另一种内容订阅方法的交互图;FIG. 4 is an interaction diagram of another content subscription method provided by an embodiment of the present invention;
图5为本发明实施例提供的中间节点的一种可能的结构框图;FIG. 5 is a possible structural block diagram of an intermediate node provided by an embodiment of the present invention;
图6为本发明实施例提供的订阅节点的一种可能的结构框图。Fig. 6 is a possible structural block diagram of a subscribing node provided by an embodiment of the present invention.
具体实施方式detailed description
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明实施例保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the embodiments of the present invention.
本文中描述的技术可用于基于信息内容进行路由的通信系统,例如信息中心网络(Information-centricNetworking,ICN)系统,以及其他此类通信系统或今后出现的演进系统。The techniques described herein can be used in communication systems that route based on information content, such as Information-centric Networking (ICN) systems, and other such communication systems or future evolved systems.
以下,对本发明实施例中的部分用语进行解释说明,以便于本领域技术人员理解。In the following, some terms used in the embodiments of the present invention are explained to facilitate the understanding of those skilled in the art.
1)ICN,是一种未来的互联网架构之一,同传统的网际协议(InternetProtocol,IP)网络相比,ICN的路由是基于信息内容的路由。在ICN下,可以使用兴趣(Interest)消息进行内容请求,以及可以使用数据(Data)消息来发送所请求的内容,即Data消息可以携带数据,Data消息本身可以看作数据包。1) ICN is one of the future Internet architectures. Compared with the traditional Internet Protocol (Internet Protocol, IP) network, the routing of ICN is routing based on information content. Under the ICN, an Interest message can be used to request content, and a Data message can be used to send the requested content, that is, the Data message can carry data, and the Data message itself can be regarded as a data packet.
2)ICN中的订阅节点(Subscriber),可以由物理机(例如服务器)实现,或者也可以由虚拟机实现,用于订阅相应的内容。2) The subscription node (Subscriber) in the ICN may be implemented by a physical machine (such as a server), or may also be implemented by a virtual machine, and is used for subscribing to corresponding content.
3)ICN中的根节点,例如包括RN,可以接收内容发布方(Publisher)所发布的内容,其中,内容发布方也可以称为内容发布节点。在本发明实施例中,RN可以根据接收每个内容的时间为每个内容设置序列号,从而每个内容都可以唯一对应一个序列号,各个内容之间避免出现乱序的现象。RN所接收的内容发布方提供的内容中,可能有些内容是订阅节点所订阅的内容,那么RN可以主动将订阅节点已订阅的内容发送给订阅节点。根节点可以由物理机(例如服务器)实现,或者也可以由虚拟机实现。3) The root node in the ICN, including, for example, the RN, can receive content published by a content publisher (Publisher), where the content publisher can also be called a content publishing node. In the embodiment of the present invention, the RN can set a serial number for each content according to the time when each content is received, so that each content can uniquely correspond to a serial number, and the phenomenon of out-of-sequence between various contents can be avoided. Among the content provided by the content publisher received by the RN, some of the content may be the content subscribed by the subscribing node, so the RN can actively send the content subscribed by the subscribing node to the subscribing node. The root node may be implemented by a physical machine (such as a server), or may also be implemented by a virtual machine.
4)ICN中的备份节点,例如包括Broker(中间人服务器)节点,该备份节点可以是网络中的各个内容发布方已经发布的所有内容的备份节点。例如,备份节点也可以作为内容订阅方,即也可以作为一个订阅节点,向网络中的所有的RN订阅内容,在RN接收内容发布方所提供的内容后,可以为内容设置序列号,然后可以将接收的内容以及设置的序列号发送给备份节点,备份节点收到RN推送的内容后,可以进行保存。备份节点可以由物理机(例如服务器)实现,或者也可以由虚拟机实现。4) The backup node in the ICN, for example, includes a Broker (intermediary server) node, which may be a backup node for all content published by each content publisher in the network. For example, the backup node can also act as a content subscriber, that is, it can also serve as a subscription node to subscribe content to all RNs in the network. After the RN receives the content provided by the content publisher, it can set a serial number for the content, and then can Send the received content and the set serial number to the backup node, and the backup node can save the content after receiving the content pushed by RN. The backup node may be implemented by a physical machine (such as a server), or may also be implemented by a virtual machine.
5)ICN中的中间节点,可以包括位于订阅节点和RN(或备份节点)之间的节点,还可以包括位于内容提供节点和RN之间的节点,还可以包括位于备份节点和RN之间的节点,等等。5) The intermediate nodes in the ICN may include nodes located between the subscribing node and the RN (or backup node), nodes located between the content providing node and the RN, and nodes located between the backup node and the RN node, etc.
6)终端设备,是指向用户提供语音和/或数据连通性的设备,例如可以包括具有无线连接功能的手持式设备、或连接到无线调制解调器的处理设备。该终端设备可以经无线接入网(RadioAccessNetwork,RAN)与核心网进行通信,与RAN交换语音和/或数据。该终端设备可以包括UE、无线终端设备、移动终端设备、订户单元(SubscriberUnit)、订户站(SubscriberStation),移动站(MobileStation)、移动台(Mobile)、远程站(RemoteStation)、接入点(AccessPoint,AP)、远程终端设备(RemoteTerminal)、接入终端设备(AccessTerminal)、用户终端设备(UserTerminal)、用户代理(UserAgent)、或用户装备(UserDevice)等。例如,可以包括移动电话(或称为“蜂窝”电话),具有移动终端设备的计算机,NB-IoT中的专用终端设备,便携式、袖珍式、手持式、计算机内置的或者车载的移动装置。例如,个人通信业务(PersonalCommunicationService,PCS)电话、无绳电话、会话发起协议(SIP)话机、无线本地环路(WirelessLocalLoop,WLL)站、个人数字助理(PersonalDigitalAssistant,PDA)等设备。6) A terminal device is a device that provides voice and/or data connectivity to a user, and may include, for example, a handheld device with a wireless connection function, or a processing device connected to a wireless modem. The terminal device can communicate with the core network via a radio access network (Radio Access Network, RAN), and exchange voice and/or data with the RAN. The terminal equipment may include UE, wireless terminal equipment, mobile terminal equipment, subscriber unit (SubscriberUnit), subscriber station (SubscriberStation), mobile station (MobileStation), mobile station (Mobile), remote station (RemoteStation), access point (AccessPoint , AP), remote terminal device (RemoteTerminal), access terminal device (AccessTerminal), user terminal device (UserTerminal), user agent (UserAgent), or user equipment (UserDevice), etc. For example, it may include mobile phones (or "cellular" phones), computers with mobile terminal equipment, dedicated terminal equipment in NB-IoT, portable, pocket, handheld, computer built-in or vehicle-mounted mobile devices. For example, Personal Communication Service (Personal Communication Service, PCS) phone, cordless phone, Session Initiation Protocol (SIP) phone, Wireless Local Loop (Wireless Local Loop, WLL) station, Personal Digital Assistant (Personal Digital Assistant, PDA) and other devices.
7)本发明实施例中的术语“系统”和“网络”可被互换使用。“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。7) The terms "system" and "network" in the embodiments of the present invention may be used interchangeably. "Multiple" means two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. In addition, the character "/", unless otherwise specified, generally indicates that the associated objects before and after are in an "or" relationship.
下面介绍本发明实施例的方案所涉及的一些原理及系统架构图。Some principles and system architecture diagrams involved in the solution of the embodiment of the present invention are introduced below.
为了支撑ICN的基本的内容请求和内容的发送,在中间节点中可以维护以下三种基本的表格,中间节点可以利用如下的三种表格完成对Interest消息的路由和对Data消息的转发。In order to support the basic content request and content transmission of ICN, the following three basic tables can be maintained in the intermediate node, and the intermediate node can use the following three tables to complete the routing of Interest messages and the forwarding of Data messages.
1、转发信息表(ForwardinginformationBase,FIB),用于将Interest消息路由到潜在的匹配数据源。FIB中可以存储<内容名称前缀,接口列表>元组,可以采用最长匹配方式进行查询。例如,订阅节点通过Interest消息请求相关内容,在Interest中可以携带所要请求的内容的名称的前缀,例如一个可能的前缀为/Sports,那么中间节点接收Interest消息后,通过查询FIB,可以知道该Interest消息应通过哪个接口转发,也就相当于知道Interest消息所请求的内容位于哪个数据源,比如,中间节点接收Interest消息后,通过查询FIB,确定该Interest消息应通过接口1转发,接口1对应的是RN1。FIB中的信息可以通过手动配置或者基于名称的路由协议进行自动更新。1. A forwarding information base (Forwarding information Base, FIB), used to route Interest messages to potential matching data sources. The <content name prefix, interface list> tuple can be stored in the FIB, and can be queried by the longest match method. For example, the subscribing node requests relevant content through the Interest message, and the Interest can carry the prefix of the name of the content to be requested, for example, a possible prefix is /Sports, then the intermediate node can know the Interest by querying the FIB after receiving the Interest message The interface through which the message should be forwarded is equivalent to knowing which data source the content requested by the Interest message is located in. For example, after the intermediate node receives the Interest message, it can determine that the Interest message should be forwarded through interface 1 by querying the FIB. Interface 1 corresponds to It is RN1. The information in the FIB can be updated automatically through manual configuration or name-based routing protocols.
2、待处理请求表(PendingInterestTable,PIT),用于保存内容请求方(订阅节点)的上行的入接口信息,以保证当该订阅节点所请求的内容到达时,中间节点能正确地将该内容发送给该订阅节点。一般情况下,根据前缀的不同,一个前缀可以对应一条PIT表项,待请求的内容被转发给订阅节点后,中间节点可以删除与该内容匹配的PIT表项,对于长时间未得到所请求的内容的PIT表项,中间节点可以通过超时机制将其进行删除,以尽量节省中间节点的存储空间,也空出PIT表项给更多的Interest消息使用。2. The pending request table (PendingInterestTable, PIT), which is used to save the upstream inbound interface information of the content requester (subscribing node), so as to ensure that when the content requested by the subscribing node arrives, the intermediate node can correctly send the content sent to the subscribing node. Generally, according to different prefixes, a prefix can correspond to a PIT entry. After the content to be requested is forwarded to the subscribing node, the intermediate node can delete the PIT entry that matches the content. The PIT entry of the content, the intermediate node can delete it through the timeout mechanism, so as to save the storage space of the intermediate node as much as possible, and also free up the PIT entry for more Interest messages.
另外,PIT表项可以实现聚合,比如,中间节点先接收订阅节点1发送的Interest消息1,Interest消息1携带的内容的名称的前缀为前缀1,则中间节点为前缀1创建PIT表项,该PIT表项包括前缀1,及包括订阅节点1的上行接口信息。之后中间节点又接收订阅节点2发送的Interest消息2,Interest消息2携带的内容的名称的前缀例如也是前缀1,那么就认为这两个订阅节点所请求的内容相同,那么中间节点无需为Interest消息2再创建PIT表项,直接将订阅节点2的上行接口信息添加到为前缀1创建的PIT表项中即可,也无需再转发Interest消息2,例如可以丢弃Interest消息2,这样可以减少后续节点接收的Interest消息的数量,也节省传输资源。对于聚合的PIT表项,当中间节点接收到所请求的内容后,中间节点可以将该内容分别发送给PIT表项中包括的多个上行接口信息对应的订阅节点。In addition, the PIT entries can be aggregated. For example, the intermediate node first receives the Interest message 1 sent by the subscription node 1. The prefix of the content name carried by the Interest message 1 is prefix 1, and the intermediate node creates a PIT entry for the prefix 1. The PIT entry includes prefix 1, and includes uplink interface information of subscribing node 1. Afterwards, the intermediate node receives the Interest message 2 sent by the subscribing node 2. The prefix of the name of the content carried by the Interest message 2 is also prefix 1, so it is considered that the content requested by the two subscribing nodes is the same, and the intermediate node does not need to be an Interest message. 2 Create a PIT entry again, and directly add the uplink interface information of the subscribing node 2 to the PIT entry created for prefix 1, and there is no need to forward Interest message 2, for example, Interest message 2 can be discarded, which can reduce the number of subsequent nodes The number of received Interest messages also saves transmission resources. For the aggregated PIT entry, after the intermediate node receives the requested content, the intermediate node may respectively send the content to the subscribing nodes corresponding to the multiple uplink interface information included in the PIT entry.
3、内容仓库表(ContentStore,CS),订阅节点请求过的内容,途经的中间节点可以选择进行缓存,CS表可以存储中间节点缓存的内容的信息。这样有新的订阅节点请求内容的时候,中间节点可以直接从缓存中获取相关内容,而无需再从内容的原始提供方(例如RN)中获取内容,减少获取内容的流程,提高获取内容的效率。3. The content warehouse table (ContentStore, CS), the content requested by the subscribing node, the intermediate node passing through can choose to cache, and the CS table can store the information of the content cached by the intermediate node. In this way, when a new subscription node requests content, the intermediate node can directly obtain the relevant content from the cache instead of obtaining the content from the original content provider (such as RN), which reduces the process of obtaining content and improves the efficiency of obtaining content .
中间节点在接收Interest消息后,处理过程如下:After the intermediate node receives the Interest message, the process is as follows:
首先中间节点可以查找CS表。如果在CS表里找到Interest消息所请求的内容,则中间节点可以从该中间节点的缓存中获取该内容,并将该内容从接收到该Interest消息的接口转发出去,同时丢弃Interest消息,无需再向后转发,处理结束。如果在CS表里未找到Interest消息所请求的内容,则中间节点确定本地未缓存该Interest消息所请求的内容,则中间节点可以查找PIT,如果在PIT中找到了与该Interest消息所请求的内容的名称的前缀匹配的PIT表项,则说明此前已经有其他的与该Interest消息请求相同内容的Interest消息被转发出去并且在等待内容,则中间节点可以将接收到的当前的Interest消息的入接口信息添加到该PIT表项,同时丢弃该Interest信息,处理结束。如果在PIT中也未找到与该Interest消息所请求的内容的名称的前缀匹配的PIT表项,则中间节点可以查找FIB,如果在FIB中找到与该Interest消息所请求的内容的名称的前缀匹配的前缀,则中间节点根据该Interest消息所请求的内容的名称的前缀以及该Interest消息的入接口信息建立一个新的PIT表项,该PIT表项的名称即为该Interest消息中携带的内容的名称的前缀,该PIT表项中的请求(Requested)信息为该Interest消息的入接口信息,然后,该中间节点可以将该Interest消息通过FIB转发至下一跳节点。而如果在FIB中也未找到与该Interest消息所请求的内容的名称的前缀匹配的前缀,则丢弃该Interest消息,确定处理失败。First the intermediate node can look up the CS table. If the content requested by the Interest message is found in the CS table, the intermediate node can obtain the content from the cache of the intermediate node, forward the content through the interface that received the Interest message, and discard the Interest message at the same time, without further Forwarding backwards, the processing ends. If the content requested by the Interest message is not found in the CS table, the intermediate node determines that the content requested by the Interest message is not cached locally, and the intermediate node can search the PIT. If the content requested by the Interest message is found in the PIT If the prefix of the name matches the PIT entry, it means that other Interest messages with the same content as the Interest message request have been forwarded before and are waiting for the content, then the intermediate node can send the received current Interest message to the incoming interface Information is added to the PIT entry, and the Interest information is discarded at the same time, and the processing ends. If no PIT entry matching the prefix of the name of the content requested by the Interest message is found in the PIT, the intermediate node can search the FIB, and if a match is found in the FIB with the prefix of the name of the content requested by the Interest message prefix, the intermediate node creates a new PIT entry according to the prefix of the name of the content requested by the Interest message and the inbound interface information of the Interest message, and the name of the PIT entry is the content of the Interest message. The prefix of the name, the requested (Requested) information in the PIT entry is the inbound interface information of the Interest message, and then the intermediate node can forward the Interest message to the next hop node through the FIB. And if no prefix matching the prefix of the name of the content requested by the Interest message is found in the FIB, the Interest message is discarded, and the processing is determined to fail.
与对Interest消息的处理方式相对应,中间节点如果接收到Data消息,则对Data消息的处理流程如下:Corresponding to the processing method of the Interest message, if the intermediate node receives the Data message, the processing flow of the Data message is as follows:
中间节点可以查找PIT,如果在PIT中找到与该Data消息所包括的内容的名称的前缀相匹配的PIT表项,则中间节点可以将该Data消息转发到该PIT表项记录的所有Interest消息的入接口,另外,中间节点可以缓存该Data消息包括的内容,并将缓存的该内容的信息记录在CS表中,以在其他节点再次请求该内容时可以直接将该内容发送给请求的节点。The intermediate node can search the PIT, and if a PIT table entry matching the prefix of the name of the content included in the Data message is found in the PIT, the intermediate node can forward the Data message to all Interest messages recorded in the PIT table entry In addition, the intermediate node can cache the content included in the Data message, and record the cached content information in the CS table, so that when other nodes request the content again, the content can be directly sent to the requesting node.
上面介绍的是ICN中对于Interest消息和Data消息的普通处理方式,下面介绍ICN中的订阅流程。The above describes the general processing methods for Interest messages and Data messages in ICN, and the subscription process in ICN is introduced below.
例如,订阅节点通过发送订阅(Subscribe)消息订阅相关内容,在Subscribe消息中可以携带要订阅的内容的名称的前缀(例如可以为要订阅的内容的名称的前缀),例如该Subscribe消息中携带的要订阅的内容的名称的前缀为/Sports。该Subscribe消息通过中间节点到达根节点,对于沿途的中间节点来说,在收到Subscribe消息后,如果本地没有存储与该Subscribe消息所请求的内容的名称的前缀匹配的订阅表(SubscriptionTable,ST),则可以生成与该Subscribe消息所请求的内容的名称的前缀匹配的ST表,将该Subscribe消息所请求的内容的名称的前缀以及该Subscribe消息的入接口信息记录在该ST中,并通过FIB将该Subscribe消息转发给下一跳节点。而对于中间节点来说,在收到Subscribe消息后,如果本地已经存储了与该Subscribe消息所请求的内容的名称的前缀匹配的ST表,则中间节点无需向下一跳节点转发该Subscribe消息,而是可以直接将该Subscribe消息的入接口信息加入到已有的ST中,并可以丢弃该Subscribe消息。For example, the subscribing node subscribes to relevant content by sending a Subscribe message, and the Subscribe message may carry the prefix of the name of the content to be subscribed (for example, it may be the prefix of the name of the content to be subscribed), such as the Subscribe message carried in the The name of the content to subscribe to is prefixed with /Sports. The Subscribe message reaches the root node through the intermediate node. For the intermediate node along the way, after receiving the Subscribe message, if there is no locally stored subscription table (SubscriptionTable, ST) matching the prefix of the name of the content requested by the Subscribe message , then an ST table matching the prefix of the name of the content requested by the Subscribe message can be generated, the prefix of the name of the content requested by the Subscribe message and the inbound interface information of the Subscribe message can be recorded in the ST, and passed through the FIB The Subscribe message is forwarded to the next hop node. For the intermediate node, after receiving the Subscribe message, if the ST table matching the prefix of the name of the content requested by the Subscribe message has been stored locally, the intermediate node does not need to forward the Subscribe message to the next hop node, Instead, the incoming interface information of the Subscribe message can be directly added to the existing ST, and the Subscribe message can be discarded.
其中,ST可以认为是“长期查询(standingquery)”,因为PIT表项是查询一次之后即会删除,对于订阅内容来说,可能订阅节点只需订阅一次,后续只要有内容的更新,根节点就可以主动向订阅节点推送内容,如果使用PIT表项,则后续的推送就无法进行,因此在这种情况下可以使用ST,ST中也可以类似于PIT表项,可以包括相应的内容的名称的前缀以及订阅节点的入接口信息,且不同于PIT表项,ST可以长期保存,这样每次在推送内容时都可以根据ST进行转发。Among them, ST can be regarded as "standing query (standing query)", because the PIT entry will be deleted after one query. For subscription content, the subscription node may only need to subscribe once, and as long as there is a content update, the root node will You can actively push content to subscribing nodes. If you use PIT entries, subsequent pushes cannot be performed. Therefore, ST can be used in this case. ST can also be similar to PIT entries, and can include the name of the corresponding content. The prefix and the incoming interface information of the subscribing node, and different from the PIT entry, the ST can be stored for a long time, so that each time the content is pushed, it can be forwarded according to the ST.
下面结合图1B介绍ICN中的订阅流程,图1B为本发明实施例中的一种可能的系统架构图,该系统架构图以ICN为例,当然本发明实施例不仅限于应用在ICN。The following describes the subscription process in ICN with reference to FIG. 1B. FIG. 1B is a possible system architecture diagram in the embodiment of the present invention. The system architecture diagram takes ICN as an example. Of course, the embodiment of the present invention is not limited to the application in ICN.
例如,订阅节点1通过发送Subscribe消息1向根节点订阅相关内容,例如该Subscribe消息1携带的所请求订阅的内容的名称的前缀为/Sports。该Subscribe消息1经过中间节点1,中间节点1确定本地未存储与/Sports匹配的ST(如果ST包括的内容的名称的前缀与/Sports相同,则认为该ST与/Sports匹配,也就认为该ST与该Subscribe消息1匹配),则中间节点1可以创建一条ST,其中,该ST包括的内容的名称的前缀(例如在ST中,将内容的名称的前缀用名称(name)表示)为/Sports,及包括该Subscribe消息1的入接口信息,例如为0,同时中间节点1查找本地的FIB,将该Subscribe消息1转发给中间节点3。或者,该Subscribe消息1经过中间节点1,中间节点1确定本地已存储与/Sports匹配的ST,则中间节点1无需创建新的ST,而可以直接将该Subscribe消息1的入接口信息(例如为图1B中的端口0的信息)添加到该已有的ST中,并可以丢弃该Subscribe消息1。For example, the subscribing node 1 subscribes related content to the root node by sending a Subscribe message 1, for example, the prefix of the name of the content requested to subscribe carried in the Subscribe message 1 is /Sports. The Subscribe message 1 passes through the intermediate node 1, and the intermediate node 1 determines that no ST that matches /Sports is stored locally (if the prefix of the name of the content included in the ST is the same as /Sports, it is considered that the ST matches /Sports, and the ST matches the Subscribe message 1), then the intermediate node 1 can create an ST, wherein, the prefix of the name of the content included in the ST (for example, in the ST, the prefix of the name of the content is represented by name) as / Sports, and the inbound interface information including the Subscribe message 1 are, for example, 0. Meanwhile, the intermediate node 1 searches for the local FIB and forwards the Subscribe message 1 to the intermediate node 3 . Alternatively, the Subscribe message 1 passes through the intermediate node 1, and the intermediate node 1 determines that the ST that matches /Sports has been stored locally, then the intermediate node 1 does not need to create a new ST, but can directly use the incoming interface information of the Subscribe message 1 (for example, The information of port 0 in FIG. 1B) is added to the existing ST, and the Subscribe message 1 can be discarded.
若该Subscribe消息1被转发给中间节点3,则中间节点3接收该Subscribe消息1后,可以做与中间节点1类似的处理,例如中间节点3也生成了新的ST,并将该Subscriber消息1转发给根节点。If the Subscribe message 1 is forwarded to the intermediate node 3, after receiving the Subscribe message 1, the intermediate node 3 can perform a similar process to that of the intermediate node 1. For example, the intermediate node 3 also generates a new ST and sends the Subscriber message 1 forwarded to the root node.
例如订阅节点2通过Subscribe消息2向根节点订阅与订阅节点1所订阅的内容相同的内容(例如订阅节点2订阅的内容的名称的前缀也是/Sports),则该Subscribe消息2到达中间节点2后,中间节点2可以进行类似中间节点1的处理方式,例如中间节点2也同样生成一条新的ST,并将该Subscribe消息2转发给下一跳节点,即转发给中间节点3。中间节点3接到该Subscribe消息2后,确定本地已经存储了与该Subscribe消息2携带的内容的名称的前缀相匹配的ST,则中间节点3可以将该Subscribe消息2的入接口信息添加到该ST中,例如该Subscribe消息2的入接口为图中的端口1,中间节点3无需将该Subscribe消息2再转发给根节点,例如中间节点3可以丢弃该Subscribe消息2。For example, the subscribing node 2 subscribes to the root node through the Subscribe message 2 to the same content as the content subscribed by the subscribing node 1 (for example, the prefix of the content subscribed by the subscribing node 2 is also /Sports), then the Subscribe message 2 reaches the intermediate node 2 , the intermediate node 2 can perform a processing method similar to that of the intermediate node 1, for example, the intermediate node 2 also generates a new ST, and forwards the Subscribe message 2 to the next hop node, that is, to the intermediate node 3. After receiving the Subscribe message 2, the intermediate node 3 determines that the ST that matches the prefix of the content name carried by the Subscribe message 2 has been stored locally, and then the intermediate node 3 can add the incoming interface information of the Subscribe message 2 to the Subscribe message 2. In ST, for example, the incoming interface of the Subscribe message 2 is port 1 in the figure, the intermediate node 3 does not need to forward the Subscribe message 2 to the root node, for example, the intermediate node 3 can discard the Subscribe message 2.
根节点接收Subscribe消息1后,若有与Subscribe消息1携带的内容的名称的前缀相关联的更新内容,则根节点可以将更新的内容以Data消息的形式发送给中间节点3,中间节点3接收Data消息后,确定本地存储了与该Data消息携带的内容的名称的前缀(即Subscribe消息1携带的内容的名称的前缀)相匹配的ST,则中间节点3可以将该Data消息分别发送给该ST所指示的入接口,例如为图1B中的端口1和端口2,则中间节点1收到该Data消息后,通过查询本地的ST,可以将该Data消息发送给订阅节点1,同样的,中间节点2收到该Data消息后,通过查询本地的ST,可以将该Data消息发送给订阅节点2。这样就实现了内容的订阅。After the root node receives the Subscribe message 1, if there is an updated content associated with the prefix of the content name carried by the Subscribe message 1, the root node can send the updated content to the intermediate node 3 in the form of a Data message, and the intermediate node 3 receives it. After the Data message, it is determined that the ST that matches the prefix of the name of the content carried by the Data message (that is, the prefix of the name of the content carried by the Subscribe message 1) is locally stored, then the intermediate node 3 can send the Data message to the The incoming interface indicated by the ST is, for example, port 1 and port 2 in Figure 1B. After the intermediate node 1 receives the Data message, it can send the Data message to the subscribing node 1 by querying the local ST. Similarly, After receiving the Data message, the intermediate node 2 can send the Data message to the subscribing node 2 by querying the local ST. In this way, content subscription is realized.
另外,当内容提供方(例如图1B中的内容提供节点)有新的内容需要发布时,内容提供节点可以发送发布(Publish)消息1,该Publish消息1可以携带相应的根节点的名称以及所发布的内容的名称(消息里携带的内容的名称,可以理解为内容的名称的前缀,或者可以理解为内容的名称的前缀),例如该Publish消息1携带的根节点的名称以及所发布的内容的名称可以是/RNName/Sports/football,当然,在该Publish消息1中还可以携带发布的内容本身。该Publish消息1通过中间节点4的FIB被发送给根节点,根节点接收该Publish消息1后,可以删除该Publish消息1携带的RNName,即将该根节点的名称删除,得到Publish消息2,根节点可以通过本地保存的ST,继续将该Publish消息2推送给所有订阅该内容的订阅节点,这样就相当于将Publish消息1所发布的内容推送给所有订阅该内容的订阅节点。例如,根节点可以将该Publish消息2分别发送给备份节点和中间节点3,中间节点3接收Publish消息2后,确定本地存储了与该Publish消息2携带的内容的名称的前缀(即Subscribe消息1携带的内容的名称的前缀)相匹配的ST,则中间节点3可以将该Publish消息2分别发送给该ST所指示的入接口,例如为图1B中的端口1和端口2,则中间节点1收到该Publish消息2后,通过查询本地的ST,可以将该Publish消息2发送给订阅节点1,同样的,中间节点2收到该Publish消息2后,通过查询本地的ST,可以将该Publish消息2发送给订阅节点2。这样就实现了内容的订阅。In addition, when the content provider (for example, the content provider node in FIG. 1B ) has new content to publish, the content provider node can send a Publish (Publish) message 1, and the Publish message 1 can carry the name of the corresponding root node and all The name of the published content (the name of the content carried in the message can be understood as the prefix of the name of the content, or can be understood as the prefix of the name of the content), such as the name of the root node carried in the Publish message 1 and the published content The name of the Publish may be /RNName/Sports/football, and of course, the published content itself may also be carried in the Publish message 1 . The Publish message 1 is sent to the root node through the FIB of the intermediate node 4. After receiving the Publish message 1, the root node can delete the RNName carried in the Publish message 1, that is, delete the name of the root node, and obtain the Publish message 2. The root node You can continue to push the Publish message 2 to all subscribing nodes that subscribe to the content through the locally saved ST, which is equivalent to pushing the content published by the Publish message 1 to all subscribing nodes that subscribe to the content. For example, the root node can send the Publish message 2 to the backup node and the intermediate node 3 respectively. After receiving the Publish message 2, the intermediate node 3 determines that the prefix of the name of the content carried by the Publish message 2 is locally stored (that is, the Subscribe message 1 The prefix of the name of the content carried) matches the ST, then the intermediate node 3 can send the Publish message 2 to the incoming interface indicated by the ST, for example, port 1 and port 2 in Figure 1B, then the intermediate node 1 After receiving the Publish message 2, the Publish message 2 can be sent to the subscription node 1 by querying the local ST. Similarly, after the intermediate node 2 receives the Publish message 2, it can query the local ST to send the Publish message 2. Message 2 is sent to subscribing node 2. In this way, content subscription is realized.
在这个过程中存在一个问题:例如根节点向订阅节点2发送Publish消息2时订阅节点2处于离线状态,或者例如根节点向订阅节点2发送Publish消息2时可能有网络异常的情况,则订阅节点2可能就无法接收Publish消息2携带的内容,从而导致订阅的内容不完整。以下介绍本发明实施例提供的方案,以解决该问题。首先介绍本发明实施例提供的设备。There is a problem in this process: for example, when the root node sends the Publish message 2 to the subscribing node 2, the subscribing node 2 is offline, or for example, when the root node sends the Publish message 2 to the subscribing node 2, there may be a network abnormality, the subscribing node 2 may not be able to receive the content carried in the Publish message 2, resulting in incomplete subscribed content. The solutions provided by the embodiments of the present invention are introduced below to solve this problem. Firstly, the device provided by the embodiment of the present invention is introduced.
可选的,提供一种内容订阅系统,该内容订阅系统可以包括中间节点和备份节点,可参考图1B,中间节点的一种实现方式可以是图1B中所示的中间节点,备份节点的一种实现方式可以是图1B中所示的备份节点,其中,备份节点可以从根节点接收带有序列号的内容,根节点的一种实现方式可以是图1B中所示的根节点。另外,这里“中间节点”和“备份节点”只是一个名称,名称本身对设备不构成限定。Optionally, a content subscription system is provided. The content subscription system may include an intermediate node and a backup node. Refer to FIG. 1B. An implementation of the intermediate node may be the intermediate node shown in FIG. One implementation manner may be the backup node shown in FIG. 1B, wherein the backup node may receive the content with the serial number from the root node, and one implementation manner of the root node may be the root node shown in FIG. 1B. In addition, the "intermediate node" and "backup node" here are just names, and the names themselves do not limit the device.
可选的,内容订阅系统包括的中间节点可以以路由器等形式来实现,或者还可以以图2中的计算机设备(或系统)的方式来实现。Optionally, the intermediate nodes included in the content subscription system may be implemented in the form of a router or the like, or may also be implemented in the form of the computer device (or system) in FIG. 2 .
图2所示为本发明实施例提供的计算机设备示意图。计算机设备200包括至少一个处理器201,通信总线202,存储器203以及至少一个通信接口204。FIG. 2 is a schematic diagram of computer equipment provided by an embodiment of the present invention. The computer device 200 includes at least one processor 201 , a communication bus 202 , a memory 203 and at least one communication interface 204 .
处理器201可以是一个通用中央处理器(CPU),微处理器,特定应用集成电路(Application-SpecificIntegratedCircuit,ASIC),或一个或多个用于控制本发明方案程序执行的集成电路。The processor 201 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), or one or more integrated circuits for controlling program execution of the present invention.
通信总线202可包括一通路,在上述组件之间传送信息。通信接口204,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网,无线接入网(RAN),无线局域网(WirelessLocalAreaNetworks,WLAN)等。Communication bus 202 may include a path for communicating information between the components described above. The communication interface 204 uses any device such as a transceiver for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), and Wireless Local Area Networks (Wireless Local Area Networks, WLAN).
存储器203可以是只读存储器(read-onlymemory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(randomaccessmemory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(ElectricallyErasableProgrammableRead-OnlyMemory,EEPROM)、只读光盘(CompactDiscRead-OnlyMemory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The memory 203 may be a read-only memory (read-only memory, ROM) or other types of static storage devices that can store static information and instructions, a random access memory (random access memory, RAM) or other types of dynamic storage that can store information and instructions The device can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, Digital Versatile Disc, Blu-ray Disc, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited to this. The memory can exist independently and be connected to the processor through the bus. Memory can also be integrated with the processor.
其中,存储器203用于存储执行本发明方案的应用程序代码,并由处理器201来控制执行。处理器201用于执行存储器203中存储的应用程序代码。Wherein, the memory 203 is used to store the application program code for executing the solution of the present invention, and the execution is controlled by the processor 201 . The processor 201 is used to execute application program codes stored in the memory 203 .
在具体实现中,作为一种实施例,处理器201可以包括一个或多个CPU,例如图2中的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, for example, CPU0 and CPU1 in FIG. 2 .
在具体实现中,作为一种实施例,计算机设备200可以包括多个处理器,例如图2中的处理器201和处理器208。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the computer device 200 may include multiple processors, such as the processor 201 and the processor 208 in FIG. 2 . Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
在具体实现中,作为一种实施例,计算机设备200还可以包括输出设备205和输入设备206。输出设备205和处理器201通信,可以以多种方式来显示信息。例如,输出设备205可以是液晶显示器(liquidcrystaldisplay,LCD),发光二级管(lightemittingdiode,LED)显示设备,阴极射线管(cathoderaytube,CRT)显示设备,或投影仪(projector)等。输入设备206和处理器201通信,可以以多种方式接受用户的输入。例如,输入设备206可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the computer device 200 may further include an output device 205 and an input device 206 . Output device 205 communicates with processor 201 and can display information in a variety of ways. For example, the output device 205 may be a liquid crystal display (liquid crystal display, LCD), a light emitting diode (light emitting diode, LED) display device, a cathode ray tube (cathoderay tube, CRT) display device, or a projector (projector), etc. The input device 206 communicates with the processor 201 and can accept user input in various ways. For example, the input device 206 may be a mouse, a keyboard, a touch screen device, or a sensing device, among others.
上述的计算机设备200可以是一个通用计算机设备或者是一个专用计算机设备。在具体实现中,计算机设备200可以是台式机、便携式电脑、网络服务器、掌上电脑(PersonalDigitalAssistant,PDA)、移动手机、平板电脑、无线终端设备、通信设备、嵌入式设备或有图2中类似结构的设备。本发明实施例不限定计算机设备200的类型。The above computer device 200 may be a general computer device or a special computer device. In a specific implementation, the computer device 200 can be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, or a similar structure in FIG. 2 device of. The embodiment of the present invention does not limit the type of the computer device 200 .
内容订阅系统中的中间节点可以通过图2所示的设备实现,中间节点的存储器中存储了一个或多个软件模块。中间节点可以通过处理器以及存储器中的程序代码来实现软件模块,实现对订阅内容的请求过程。The intermediate node in the content subscription system can be realized by the device shown in FIG. 2 , and one or more software modules are stored in the memory of the intermediate node. The intermediate node can realize the software module through the program code in the processor and the memory, and realize the process of requesting the subscription content.
可选的,内容订阅系统中的备份节点也可以通过计算机设备(或系统)的方式来实现,例如,当备份节点通过计算机设备(或系统)的方式来实现时,可继续参考图2。Optionally, the backup node in the content subscription system may also be implemented by a computer device (or system). For example, when the backup node is implemented by a computer device (or system), continue to refer to FIG. 2 .
可选的,还提供一种订阅节点,可参考图1B,订阅节点的一种实现方式可以是图1B中所示的订阅节点。另外,这里“订阅节点”只是一个名称,名称本身对设备不构成限定。Optionally, a subscribing node is also provided. Referring to FIG. 1B , an implementation manner of the subscribing node may be the subscribing node shown in FIG. 1B . In addition, the "subscribing node" here is just a name, and the name itself does not limit the device.
可选的,订阅节点也可以通过计算机设备(或系统)的方式来实现,例如,当订阅节点通过计算机设备(或系统)的方式来实现时,可继续参考图2。Optionally, the subscribing node may also be implemented by means of a computer device (or system). For example, when the subscribing node is implemented by means of a computer device (or system), reference may continue to FIG. 2 .
通过上述系统及设备,可以实现本发明实施例所提供的内容订阅的方案,即使因订阅节点离线或者网络质量较差等原因导致订阅节点丢失了一些订阅的内容,订阅节点也可以重新进行请求,尽量保证订阅节点能够得到较为完整的订阅内容。Through the above-mentioned system and equipment, the content subscription solution provided by the embodiment of the present invention can be realized. Even if the subscription node loses some subscribed content due to reasons such as the subscription node is offline or the network quality is poor, the subscription node can also make a new request. Try to ensure that the subscribing nodes can get relatively complete subscription content.
在介绍本发明实施例所提供的内容订阅方法之前,首先介绍本发明实施例提出的几个改进点:Before introducing the content subscription method provided by the embodiment of the present invention, first introduce several improvement points proposed by the embodiment of the present invention:
改进点1:根节点对内容提供节点发布的每个内容都按照本地时间依次设置序列号,每个内容可唯一对应一个序列号,且根节点可以将携带了序列号的内容推送给订阅节点以及备份节点。当订阅节点离线后再次上线,可以直接将自己的订阅的内容的名称的前缀以及离线前接收到最后一个该内容的序列号发送给备份节点,备份节点就可以将订阅节点离线期间未接收到的发布内容重新发送给订阅节点。因所有的内容都由根节点进行统一编号,备份节点确定的需要发送的内容和订阅节点所请求的内容是一样的,避免因为内容没有序列号而出现混乱的状况(比如,订阅节点实际请求的是内容1、内容2和内容3,而订阅节点的时钟与备份节点的时钟不同步,如果内容没有序列号,则备份节点可能认为订阅节点请求的是内容3、内容2和内容4,从而导致发送错误。即,因为没有统一的时钟,备份节点和订阅节点接收同一内容的时间不同步,可能出现乱序的现象)。Improvement point 1: The root node sets the serial number for each content published by the content providing node in turn according to the local time. Each content can uniquely correspond to a serial number, and the root node can push the content carrying the serial number to the subscribing node and backup node. When the subscribing node goes online again after being offline, it can directly send the prefix of the name of the content it subscribed to and the serial number of the last received content before going offline to the backup node, and the backup node can send the subscribing node offline. Published content is resent to subscribing nodes. Because all content is uniformly numbered by the root node, the content that the backup node determines to be sent is the same as the content requested by the subscribing node, avoiding confusion due to the fact that the content does not have a serial number (for example, the content actually requested by the subscribing node content 1, content 2 and content 3, but the clock of the subscribing node is not synchronized with the clock of the backup node. If the content does not have a serial number, the backup node may think that the subscribing node requests content 3, content 2 and content 4, resulting in Sending errors. That is, because there is no unified clock, the time when the backup node and the subscription node receive the same content is not synchronized, and there may be out-of-order phenomena).
改进点2:在Interest消息中增加相应的字段,例如可以增加用于指示Interest消息为重新获取订阅的内容的字段,例如该字段可表示为Get_Loss_Pub_Msg,例如该字段可以占据1位(bit),若Get_Loss_Pub_Msg的取值为1,则表明该Interest消息用于重新获取订阅的内容,或者表明该Interest消息用于获取之前未接收到的订阅的内容。例如,还可以增加用于承载订阅节点接收的最后一个相关内容的序列号的字段(或者该字段也可以用于承载订阅节点请求重新获取的第一内容的序列号,该第一内容的序列号为订阅节点请求获取的所有内容的序列号中值最小的序列号),例如该字段可以表示为Seq_min,该字段的长度可以由序列号的长度确定。例如,还可以增加用于承载订阅节点请求重新获取的第二内容的序列号的字段,该第二内容的序列号为订阅节点请求获取的所有内容的序列号中值最大的序列号,例如该字段可以表示为Seq_max,该字段的长度可以由序列号的长度确定。Improvement point 2: Add corresponding fields in the Interest message, for example, you can add a field for indicating that the Interest message is to reacquire the subscribed content, for example, this field can be expressed as Get_Loss_Pub_Msg, for example, this field can occupy 1 bit, if The value of Get_Loss_Pub_Msg is 1, which indicates that the Interest message is used to reacquire the subscribed content, or indicates that the Interest message is used to obtain the previously unreceived subscribed content. For example, a field for carrying the sequence number of the last related content received by the subscribing node may also be added (or this field may also be used to carry the sequence number of the first content that the subscribing node requests to reacquire, the sequence number of the first content The sequence number with the smallest value among the sequence numbers of all content requested by the subscribing node), for example, this field may be expressed as Seq_min, and the length of this field may be determined by the length of the sequence number. For example, a field for carrying the serial number of the second content requested by the subscribing node to be reacquired may also be added. The field can be expressed as Seq_max, and the length of this field can be determined by the length of the sequence number.
其中,如果Interest消息中携带Get_Loss_Pub_Msg,则至少还需要携带Seq_min,可选的还可以携带Seq_max。如果Interest消息中携带了Get_Loss_Pub_Msg和Seq_min,而未携带Seq_max,或者虽然携带了Seq_max,但Seq_max的值为空(Null),则表明该Interest消息请求获取的是序列号为Seq_min的内容以及序列号位于Seq_min之后的所有内容(或者也可以不包括序列号为Seq_min的内容),则备份节点确定将序列号为Seq_min的内容以及序列号位于Seq_min之后的所有内容发送给订阅节点(或者也可以不发送序列号为Seq_min的内容),否则,若Interest消息中携带了Seq_max,且Seq_max的值不为Null,则表明该Interest消息请求获取序列号位于Seq_min和Seq_max之间的所有内容(包括序列号为Seq_max的内容,还可以包括序列号为Seq_min的内容,或者也可以不包括序列号为Seq_min的内容),则备份节点确定将序列号位于Seq_min和Seq_max之间的所有内容发送给订阅节点。Wherein, if Get_Loss_Pub_Msg is carried in the Interest message, Seq_min needs to be carried at least, and Seq_max can also be carried optionally. If the Interest message carries Get_Loss_Pub_Msg and Seq_min, but does not carry Seq_max, or although Seq_max is carried, but the value of Seq_max is empty (Null), it indicates that the Interest message requests to obtain the content whose sequence number is Seq_min and the sequence number is located in All the content after Seq_min (or may not include the content with the sequence number Seq_min), then the backup node determines to send the content with the sequence number Seq_min and all the content with the sequence number after Seq_min to the subscribing node (or may not send the sequence content whose serial number is Seq_min), otherwise, if the Interest message carries Seq_max, and the value of Seq_max is not Null, it indicates that the Interest message requests to obtain all the content whose serial number is between Seq_min and Seq_max (including the content whose serial number is Seq_max content, which may also include the content whose sequence number is Seq_min, or may not include the content whose sequence number is Seq_min), then the backup node determines to send all the content whose sequence number is between Seq_min and Seq_max to the subscribing node.
其中,如果订阅节点是离线后又重新上线,那么订阅节点发送的Interest消息中可以携带Get_Loss_Pub_Msg和Seq_min,可选的,可以携带或者不携带Seq_max,若携带了Seq_max,Seq_max的取值可以为Null,或者也可以不是Null。Among them, if the subscribing node is offline and then online again, the Interest message sent by the subscribing node can carry Get_Loss_Pub_Msg and Seq_min, optionally, it can carry Seq_max or not, if it carries Seq_max, the value of Seq_max can be Null, Or it may not be Null.
如果订阅节点始终在线,但由于某些原因(例如网络异常等)导致未收到某些订阅内容,或某些订阅内容丢失,则可选的,订阅节点发送的Interest消息中可以携带Get_Loss_Pub_Msg、Seq_min和Seq_max,且Seq_max的取值不为Null,这样订阅节点可以较为准确地获得所需的内容。If the subscribing node is always online, but some subscription content is not received or lost due to some reasons (such as network abnormality, etc.), then optionally, the Interest message sent by the subscribing node can carry Get_Loss_Pub_Msg, Seq_min and Seq_max, and the value of Seq_max is not Null, so that the subscribing node can obtain the required content more accurately.
改进点3:优化PIT表项。例如,可以在PIT表项中新增用于指示PIT表项为重新获取订阅的内容的字段,例如该字段可以表示为Notify,Notify字段的取值可以是Interest消息中的Get_Loss_Pub_Msg的取值,例如该字段可以占据1bit,若Notify的取值为1,则表明该PIT表项用于重新获取订阅的内容,或者表明该PIT表项用于获取之前未接收到的订阅的内容。例如,还可以在PIT表项中新增用于承载订阅节点接收的最后一个相关内容的序列号的字段(或者该字段也可以用于承载该PIT表项请求重新获取的第一内容的序列号,该第一内容的序列号为该PIT表项请求获取的所有内容的序列号中值最小的序列号),例如该字段可以表示为Seq_min,该字段的长度可以由序列号的长度确定。例如,还可以增加用于承载该PIT表项请求重新获取的第二内容的序列号的字段,该第二内容的序列号为该PIT表项请求获取的所有内容的序列号中值最大的序列号,例如该字段可以表示为Seq_max,该字段的长度可以由序列号的长度确定。Improvement point 3: Optimize PIT entries. For example, a new field may be added to the PIT entry to indicate that the PIT entry is to reacquire the subscription content. For example, this field may be represented as Notify, and the value of the Notify field may be the value of Get_Loss_Pub_Msg in the Interest message, for example This field can occupy 1 bit. If the value of Notify is 1, it indicates that the PIT entry is used to retrieve the subscribed content, or indicates that the PIT entry is used to obtain the previously unreceived subscribed content. For example, a field for carrying the sequence number of the last relevant content received by the subscribing node may also be added in the PIT entry (or this field may also be used to carry the sequence number of the first content that the PIT entry requests to reacquire. , the sequence number of the first content is the sequence number with the smallest value among the sequence numbers of all the contents requested by the PIT entry), for example, this field can be expressed as Seq_min, and the length of this field can be determined by the length of the sequence number. For example, a field for carrying the serial number of the second content requested to be reacquired by the PIT entry may also be added, where the serial number of the second content is the sequence with the largest value among the serial numbers of all the content requested by the PIT entry number, for example, this field can be expressed as Seq_max, and the length of this field can be determined by the length of the sequence number.
在有大量的订阅节点同时获取相同的订阅内容时,如果将这些订阅节点发送的所有的Interest消息都转发给备份节点,则会给备份节点造成较大的负担,甚至可能导致备份节点出现故障,通过优化PIT表项,可以对Interest消息进行汇聚,例如,对于请求相同内容的Interest消息,只需在PIT表项中增加相应的入接口信息即可,无需再转发该Interest消息,节省传输资源,也减轻备份节点的负担。When a large number of subscription nodes obtain the same subscription content at the same time, if all the Interest messages sent by these subscription nodes are forwarded to the backup node, it will cause a large burden on the backup node, and may even cause the backup node to fail. By optimizing PIT entries, Interest messages can be aggregated. For example, for Interest messages requesting the same content, you only need to add the corresponding inbound interface information in the PIT entry, and there is no need to forward the Interest message, saving transmission resources. It also reduces the burden on backup nodes.
改进点4:在Interest消息中增加用于指示是否从沿途的中间节点中获取所请求的内容的字段,例如将该字段表示为Get_Content_from_Origin。例如该字段可以占据1bit,如果Get_Content_from_Origin的取值为1,则确定不从沿途的中间节点中获取所请求的内容,如果Get_Content_from_Origin的取值为0,或者Interest消息中未携带Get_Content_from_Origin,则确定可以从经过的中间节点中获取所请求的内容。Improvement point 4: A field for indicating whether to obtain the requested content from an intermediate node along the way is added to the Interest message, for example, the field is expressed as Get_Content_from_Origin. For example, this field can occupy 1 bit. If the value of Get_Content_from_Origin is 1, it is determined not to obtain the requested content from the intermediate nodes along the way. If the value of Get_Content_from_Origin is 0, or the Interest message does not carry Get_Content_from_Origin, it is determined that Get the requested content from the passed intermediate nodes.
例如,如果订阅节点在Interest消息中携带的Seq_max的取值为Null,或者Interest消息中未携带Seq_max,则订阅节点可以在Interest消息中携带Get_Content_from_Origin,且将Get_Content_from_Origin的取值设置为1。因为此时订阅节点要获取的上限是不确定的,而备份节点中存储的是完整的内容,因此备份节点可以将完整的内容发送给订阅节点,中间节点可能只缓存了部分内容,如果从中间节点获取,则获取的内容可能是不完整的,因此这种情况下可以选择不从中间节点获取内容。For example, if the value of Seq_max carried by the subscribing node in the Interest message is Null, or the value of Seq_max is not carried in the Interest message, the subscribing node may carry Get_Content_from_Origin in the Interest message, and set the value of Get_Content_from_Origin to 1. Because the upper limit to be obtained by the subscribing node is uncertain at this time, and the backup node stores the complete content, so the backup node can send the complete content to the subscribing node, and the intermediate node may only cache part of the content. If the node is obtained, the obtained content may be incomplete, so in this case, you can choose not to obtain the content from the intermediate node.
例如,如果订阅节点在Interest消息中携带的Seq_max的取值不为Null,则订阅节点可以在Interest消息中携带Get_Content_from_Origin,且将Get_Content_from_Origin的取值可以设置为1也可以设置为0,因为此时订阅节点所要获取的上下限是明确的,如果中间节点缓存了这些内容,则可以从中间节点获取,以减少获取内容所需的时间和步骤,如果中间节点未缓存这些内容,则可以从备份节点获取,以尽量保证能够获取到所需要的内容。For example, if the value of Seq_max carried by the subscribing node in the Interest message is not Null, the subscribing node can carry Get_Content_from_Origin in the Interest message, and the value of Get_Content_from_Origin can be set to 1 or 0, because at this time the subscription The upper and lower limits that a node needs to obtain are clear. If the intermediate node caches the content, it can be obtained from the intermediate node to reduce the time and steps required to obtain the content. If the intermediate node does not cache the content, it can be obtained from the backup node. , so as to ensure that the required content can be obtained as much as possible.
为了对以上改进点有更好的理解,下面结合附图介绍本发明实施例提供的方法,可以依托于图1B的架构进行理解。以下分为两个例子进行介绍。In order to have a better understanding of the above improvements, the following describes the method provided by the embodiment of the present invention in conjunction with the accompanying drawings, which can be understood based on the architecture of FIG. 1B . The following is divided into two examples for introduction.
例1:example 1:
请参见图3。See Figure 3.
1、内容提供节点有新的内容发布的时候,可以通过Publish消息1将发布的新内容给根节点。例如Publish消息1可以携带根节点的名称以及发布的内容的标识,发布的内容的标识例如可以包括发布的内容的名称的前缀,例如为/RNName/sports。1. When the content providing node has new content to publish, it can send the new content to the root node through the Publish message 1. For example, the Publish message 1 may carry the name of the root node and the identifier of the published content, for example, the identifier of the published content may include a prefix of the name of the published content, such as /RNName/sports.
2、根节点接收Publish消息1后,可以解析Publish消息1获取其中携带的发布的内容,根节点可以对接收的内容按照本地时间依次进行编号,例如可以为接收的内容按照本地时间依次设置序列号。2. After the root node receives the Publish message 1, it can parse the Publish message 1 to obtain the published content carried in it. The root node can number the received content in sequence according to the local time, for example, it can set the sequence number for the received content in sequence according to the local time .
3、根节点向订阅了该内容的所有订阅节点推送该内容,例如根节点可以向备份节点和订阅节点1发送Publish消息2,以推送该内容。其中,Publish消息2携带所发布的新内容,以及还携带根节点为其中每个内容设置的序列号。而例如订阅节点1处于离线状态,因此无法接收Publish消息2。3. The root node pushes the content to all subscribing nodes that have subscribed to the content. For example, the root node can send Publish message 2 to the backup node and subscribing node 1 to push the content. Among them, the Publish message 2 carries the published new content, and also carries the serial number set by the root node for each content. However, for example, the subscribing node 1 is offline, so the Publish message 2 cannot be received.
其中,根节点接收Publish消息1后,可以删除Publish消息1中携带的根节点的名称,即删除RNName,且根节点可以将为Publish消息1中携带的内容设置的序列号添加到Publish消息1中,例如将删除RNName、以及添加了序列号的Publish消息1称为Publish消息2。Among them, after the root node receives the Publish message 1, it can delete the name of the root node carried in the Publish message 1, that is, delete the RNName, and the root node can add the serial number set for the content carried in the Publish message 1 to the Publish message 1 , for example, the Publish message 1 with the RNName deleted and the sequence number added is called Publish message 2.
4、备份节点收到Publish消息2后,可以保存Publish消息2所携带的内容以及这些内容分别对应的序列号。例如,备份节点可以通过数据库进行备份。4. After receiving the Publish message 2, the backup node can save the content carried in the Publish message 2 and the serial numbers corresponding to these contents. For example, a backup node can be backed up by a database.
5、订阅节点1再次上线,发送第一请求消息,第一请求消息用于请求重新获取之前推送的内容,例如第一请求消息用于请求获得的是第一部分内容。第一请求消息例如可以通过Interest消息实现,第一请求消息中可以包括:5. The subscribing node 1 goes online again, and sends a first request message, which is used to request to reacquire previously pushed content, for example, the first request message is used to request to obtain the first part of content. For example, the first request message can be implemented by an Interest message, and the first request message can include:
(1)/备份节点的名称/待获取的订阅的内容的标识,其中,待获取的内容的标识例如可以包括待获取的内容的名称的前缀,或者待获取的内容的标识也可以包括待获取的内容的其他信息,例如可以包括待获取的内容的完整的名称。因为备份节点中保存的是比较完整的内容,因此订阅节点可以向备份节点请求;(1)/The name of the backup node/the identifier of the subscribed content to be acquired, wherein, for example, the identifier of the content to be acquired may include the prefix of the name of the content to be acquired, or the identifier of the content to be acquired may also include Other information of the content, for example, may include the complete name of the content to be acquired. Because the backup node saves relatively complete content, the subscribing node can request from the backup node;
(2)第一序列号,第一序列号例如可以是第一部分内容所包括的第一内容的序列号,第一内容的序列号为第一部分内容所包括的各内容的序列号中值最小的序列号,例如第一序列号承载在为Interest消息中的Seq_min字段中。其中,第一内容例如可以是订阅节点1最后接收到的订阅内容,或者第一内容可以是订阅节点1第一个未接收到的订阅内容。由于在例1中订阅用户1刚上线,可能需要获取丢失的所有内容,因此该Interest消息中携带的Seq_max的取值可以是Null,或者该Interest消息中可以不携带Seq_max;(2) The first serial number, for example, the first serial number can be the serial number of the first content included in the first part of content, and the serial number of the first content is the smallest among the serial numbers of the contents included in the first part of content The sequence number, for example, the first sequence number is carried in the Seq_min field in the Interest message. Wherein, the first content may be, for example, the last subscription content received by the subscription node 1 , or the first content may be the first subscription content not received by the subscription node 1 . Since subscriber 1 has just gone online in Example 1, it may be necessary to obtain all the lost content, so the value of Seq_max carried in the Interest message can be Null, or the Interest message can not carry Seq_max;
(3)用于指示该Interest消息为重新获取订阅的内容的字段,例如该字段可表示为Get_Loss_Pub_Msg;其中,该字段为可选项,即第一请求消息中可以携带该字段,也可以不携带该字段;(3) A field used to indicate that the Interest message is to reacquire the subscribed content, for example, this field may be expressed as Get_Loss_Pub_Msg; wherein, this field is optional, that is, the first request message may or may not carry this field field;
(4)用于指示是否从沿途的中间节点中获取所请求的内容的字段,例如将该字段表示为Get_Content_from_Origin,例如Get_Content_from_Origin的取值为1,表明不从中间节点获取内容,需要从备份节点中获取内容。其中,该字段为可选项,即第一请求消息中可以携带该字段,也可以不携带该字段。可选的,如果第一请求消息中未携带该字段,那么可以默认不从沿途的中间节点中获取所请求的内容的字段,或者也可以默认从沿途的中间节点中获取所请求的内容的字段,可根据需求预先设置。(4) A field used to indicate whether to obtain the requested content from an intermediate node along the way. For example, this field is expressed as Get_Content_from_Origin. For example, the value of Get_Content_from_Origin is 1, indicating that the content is not obtained from the intermediate node and needs to be obtained from the backup node. Get content. Wherein, this field is optional, that is, this field may or may not be carried in the first request message. Optionally, if this field is not carried in the first request message, the field of the requested content may not be obtained from the intermediate nodes along the way by default, or the field of the requested content may be obtained from the intermediate nodes along the way by default , which can be preset as required.
6、中间节点通过通信接口204接收该Interest消息,中间节点可以通过处理器201根据该Interest消息携带的内容的名称的前缀和序列号,综合判断决定是否转发该Interest消息。可选的,判决过程如下:6. The intermediate node receives the Interest message through the communication interface 204, and the intermediate node can make a comprehensive judgment and decide whether to forward the Interest message through the processor 201 according to the prefix and serial number of the content name carried in the Interest message. Optionally, the judgment process is as follows:
1)由于该Interest消息携带的Get_Content_from_Origin的取值为1,则处理器201可以不查询CS表,即无需从本地的缓存中获取内容。那么中间节点通过处理器201查询本地的PIT,确定是否存储了与该Interest消息携带的内容的名称的前缀相匹配的PIT表项,即是否存储了用于处理第一部分内容的PIT表项。根据是否存储了用于处理第一部分内容的PIT表项,下面分为两个分支来介绍:1) Since the value of Get_Content_from_Origin carried in the Interest message is 1, the processor 201 does not need to query the CS table, that is, it does not need to obtain the content from the local cache. Then the intermediate node queries the local PIT through the processor 201 to determine whether a PIT entry matching the prefix of the content name carried in the Interest message is stored, that is, whether a PIT entry for processing the first part of content is stored. According to whether the PIT entry for processing the first part of the content is stored, the following is divided into two branches to introduce:
分支1:如果中间节点通过处理器201查询到了与该Interest消息携带的内容的名称的前缀相匹配的PIT表项(例如该PIT表项可以称为第一表项),且该第一表项包括的Seq_max的取值为Null,或者该第一表项不包括Seq_max,则中间节点可以通过处理器201根据第一请求消息所携带的内容来更新第一表项。例如,中间节点可以通过处理器201按照如下方式更新第一表项:Branch 1: If the intermediate node finds the PIT entry matching the prefix of the content name carried by the Interest message through the processor 201 (for example, the PIT entry can be called the first entry), and the first entry If the value of the included Seq_max is Null, or the first entry does not include Seq_max, the intermediate node may use the processor 201 to update the first entry according to the content carried in the first request message. For example, the intermediate node may use the processor 201 to update the first entry in the following manner:
(i)可选的,如果该Interest消息中携带的Seq_min的取值大于等于第一表项中记录的Seq_min的取值,则中间节点可以通过处理器201在第一表项中的Requested字段增加中间节点到订阅节点1的路由信息,得到更新后的第一表项。例如中间节点到订阅节点1的路由信息可以包括该Interest消息的入接口信息。另外,中间节点无需通过通信接口204向下一跳节点转发该Interest消息,例如可以通过处理器201丢弃该Interest消息,减少需发送的数据量,节省传输资源。(i) Optionally, if the value of Seq_min carried in the Interest message is greater than or equal to the value of Seq_min recorded in the first entry, the intermediate node can add The routing information from the intermediate node to the subscribing node 1 obtains the updated first entry. For example, the routing information from the intermediate node to the subscribing node 1 may include the incoming interface information of the Interest message. In addition, the intermediate node does not need to forward the Interest message to the next-hop node through the communication interface 204, for example, the Interest message can be discarded through the processor 201, reducing the amount of data to be sent and saving transmission resources.
(ii)或者,可选的,如果该Interest消息中携带的Seq_min的取值小于第一表项中记录的Seq_min的取值,则中间节点可以通过处理器201更新第一表项中的Seq_min的取值,例如将第一表项中的Seq_min的取值更新为该Interest消息携带的Seq_min的取值,且中间节点可以通过处理器201在该第一表项中的Requested字段增加中间节点到订阅节点1的路由信息,例如中间节点到订阅节点1的路由信息可以包括该Interest消息的入接口信息,以得到更新后的第一表项。另外,在这种情况下,中间节点除了可以更新第一表项之外,还可以通过通信接口204将该Interest消息转发给下一跳节点。(ii) Or, optionally, if the value of Seq_min carried in the Interest message is smaller than the value of Seq_min recorded in the first entry, the intermediate node may update the value of Seq_min in the first entry through the processor 201 Take a value, for example, update the value of Seq_min in the first entry to the value of Seq_min carried in the Interest message, and the intermediate node can add the intermediate node to the subscription through the processor 201 in the Requested field in the first entry The routing information of node 1, for example, the routing information from the intermediate node to the subscribing node 1 may include the incoming interface information of the Interest message, so as to obtain the updated first entry. In addition, in this case, besides updating the first entry, the intermediate node can also forward the Interest message to the next-hop node through the communication interface 204 .
分支2:如果中间节点未查询到与该Interest消息携带的内容的名称的前缀相匹配的PIT表项,则中间节点可以通过处理器201新增PIT表项,例如新增的PIT表项可以称为第二表项。第二表项包括的内容的名称的前缀为该Interest消息携带的内容的名称的前缀,第二表项包括的notify字段用于指示该PIT表项用于重新获取订阅的内容,第二表项包括的Seq_min的取值为该Interest消息携带的Seq_min的取值,第二表项包括的Seq_max的取值为该Interest消息携带的Seq_max的取值,第二表项包括的路由信息为中间节点到订阅节点1的路由信息,例如该路由信息可以包括订阅节点1的入接口信息,而订阅节点1的入接口信息即为该Interest消息的入接口信息,例如第二表项包括的路由信息为该Interest消息的入接口信息。另外,中间节点通过通信接口204向下一跳节点转发该Interest消息。Branch 2: If the intermediate node does not find a PIT entry matching the prefix of the content carried by the Interest message, the intermediate node can add a new PIT entry through the processor 201, for example, the newly added PIT entry can be called is the second entry. The prefix of the name of the content included in the second entry is the prefix of the name of the content carried in the Interest message, and the notify field included in the second entry is used to indicate that the PIT entry is used to reacquire the subscribed content, and the second entry The value of Seq_min included is the value of Seq_min carried in the Interest message, the value of Seq_max included in the second table item is the value of Seq_max carried in the Interest message, and the routing information included in the second table item is the intermediate node to The routing information of subscribing node 1, for example, the routing information may include the inbound interface information of subscribing node 1, and the inbound interface information of subscribing node 1 is the inbound interface information of the Interest message, for example, the routing information included in the second entry is the Incoming interface information of the Interest message. In addition, the intermediate node forwards the Interest message to the next-hop node through the communication interface 204 .
7、中间节点通过通信接口204向下一跳节点转发该Interest消息。例1以此为例,那么可能实现的是步骤6中的分支1的第i种情况,或者可能实现的是步骤6中的分支2的情况。7. The intermediate node forwards the Interest message to the next-hop node through the communication interface 204 . Example 1 Take this as an example, then it is possible to realize the i-th case of branch 1 in step 6, or it is possible to realize the case of branch 2 in step 6.
8、备份节点收到该Interest消息后,发送Data消息,Data消息中携带第二部分内容。8. After receiving the Interest message, the backup node sends a Data message, which carries the second part of the content.
其中,备份节点收到该Interest消息后,确定该Interest消息携带的Seq_min的取值所对应的序列号之后的所有的订阅内容,即确定第二部分内容,并将确定的第二部分内容携带在Data消息中。Wherein, after receiving the Interest message, the backup node determines all subscription content after the sequence number corresponding to the value of Seq_min carried in the Interest message, that is, determines the second part of the content, and carries the determined second part of the content in the Data message.
其中,在Data消息中可以携带所请求的内容的名称的前缀,还可以携带Seq_min,Seq_min的取值与Interest消息携带的Seq_min的取值相同,可选的,可以携带Seq_max或者可以不携带Seq_max,若在Data消息中携带Seq_max,则Seq_max的取值与该Interest消息携带的Seq_min的取值可以相同,例如为Null,或者Seq_max的取值可以是Data消息中携带的所有内容对应的序列号中值最大的序列号的值,当然,Data消息中还可以携带该Interest消息所请求的内容。Wherein, the prefix of the name of the requested content can be carried in the Data message, and Seq_min can also be carried. The value of Seq_min is the same as the value of Seq_min carried in the Interest message. Optionally, Seq_max can be carried or Seq_max may not be carried. If Seq_max is carried in the Data message, the value of Seq_max can be the same as the value of Seq_min carried in the Interest message, for example, Null, or the value of Seq_max can be the median value of the sequence numbers corresponding to all the contents carried in the Data message The value of the largest sequence number. Of course, the Data message may also carry the content requested by the Interest message.
9、中间节点通过通信接口204接收备份节点发送的Data消息后,通过处理器201根据本地的PIT表项(此时,该PIT表项可以是更新后的第一表项,或者也可以是第二表项)中的Seq_min决定是转发该Data消息还是丢弃该Data消息(当然前提是PIT表项包括的内容的名称的前缀与该Data消息携带的内容的名称的前缀相匹配)。可选的,判决过程如下:9. After the intermediate node receives the Data message sent by the backup node through the communication interface 204, the processor 201 according to the local PIT entry (at this time, the PIT entry may be the updated first entry, or may also be the first entry). Seq_min in the second entry) determines whether to forward the Data message or discard the Data message (of course, the premise is that the prefix of the name of the content included in the PIT entry matches the prefix of the name of the content carried in the Data message). Optionally, the judgment process is as follows:
如果该Data消息中的Seq_min的取值等于本地的PIT表项中记录的Seq_min的取值,则中间节点可以通过通信接口204将该Data消息转发给下一跳节点,否则中间节点可以通过处理器201丢弃该Data消息,即,如果该Data消息携带的第二部分内容是第一部分内容的子集,则中间节点可以通过通信接口204将该Data消息转发给下一跳节点,否则中间节点可以通过处理器201丢弃该Data消息。例如,例1以中间节点确定通过通信接口204向下一跳节点转发该Data消息为例,中间节点的下一跳节点例如为订阅节点1。If the value of Seq_min in the Data message is equal to the value of Seq_min recorded in the local PIT entry, the intermediate node can forward the Data message to the next hop node through the communication interface 204, otherwise the intermediate node can pass the processor 201 discards the Data message, that is, if the second part of the content carried by the Data message is a subset of the first part of the content, the intermediate node can forward the Data message to the next-hop node through the communication interface 204, otherwise the intermediate node can pass the Processor 201 discards the Data message. For example, in Example 1, the intermediate node determines to forward the Data message to the next-hop node through the communication interface 204 as an example, and the next-hop node of the intermediate node is, for example, the subscribing node 1 .
10、中间节点通过通信接口204向下一跳节点转发该Data消息。10. The intermediate node forwards the Data message to the next-hop node through the communication interface 204 .
11、订阅节点1接收该Data消息,并解析该Data消息,可以获取该Data消息携带的第二部分内容。订阅节点1可以将该Data消息携带的Seq_min的取值(即第二部分内容包括的各内容的序列号中值最小的序列号的值)同之前自己请求的Seq_min的取值(即第一序列号的值)进行对比,以确定是否接收了重复的内容。例如,若该Data消息携带的Seq_min的取值小于之前订阅节点1所请求的Seq_min的取值,则订阅节点1确定接收了重复的内容,订阅节点1可以从第二部分内容中删除重复的内容,以节省存储空间。例如,订阅节点1发送的Interest消息携带的Seq_min的取值为10,而收到的Data消息携带的Seq_min的取值为2,则处理器203可以确定序列号为2~9的内容为重复接收的内容,可以将其删除,可以看到,订阅节点1删除的内容中值最大的序列号为第一序列号减1。11. The subscribing node 1 receives the Data message and parses the Data message to obtain the second part of the content carried in the Data message. The subscribing node 1 can compare the value of Seq_min carried by the Data message (that is, the value of the sequence number with the smallest value among the sequence numbers of the contents included in the second part of the content) with the value of Seq_min previously requested by itself (that is, the value of the first sequence number value) to determine whether duplicate content has been received. For example, if the value of Seq_min carried in the Data message is smaller than the value of Seq_min previously requested by the subscription node 1, then the subscription node 1 determines that it has received duplicate content, and the subscription node 1 can delete the duplicate content from the second part of the content , to save storage space. For example, if the value of Seq_min carried in the Interest message sent by the subscribing node 1 is 10, and the value of Seq_min carried in the received Data message is 2, the processor 203 can determine that the content with sequence numbers 2-9 is repeated reception It can be deleted. It can be seen that the sequence number with the largest value in the content deleted by subscription node 1 is the first sequence number minus 1.
例1是以订阅节点1离线后又上线为例,下面介绍例2,例2中订阅节点1始终在线,但由于网络异常等原因导致未接收到某些订阅的内容,则订阅节点1可以根据自己接收到的内容的序列号的连续性,重新获取未接收到的内容。Example 1 is an example of subscribing node 1 going online after being offline. The following introduces example 2. In example 2, subscribing node 1 is always online, but due to network abnormalities and other reasons, some subscribed content is not received. Subscribing node 1 can be based on The continuity of the serial numbers of the content received by itself, and re-acquire the content that has not been received.
例2:Example 2:
请参见图4。其中,图4的步骤1-4可参考图3,对这些步骤的介绍可参考例1,其中,例1中的步骤3中,订阅节点1是因为离线所以无法接收Publish消息2,而例2的步骤3中,订阅节点1是因为网络异常等原因所以无法接收Publish消息2。下面介绍例2中其他不同的步骤。See Figure 4. Among them, steps 1-4 in Figure 4 can refer to Figure 3, and the introduction of these steps can refer to Example 1, wherein, in Step 3 in Example 1, subscription node 1 cannot receive Publish message 2 because it is offline, and Example 2 In step 3 of , subscribing node 1 cannot receive Publish message 2 due to network abnormalities and other reasons. The other different steps in Example 2 are described below.
5、订阅节点1可以确定丢失了序列号位于第一序列号(例如表示为num1)和第二序列号(例如表示为numN)之间的内容。5. The subscribing node 1 may determine that the content whose sequence number is between the first sequence number (for example, num1) and the second sequence number (for example, numN) is lost.
例如,由于网络异常等原因,订阅节点1没有接收到序列号位于第一序列号(例如表示为num1)和第二序列号(例如表示为numN)之间的内容,其中,N为大于1的整数。例如,订阅节点1接收了序列号为num0的内容后,又接收了序列号为numN+1的内容,则由于接收的内容的序列号不连续,订阅节点1可以确定丢失了某些订阅内容,即可以确定num1至numN之间的内容(包括num1和numN)均未收到。For example, due to network abnormalities and other reasons, the subscribing node 1 does not receive the content whose sequence number is between the first sequence number (for example, num1) and the second sequence number (for example, numN), where N is greater than 1 integer. For example, after the subscribing node 1 receives the content with the serial number num0, and then receives the content with the serial number numN+1, since the serial numbers of the received content are discontinuous, the subscribing node 1 can determine that some subscription content is lost, That is, it can be determined that the content between num1 and numN (including num1 and numN) has not been received.
6、订阅节点1可以向备份节点发送第一请求消息,以请求获得序列号位于num1~numN之间的内容,例如可以将序列号位于num1~numN之间的内容称为第一部分内容。第一请求消息例如可以通过Interest消息实现,该Interest消息例如可以携带如下内容:6. The subscribing node 1 may send a first request message to the backup node to request to obtain the content whose serial number is between num1-numN, for example, the content whose serial number is between num1-numN may be called the first part of content. For example, the first request message can be realized by an Interest message, and the Interest message can carry the following content, for example:
(1)/备份节点的名称/第一部分内容的标识。其中,第一部分内容的标识,例如可以包括第一部分内容的名称的前缀;(1)/The name of the backup node/Identification of the content of the first part. Wherein, the identification of the first part of content may include, for example, a prefix of the name of the first part of content;
(2)Seq_min,其取值例如为num1,Seq_max,其取值例如为numN。(2) Seq_min, whose value is, for example, num1, and Seq_max, whose value is, for example, numN.
(3)用于指示该Interest消息为重新获取订阅的内容的字段,例如该字段可表示为Get_Loss_Pub_Msg。其中,该字段为可选项,即第一请求消息中可以携带该字段,也可以不携带该字段。(3) A field used to indicate that the Interest message is to reacquire the subscribed content, for example, this field may be expressed as Get_Loss_Pub_Msg. Wherein, this field is optional, that is, this field may or may not be carried in the first request message.
(4)Get_Content_from_Origin。其中,该字段为可选项,即该Interest消息可以选择携带Get_Content_from_Origin或不携带Get_Content_from_Origin,若携带Get_Content_from_Origin,则Get_Content_from_Origin的取值可以是0,表明可以从中间节点获取内容。(4) Get_Content_from_Origin. Wherein, this field is optional, that is, the Interest message can choose to carry Get_Content_from_Origin or not carry Get_Content_from_Origin, if it carries Get_Content_from_Origin, the value of Get_Content_from_Origin can be 0, indicating that the content can be obtained from the intermediate node.
7、中间节点通过通信接口204接收该Interest消息,通过处理器201根据该Interest消息携带的所请求的内容的名称的前缀、Seq_min、以及Seq_max,判决是否转发该Interest消息。可选的,判决过程如下:7. The intermediate node receives the Interest message through the communication interface 204, and the processor 201 determines whether to forward the Interest message according to the prefix, Seq_min, and Seq_max of the name of the requested content carried in the Interest message. Optionally, the judgment process is as follows:
1)因为该Interest消息未携带Get_Content_from_Origin,或携带的Get_Content_from_Origin的取值是0,则中间节点通过处理器201查询本地的CS表,如果在CS表中查询到本地缓存了该Interest消息所请求获取的内容,即缓存了序列号位于num1~numN之间的内容,则中间节点可以通过处理器201从缓存中获取这些内容,并将这些内容携带在Data消息中,通过通信接口204发送给订阅节点1,那么此时中间节点发送给订阅节点1的就是第一部分内容,处理结束。如果中间节点在CS表中查询确定本地未缓存该Interest消息所请求获取的内容,则中间节点通过处理器201查询本地的PIT,确定是否存储了用于处理第一部分内容的PIT表项。根据是否存储了用于处理第一部分内容的PIT表项,下面分为两个分支来介绍:1) Because the Interest message does not carry Get_Content_from_Origin, or the value of Get_Content_from_Origin carried is 0, then the intermediate node queries the local CS table through the processor 201, if it is found in the CS table that the Interest message requested to obtain is locally cached Content, that is, cached content whose serial number is between num1 and numN, the intermediate node can obtain the content from the cache through the processor 201, carry the content in the Data message, and send it to the subscribing node 1 through the communication interface 204 , then what the intermediate node sends to the subscribing node 1 at this time is the first part of the content, and the processing ends. If the intermediate node inquires in the CS table and determines that the content requested by the Interest message is not cached locally, the intermediate node queries the local PIT through the processor 201 to determine whether a PIT entry for processing the first part of content is stored. According to whether the PIT entry for processing the first part of the content is stored, the following is divided into two branches to introduce:
分支1:可选的,如果中间节点查询到了第一表项,其中,第一表项包括的内容的名称的前缀与该Interest消息相匹配,且第一表项包括的第三序列号的值小于等于第一序列号的值,及第一表项包括的第四序列号的值大于等于第二序列号的值,即该Interest消息携带的[Seq_min,Seq_max]是第二表项包括的[Seq_min,Seq_max]的子集,则中间节点确定第一表项就是已存储的用于处理第一部分内容的PIT表项,则中间节点可以通过处理器201将中间节点到订阅节点1的路由信息添加到第二表项中,该路由信息例如可以包括该Interest的入接口信息。另外,中间节点也无需通过通信接口204向下一跳节点转发该Interest消息,例如可以通过处理器201丢弃该Interest消息,以节省传输资源。Branch 1: Optionally, if the intermediate node finds the first entry, where the prefix of the content name included in the first entry matches the Interest message, and the value of the third serial number included in the first entry Less than or equal to the value of the first sequence number, and the value of the fourth sequence number included in the first entry is greater than or equal to the value of the second sequence number, that is, the [Seq_min, Seq_max] carried in the Interest message is the [Seq_min, Seq_max] included in the second entry. Seq_min, Seq_max], the intermediate node determines that the first entry is the stored PIT entry for processing the first part of the content, then the intermediate node can add the routing information from the intermediate node to the subscription node 1 through the processor 201 In the second entry, the routing information may include, for example, the inbound interface information of the Interest. In addition, the intermediate node does not need to forward the Interest message to the next-hop node through the communication interface 204, for example, the Interest message can be discarded through the processor 201 to save transmission resources.
分支2:或者,可选的,如果中间节点未查询到包括的内容的名称的前缀与该Interest消息相匹配的PIT表项,或者虽然查询到了包括的内容的名称的前缀与该Interest消息相匹配的PIT表项,但该PIT表项包括的第三序列号的值大于第一序列号的值和/或该PIT表项包括的第四序列号的值小于第二序列号的值,即该Interest消息携带的[Seq_min,Seq_max]不是该PIT表项包括的[Seq_min,Seq_max]的子集,则中间节点确定未存储用于处理第一部分内容的PIT表项,则中间节点可以通过处理器201新增PIT表项,例如新增的PIT表项可以称为第二表项。第二表项包括的内容的名称的前缀为该Interest消息携带的内容的名称的前缀,第二表项包括的notify字段用于指示该PIT表项用于重新获取订阅的内容,第二表项包括的Seq_min的取值为该Interest消息携带的Seq_min的取值,第二表项包括的Seq_max的取值为该Interest消息携带的Seq_max的取值,第二表项包括的路由信息可以是中间节点到订阅节点1的路由信息,该路由信息例如可以包括该Interest消息的入接口信息。中间节点可以通过通信接口204向下一跳节点转发该Interest消息。Branch 2: Or, optionally, if the intermediate node does not find a PIT entry whose prefix of the name of the included content matches the Interest message, or although it finds that the prefix of the name of the included content matches the Interest message PIT entry, but the value of the third sequence number included in the PIT entry is greater than the value of the first sequence number and/or the value of the fourth sequence number included in the PIT entry is smaller than the value of the second sequence number, that is, the The [Seq_min, Seq_max] carried by the Interest message is not a subset of the [Seq_min, Seq_max] included in the PIT entry, then the intermediate node determines that the PIT entry for processing the first part of the content is not stored, and the intermediate node can pass the processor 201 A newly added PIT entry, for example, a newly added PIT entry may be called a second entry. The prefix of the name of the content included in the second entry is the prefix of the name of the content carried in the Interest message, and the notify field included in the second entry is used to indicate that the PIT entry is used to reacquire the subscribed content, and the second entry The value of Seq_min included is the value of Seq_min carried in the Interest message, the value of Seq_max included in the second entry is the value of Seq_max carried in the Interest message, and the routing information included in the second entry can be an intermediate node Routing information to the subscribing node 1, for example, the routing information may include the incoming interface information of the Interest message. The intermediate node may forward the Interest message to the next-hop node through the communication interface 204 .
8、中间节点通过通信接口204向下一跳节点转发该Interest消息。例2以此为例,那么在这种情况下,可能实现的是步骤7的分支2的情况。8. The intermediate node forwards the Interest message to the next-hop node through the communication interface 204 . Example 2 takes this as an example, then in this case, it is possible to realize the case of branch 2 of step 7.
9、备份节点收到该Interest消息后,确定该Interest消息携带的Seq_min的取值所对应的第一序列号(即num1)以及该Interest消息携带的Seq_max的取值所对应的第二序列号(即numN)之间的所有的订阅内容(其中可以包括序列号为num1的内容以及序列号为numN的内容),即确定第二部分内容,将确定的第二部分内容携带在Data消息中,并发送该Data消息。在例2中,第二部分内容与第一部分内容可以为相同的内容。9. After receiving the Interest message, the backup node determines the first sequence number (ie num1) corresponding to the value of Seq_min carried by the Interest message and the second sequence number (ie num1) corresponding to the value of Seq_max carried by the Interest message ( That is, all subscription content between numN) (which may include the content with the serial number num1 and the content with the serial number numN), that is, determine the second part of the content, carry the determined second part of the content in the Data message, and Send the Data message. In Example 2, the second part of content may be the same as the first part of content.
其中,在Data消息中可以携带所请求的内容的名称的前缀,还可以携带Seq_min和Seq_max,Seq_min的取值为num1,Seq_max的取值为numN,当然,Data消息中还可以携带Interest消息所请求的具体内容。Among them, the Data message can carry the prefix of the name of the requested content, and can also carry Seq_min and Seq_max. The value of Seq_min is num1, and the value of Seq_max is numN. Of course, the Data message can also carry the value requested by the Interest message. specific content.
10、中间节点通过通信接口204接收到备份节点发送的Data消息后,通过处理器201根据本地的PIT表项(该PIT表项可以是更新后的第一表项,或者也可以是第二表项)中的Seq_min和Seq_max决定是转发该Data消息还是丢弃该Data消息(当然前提是PIT表项包括的内容的名称的前缀与该Data消息携带的内容的名称的前缀相匹配)。可选的,判决过程如下:10. After the intermediate node receives the Data message sent by the backup node through the communication interface 204, it uses the processor 201 according to the local PIT entry (the PIT entry can be the updated first entry, or it can also be the second table entry). Item) in Seq_min and Seq_max decide whether to forward the Data message or discard the Data message (of course, the premise is that the prefix of the name of the content included in the PIT entry matches the prefix of the name of the content carried in the Data message). Optionally, the judgment process is as follows:
如果该Data消息中的Seq_min的取值等于本地的PIT表项中记录的Seq_min的取值,以及该Data消息中的Seq_max的取值等于本地的PIT表项中记录的Seq_max的取值,则中间节点可以通过通信接口204将该Data消息转发给下一跳节点,否则中间节点可以通过处理器201丢弃该Data消息。例如,例2以中间节点确定通过通信接口204向下一跳节点转发该Data消息为例,下一跳节点例如为订阅节点1。If the value of Seq_min in the Data message is equal to the value of Seq_min recorded in the local PIT entry, and the value of Seq_max in the Data message is equal to the value of Seq_max recorded in the local PIT entry, then the intermediate The node can forward the Data message to the next-hop node through the communication interface 204 , otherwise, the intermediate node can discard the Data message through the processor 201 . For example, in Example 2, the intermediate node determines to forward the Data message to the next-hop node through the communication interface 204 as an example, and the next-hop node is, for example, the subscribing node 1 .
11、中间节点通过通信接口204向下一跳节点转发该Data消息。11. The intermediate node forwards the Data message to the next-hop node through the communication interface 204 .
12、订阅节点1接收该Data消息,从而,订阅节点1就得到了第二部分内容。12. The subscribing node 1 receives the Data message, so that the subscribing node 1 obtains the second part of content.
下面结合附图介绍本发明实施例提供的设备。The following describes the equipment provided by the embodiments of the present invention with reference to the accompanying drawings.
请参见图5,基于同一发明构思,提供一种中间节点,该中间节点可以包括接收单元501、处理单元502和发送单元503。Referring to FIG. 5 , based on the same inventive concept, an intermediate node is provided, and the intermediate node may include a receiving unit 501 , a processing unit 502 and a sending unit 503 .
在实际应用中,接收单元501对应的实体设备可以包括图2中的通信接口204,处理单元502对应的实体设备可以是图2中的处理器201,发送单元503对应的实体设备可以包括图2中的通信接口204。可以认为,图2中的通信接口204中,有的通信接口204实现接收单元501的功能,有的通信接口204实现发送单元503的功能,或者可以认为,图2中的通信接口204中,可能每个通信接口204都既能实现接收单元501的功能也能实现发送单元503的功能。In practical applications, the physical device corresponding to the receiving unit 501 may include the communication interface 204 in FIG. 2 , the physical device corresponding to the processing unit 502 may be the processor 201 in FIG. 2 , and the physical device corresponding to the sending unit 503 may include the The communication interface 204 in. It can be considered that, among the communication interfaces 204 in FIG. Each communication interface 204 can realize both the function of the receiving unit 501 and the function of the sending unit 503 .
该中间节点可以用于执行上述图3-图4所述的方法,例如可以是如前所述的中间节点。因此,对于该中间节点中的各单元所实现的功能等,可参考如前方法部分的描述,不多赘述。The intermediate node may be used to execute the methods described in FIGS. 3-4 above, and may be, for example, the aforementioned intermediate node. Therefore, for the functions realized by the units in the intermediate node, etc., reference may be made to the description in the method part above, and details will not be repeated.
请参见图6,基于同一发明构思,提供一种订阅节点,该订阅节点可以包括接收单元601和发送单元602。可选的,该订阅节点还可以包括处理单元603,在图6中一并示出。Referring to FIG. 6 , based on the same inventive concept, a subscription node is provided, and the subscription node may include a receiving unit 601 and a sending unit 602 . Optionally, the subscribing node may further include a processing unit 603, which is also shown in FIG. 6 .
在实际应用中,接收单元601对应的实体设备可以包括图2中的通信接口204,处理单元603对应的实体设备可以是图2中的处理器201,发送单元602对应的实体设备可以包括图2中的通信接口204。可以认为,图2中的通信接口204中,有的通信接口204实现接收单元601的功能,有的通信接口204实现发送单元602的功能,或者可以认为,图2中的通信接口204中,可能每个通信接口204都既能实现接收单元601的功能也能实现发送单元602的功能。In practical applications, the physical device corresponding to the receiving unit 601 may include the communication interface 204 in FIG. 2 , the physical device corresponding to the processing unit 603 may be the processor 201 in FIG. 2 , and the physical device corresponding to the sending unit 602 may include the The communication interface 204 in. It can be considered that among the communication interfaces 204 in FIG. 2, some communication interfaces 204 realize the function of the receiving unit 601, and some communication interfaces 204 realize the function of the sending unit 602, or it can be considered that among the communication interfaces 204 in FIG. Each communication interface 204 can realize both the function of the receiving unit 601 and the function of the sending unit 602 .
该订阅节点可以用于执行上述图3-图4所述的方法,例如可以是如前所述的订阅节点。因此,对于该订阅节点中的各单元所实现的功能等,可参考如前方法部分的描述,不多赘述。The subscribing node may be used to execute the methods described above in FIGS. 3-4 , for example, may be the subscribing node as described above. Therefore, for the functions realized by the units in the subscribing node, etc., reference may be made to the description in the previous method part, and details will not be repeated.
本发明实施例中,订阅节点如果未收到某些内容,则订阅节点可以发送用于获取这些内容的请求消息(例如为第一请求消息),在第一请求消息中可以携带这部分内容的序列号中的最小序列号,这样订阅节点就可以接收这部分内容,从而,订阅节点即使离线,上线后也可以重新请求获得丢失的内容,或者订阅节点即使因为网络异常等原因未接收到一部分订阅内容,后续也可以重新请求获得这些内容,尽量避免内容丢失的情况。In the embodiment of the present invention, if the subscribing node does not receive certain content, the subscribing node may send a request message (for example, a first request message) for obtaining the content, and the first request message may carry the information of this part of the content The smallest serial number in the serial number, so that the subscribing node can receive this part of the content, so that even if the subscribing node is offline, it can re-request the lost content after going online, or even if the subscribing node does not receive part of the subscription due to network abnormalities and other reasons Content, you can also re-request to obtain the content in the future, so as to avoid the loss of content as much as possible.
本发明实施例还提供了一种计算机存储介质,用于储存为上述中间节点所用的计算机软件指令,其包含用于执行上述方面为中间节点所设计的程序。An embodiment of the present invention also provides a computer storage medium for storing computer software instructions for the above-mentioned intermediate node, which includes a program designed for the intermediate node to execute the above-mentioned aspects.
本发明实施例还提供了另一种计算机存储介质,用于储存为上述订阅节点所用的计算机软件指令,其包含用于执行上述方面为订阅节点所设计的程序。The embodiment of the present invention also provides another computer storage medium, which is used to store the computer software instructions used by the above-mentioned subscribing node, which includes a program designed for the subscribing node to execute the above aspect.
在本发明中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性或其它的形式。In the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation may either be integrated into another system, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本发明实施例。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to implement the embodiments of the present invention.
在本发明实施例中的各功能单元可以集成在一个处理单元中,或者各个单元也可以均是独立的物理模块。Each functional unit in the embodiment of the present invention may be integrated into one processing unit, or each unit may also be an independent physical module.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:通用串行总线闪存盘(UniversalSerialBusflashdrive)、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, all or part of the technical solutions of the present invention may be embodied in the form of software products, which are stored in a storage medium and include instructions to enable a computer device (which may be a personal computer, A server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage media include: Universal Serial Bus flash drives (Universal Serial Bus flash drives), mobile hard disks, ROMs, RAMs, magnetic disks or optical disks, and other media that can store program codes.
以上所述,以上实施例仅用以对本发明的技术方案进行了详细介绍,但以上实施例的说明只是用于帮助理解本发明实施例的方法,不应理解为对本发明实施例的限制。本技术领域的技术人员可轻易想到的变化或替换,都应涵盖在本发明实施例的保护范围之内。As mentioned above, the above embodiments are only used to introduce the technical solutions of the present invention in detail, but the descriptions of the above embodiments are only used to help understand the methods of the embodiments of the present invention, and should not be construed as limitations on the embodiments of the present invention. Changes or substitutions that can be easily imagined by those skilled in the art should fall within the protection scope of the embodiments of the present invention.
Claims (30)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610082114.4A CN105763607A (en) | 2016-02-05 | 2016-02-05 | Subscription content acquisition method, equipment and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610082114.4A CN105763607A (en) | 2016-02-05 | 2016-02-05 | Subscription content acquisition method, equipment and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105763607A true CN105763607A (en) | 2016-07-13 |
Family
ID=56330694
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610082114.4A Pending CN105763607A (en) | 2016-02-05 | 2016-02-05 | Subscription content acquisition method, equipment and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105763607A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790454A (en) * | 2016-12-07 | 2017-05-31 | 努比亚技术有限公司 | Deferred information method for pushing and device |
CN107070813A (en) * | 2017-03-09 | 2017-08-18 | 中国科学院声学研究所 | A kind of system and method for the content caching based on virtual network interface |
CN108200178A (en) * | 2018-01-04 | 2018-06-22 | 海信集团有限公司 | A kind of method and apparatus for downloading resource |
CN113748442A (en) * | 2019-05-01 | 2021-12-03 | 索尼集团公司 | Large-scale node configuration management for MAAS platform |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103581252A (en) * | 2012-07-31 | 2014-02-12 | 华为技术有限公司 | Method, device and system for supporting subscription content of content network |
US20140079044A1 (en) * | 2012-03-02 | 2014-03-20 | Huawei Devices Co., Ltd. | Method, apparatus, and system for pushing information based on wireless local area network |
CN104683288A (en) * | 2013-11-26 | 2015-06-03 | 腾讯科技(北京)有限公司 | Message continuous transmission method and device |
-
2016
- 2016-02-05 CN CN201610082114.4A patent/CN105763607A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140079044A1 (en) * | 2012-03-02 | 2014-03-20 | Huawei Devices Co., Ltd. | Method, apparatus, and system for pushing information based on wireless local area network |
CN103581252A (en) * | 2012-07-31 | 2014-02-12 | 华为技术有限公司 | Method, device and system for supporting subscription content of content network |
CN104683288A (en) * | 2013-11-26 | 2015-06-03 | 腾讯科技(北京)有限公司 | Message continuous transmission method and device |
Non-Patent Citations (1)
Title |
---|
GEORGE XYLOMENOS等: "A Survey of Information-Centric Networking Research", 《IEEE COMMUNICATIONS SURVEYS & TUTORIALS》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106790454A (en) * | 2016-12-07 | 2017-05-31 | 努比亚技术有限公司 | Deferred information method for pushing and device |
CN107070813A (en) * | 2017-03-09 | 2017-08-18 | 中国科学院声学研究所 | A kind of system and method for the content caching based on virtual network interface |
CN107070813B (en) * | 2017-03-09 | 2019-11-19 | 中国科学院声学研究所 | System and method for content caching based on virtual network interface |
CN108200178A (en) * | 2018-01-04 | 2018-06-22 | 海信集团有限公司 | A kind of method and apparatus for downloading resource |
CN113748442A (en) * | 2019-05-01 | 2021-12-03 | 索尼集团公司 | Large-scale node configuration management for MAAS platform |
CN113748442B (en) * | 2019-05-01 | 2024-04-05 | 索尼集团公司 | Large-scale node configuration management for MAAS platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108696895B (en) | Resource acquisition method, device and system | |
CN1925462B (en) | cache system | |
US10491657B2 (en) | Network acceleration method, apparatus and device based on router device | |
CN101616132B (en) | Method for acquiring data, device and system thereof | |
WO2006085519A1 (en) | Information distribution system, distribution request program, transmission program, distribution program, and others | |
CN101257670A (en) | Method, device and system for mobile phone file search and download | |
US7958195B2 (en) | Method and apparatus for improving data transfers in peer-to-peer networks | |
RU2483455C2 (en) | Methods and apparatus for detecting peer-to-peer overlay networks | |
CN106464657B (en) | A method, device and system for transmitting data | |
WO2014139481A1 (en) | Method and device for packet handling | |
CN105763607A (en) | Subscription content acquisition method, equipment and system | |
US11431765B2 (en) | Session migration—based scheduling method and server | |
EP3217611A1 (en) | Media resource feedback method and device | |
CN102984223B (en) | A kind of message method, the network equipment and system | |
JP2016082578A (en) | Online incremental content placement in a content-centric network | |
US20210051573A1 (en) | Inclusion of a message proxy in a service based architecture | |
CN106028311B (en) | A terminal registration method and device | |
WO2015103738A1 (en) | Content distribution method, apparatus and system | |
WO2019201072A1 (en) | Cdn service scheduling processing method and cdn server | |
RU2483457C2 (en) | Message routing platform | |
US20220263759A1 (en) | Addressing method, addressing system, and addressing apparatus | |
WO2021088357A1 (en) | Method for generating forwarding information, device, and system | |
US8392549B2 (en) | Apparatus and method for registering node and searching for floating internet protocol address using distributed network | |
CN106970965A (en) | A kind of Novel Internet resource search method | |
CN109309711B (en) | A virtual cache sharing method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160713 |