CN108449277B - Method and device for sending message - Google Patents
Method and device for sending message Download PDFInfo
- Publication number
- CN108449277B CN108449277B CN201611140448.9A CN201611140448A CN108449277B CN 108449277 B CN108449277 B CN 108449277B CN 201611140448 A CN201611140448 A CN 201611140448A CN 108449277 B CN108449277 B CN 108449277B
- Authority
- CN
- China
- Prior art keywords
- content data
- identifier
- data
- content
- benefit
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
- H04L45/742—Route cache; Operation thereof
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/50—Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本申请公开了一种报文发送方法及装置,包括:第一设备在确定第一设备中不存在内容请求报文所请求的第一内容数据、且确定所述第一设备为待存储所述第一内容数据的设备时,通过将内容请求报文中的第一效益修改为第二效益、将第三设备的标识修改为所述第一设备的标识、将第一标识修改为指示所述第一设备中存在空闲的存储空间的标识,从而实现向其他设备指示出第一设备可以存储所述第一内容数据,从而实现在网络中为第一内容数据选择出合适的存储设备,提供其他设备请求第一内容数据的命中率,有效节省传输能耗。
The present application discloses a method and device for sending a message, including: a first device determining that the first content data requested by a content request message does not exist in the first device, and determining that the first device is to store the When the device of the first content data is used, by modifying the first benefit in the content request message to the second benefit, modifying the identification of the third device to the identification of the first device, and modifying the first identification to indicate the There is an identifier of free storage space in the first device, so as to indicate to other devices that the first device can store the first content data, so as to select a suitable storage device for the first content data in the network, and provide other devices. The device requests the hit rate of the first content data, which effectively saves transmission energy consumption.
Description
技术领域technical field
本申请涉及计算机技术领域,尤其涉及一种报文发送方法及装置。The present application relates to the field of computer technologies, and in particular, to a method and device for sending a message.
背景技术Background technique
内容标记网络(Named Data Networking,NDN)中,内容是通过名字进行标识的,而不是目的主机地址。NDN中两个基本的数据报文类型是内容请求报文(Interest packet)和数据报文(Data packet)。内容请求者(Consumer)发出Interest packet并在网络中传播,不需指定特定接收端。NDN路由器具有缓存内容的能力。在Interest packet从请求者向内容源(producer)的传播过程中,任意一个存放有对应Data的沿途(on-path)路由器都可以发出Data packet以服务该内容请求者。通过路由器处的缓存服务,Data的下载距离被显著缩短,从而大大降低了网络传输能耗。In Named Data Networking (NDN), content is identified by name rather than destination host address. The two basic data packet types in NDN are content request packets (Interest packet) and data packets (Data packet). The content requester (Consumer) sends out the Interest packet and spreads it in the network without specifying a specific receiver. NDN routers have the ability to cache content. During the propagation of the Interest packet from the requester to the content source (producer), any on-path router that stores the corresponding Data can send the Data packet to serve the content requester. Through the cache service at the router, the download distance of Data is significantly shortened, thereby greatly reducing the energy consumption of network transmission.
目前,NDN中采用洪泛式的沿路内容缓存策略(Caching Everything Everywhere,CEE)进行缓存内容,每个路由器采用近期最少使用(Least Recently Used,LRU)策略进行缓存替换。该策略中,每个路由器对于收到的Data packet,都存入路由器的缓存中,当缓存存满后,把缓存中最长时间未被访问的内容剔除。At present, the flood-style content caching strategy (Caching Everything Everywhere, CEE) is used in NDN to cache content, and each router adopts the Least Recently Used (Least Recently Used, LRU) strategy for cache replacement. In this strategy, each router stores the received data packet in the router's cache, and when the cache is full, the content that has not been accessed for the longest time in the cache is eliminated.
但是,与不断增长的海量内容相比,一个路由器的缓存资源远远小于网络中内容数量,只有一小部分内容可以被缓存在路由器中。因此,需要充分利用缓存资源,提高缓存命中率,有效节省传输能耗。However, compared with the growing mass of content, the cache resources of a router are far less than the amount of content in the network, and only a small part of the content can be cached in the router. Therefore, it is necessary to make full use of the cache resources, improve the cache hit rate, and effectively save the transmission energy consumption.
NDN作为一项新的网络技术,针对节能的缓存部署策略尚处于研究初始阶段。目前,具体如何确定由哪些路由器缓存内容,从而提高缓存命中率,有效节省传输能耗,还没有形成最终有效的方案。As a new network technology, NDN is still in the initial stage of research on energy-saving cache deployment strategies. Currently, there is no final and effective solution on how to determine which routers cache content, thereby improving the cache hit rate and effectively saving transmission energy consumption.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种报文发送方法及装置,用以提供一种缓存内容的策略,提高缓存命中率,有效节省传输能耗。Embodiments of the present application provide a method and device for sending a message, which are used to provide a strategy for caching content, improve the cache hit rate, and effectively save transmission energy consumption.
第一方面,本申请实施例提供一种报文发送方法,包括:In a first aspect, an embodiment of the present application provides a method for sending a message, including:
第一设备接收第二设备发送的用于请求第一内容数据的内容请求报文;所述内容请求报文中包括第一标识、第一效益、第三设备的标识;所述第三设备为待存储所述第一内容数据的设备,所述第一标识指示所述第三设备中是否存在空闲的存储空间,所述第一效益指示出所述第三设备接收到请求所述第一内容数据的报文的次数;The first device receives a content request message sent by the second device for requesting the first content data; the content request message includes the first identifier, the first benefit, and the identifier of the third device; the third device is A device to store the first content data, the first identifier indicates whether there is free storage space in the third device, and the first benefit indicates that the third device has received a request for the first content The number of data packets;
所述第一设备若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备为待存储所述第一内容数据的设备时,将所述内容请求报文中的第一效益修改为所述第二效益、将所述第三设备的标识修改为所述第一设备的标识、将所述第一标识修改为指示所述第一设备中存在空闲的存储空间的标识;所述第二效益指示出所述第一设备接收到请求所述第一内容数据的报文的次数;If the first device determines that the first content data does not exist in the first device, when it is determined that the first device is a device to store the first content data, the content request message is sent to the first device. The first benefit in is modified to the second benefit, the identification of the third device is modified to the identification of the first device, the first identification is modified to indicate that there is free storage in the first device The identifier of the space; the second benefit indicates the number of times that the first device receives the message requesting the first content data;
所述第一设备向第四设备发送修改后的所述内容请求报文。The first device sends the modified content request message to the fourth device.
通过上述方法,第一设备在确定第一设备中不存在内容请求报文所请求的第一内容数据、且确定所述第一设备为待存储所述第一内容数据的设备时,通过将内容请求报文中的第一效益修改为第二效益、将第三设备的标识修改为所述第一设备的标识、将第一标识修改为指示所述第一设备中存在空闲的存储空间的标识,从而实现向其他设备指示出第一设备可以存储所述第一内容数据,从而实现在网络中为第一内容数据选择出合适的存储设备,提供其他设备请求第一内容数据的命中率,有效节省传输能耗。Through the above method, when the first device determines that the first content data requested by the content request message does not exist in the first device, and determines that the first device is a device to store the first content data, The first benefit in the request message is changed to the second benefit, the identity of the third device is changed to the identity of the first device, and the first identity is changed to indicate that there is free storage space in the first device. , so as to indicate to other devices that the first device can store the first content data, so as to select a suitable storage device for the first content data in the network, provide the hit rate of other devices requesting the first content data, and effectively Save transmission energy.
可选的,所述方法还包括:Optionally, the method further includes:
第一设备将第一标识、第一效益、第三设备的标识存储在所述第一设备的待定请求表中。The first device stores the first identification, the first benefit, and the identification of the third device in the pending request table of the first device.
可选的,所述方法还包括:Optionally, the method further includes:
所述第一设备若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备不是待存储所述第一内容数据的设备时,向所述第四设备转发所述内容请求报文。If the first device determines that the first content data does not exist in the first device, when determining that the first device is not a device to store the first content data, forwarding to the fourth device the content request message.
可选的,所述第一设备确定所述第一设备为待存储所述第一内容数据的设备,包括:Optionally, the first device determines that the first device is a device to store the first content data, including:
所述第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中不存在空闲的存储空间,则确定所述第一设备为待存储所述第一内容数据的设备;或者There is free storage space in the first device, and according to the first identifier, it is determined that there is no free storage space in the third device, and then it is determined that the first device is the one to store the first content data. equipment; or
所述第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,则确定所述第一设备为待存储所述第一内容数据的设备;或者There is free storage space in the first device, and it is determined according to the first identifier that there is free storage space in the third device, and it is determined that the second benefit is greater than the first benefit, then determine the The first device is a device to store the first content data; or
所述第一设备中不存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,且确定所述第一设备中存在待删除的内容数据,则确定所述第一设备为待存储所述第一内容数据的设备。There is no free storage space in the first device, and it is determined according to the first identifier that there is free storage space in the third device, and it is determined that the second benefit is greater than the first benefit, and it is determined that the If there is content data to be deleted in the first device, it is determined that the first device is a device to store the first content data.
根据上述方法,第一设备在确定满足上述任一条件时,可以确定第一设备为待存储所述第一内容数据的设备,从而实现为第一内容数据确定合适的待存储设备。According to the above method, when the first device determines that any of the above conditions is satisfied, the first device may determine that the first device is a device to store the first content data, so as to determine an appropriate device to be stored for the first content data.
可选的,所述第二效益满足以下公式:Optionally, the second benefit satisfies the following formula:
Ben=R×(h+1);或者Ben=R×(h+1); or
其中,Ben为所述第二效益,R为所述第一设备接收到请求所述第一内容数据的报文的次数,h为所述第一设备与存储所述第一内容数据的设备之间的距离;K为向所述第一设备发送控制消息的设备的数量,所述控制消息中包括所述第一内容数据在发送所述控制消息的设备中的效益以及发送所述控制消息的设备接收到请求所述第一内容数据的报文的次数;ri为K个设备中第i个设备的接收到请求所述第一内容数据的报文的次数,bmin为所述K个设备中所述第一内容数据的效益最小值,bmax为所述K个设备中所述第一内容数据的效益最大值。Among them, Ben is the second benefit, R is the number of times the first device receives the message requesting the first content data, and h is the difference between the first device and the device storing the first content data The distance between them; K is the number of devices sending control messages to the first device, and the control messages include the benefits of the first content data in the devices sending the control messages and the number of devices sending the control messages. The number of times that the device receives the message requesting the first content data; r i is the number of times that the ith device in the K devices receives the message requesting the first content data, and b min is the K The minimum benefit value of the first content data in the device, and b max is the maximum benefit value of the first content data in the K devices.
可选的,所述方法还包括:Optionally, the method further includes:
所述第一设备若确定所述第一设备中存在所述第一内容数据,则生成包括所述第一内容数据的第一数据报文,并向所述第二设备发送所述第一数据报文。If the first device determines that the first content data exists in the first device, generates a first data packet including the first content data, and sends the first data to the second device message.
可选的,所述方法还包括:Optionally, the method further includes:
所述第一设备接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The first device receives a second data message including the second content data sent by the fifth device; the second data message includes a second identifier, a third identifier, and an identifier of the sixth device; the second identifier Indicates the distance between the fifth device and the device storing the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth The device is a device to be stored or has stored the second content data;
所述第一设备若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;If the first device determines to store the second content data, it modifies the distance indicated by the second flag to 0, and modifies the third flag to indicate that the second content data is stored in the second content data. The identifier stored on the transmission path of the content data;
所述第一设备存储所述第二内容数据,并发送修改后的所述第二数据报文。The first device stores the second content data, and sends the modified second data message.
通过上述方法,第一设备接收到包括第二内容数据的第二数据报文之后,若确定存储所述第二内容数据,则将第二标识指示的距离修改为0,并将第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识,从而向接收到修改后的所述第二数据报文的设备指示出,第一设备为存储第二内容数据的设备。当存在其他设备需要请求第二内容数据时,可以快速确定第一设备,从而提高第二内容数据是命中率,有效节省传输能耗。Through the above method, after the first device receives the second data message including the second content data, if it is determined to store the second content data, the distance indicated by the second identifier is modified to 0, and the third identifier is modified To indicate that the second content data is stored on the transmission path of the second content data, so as to indicate to the device receiving the modified second data message that the first device is to store the second content data. device for content data. When other devices need to request the second content data, the first device can be quickly determined, thereby improving the hit rate of the second content data and effectively saving transmission energy consumption.
可选的,所述方法还包括:Optionally, the method further includes:
所述第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device are the same, and there is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identifier of the sixth device is modified to the identifier of the seventh device, and the After adding one to the distance indicated by the second identifier, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述方法还包括:Optionally, the method further includes:
所述第一设备若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,发送所述第二数据报文。If the first device determines that the second content data is stored on the transmission path of the second content data according to the third identifier, the first device adds one to the distance indicated by the second identifier, and sends the The second data message.
可选的,所述第一设备确定存储所述第二内容数据,包括:Optionally, determining by the first device to store the second content data includes:
所述第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and determines that the identifier of the sixth device is the same as the identifier of the first device If the identifiers are the same, and there is free storage space in the first device, it is determined to store the second content data; or
所述第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device and the target data content exists in the first device, determine to store the second content data, wherein the target data content in the first device is more efficient than the second data content in the The benefit in the first device is small.
第二方面,本申请实施例提供一种报文发送装置,包括:In a second aspect, an embodiment of the present application provides a device for sending a message, including:
收发单元,用于接收第二设备发送的用于请求第一内容数据的内容请求报文;所述内容请求报文中包括第一标识、第一效益、第三设备的标识;所述第三设备为待存储所述第一内容数据的设备,所述第一标识指示所述第三设备中是否存在空闲的存储空间,所述第一效益指示出所述第三设备接收到请求所述第一内容数据的报文的次数;A transceiver unit, configured to receive a content request message sent by a second device for requesting first content data; the content request message includes a first identifier, a first benefit, and an identifier of a third device; the third The device is a device that is to store the first content data, the first identifier indicates whether there is free storage space in the third device, and the first benefit indicates that the third device has received a request for the third device. The number of messages of a content data;
处理单元,用于若确定第一设备中不存在所述第一内容数据,则在确定所述第一设备为待存储所述第一内容数据的设备时,将所述内容请求报文中的第一效益修改为所述第二效益、将所述第三设备的标识修改为所述第一设备的标识、将所述第一标识修改为指示所述第一设备中存在空闲的存储空间的标识;所述第二效益指示出所述第一设备接收到请求所述第一内容数据的报文的次数;The processing unit is configured to, if it is determined that the first content data does not exist in the first device, when it is determined that the first device is a device to store the first content data, send the data in the content request message The first benefit is modified to the second benefit, the identifier of the third device is modified to the identifier of the first device, and the first identifier is modified to indicate that there is free storage space in the first device. identifier; the second benefit indicates the number of times that the first device receives a message requesting the first content data;
所述收发单元,用于向第四设备发送修改后的所述内容请求报文。The transceiver unit is configured to send the modified content request message to the fourth device.
可选的,所述处理单元还用于:Optionally, the processing unit is also used for:
若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备不是待存储所述第一内容数据的设备时,通过所述收发单元向所述第四设备转发所述内容请求报文。If it is determined that the first content data does not exist in the first device, when it is determined that the first device is not a device to store the first content data, forwarding to the fourth device through the transceiver unit the content request message.
可选的,所述处理单元具体用于:Optionally, the processing unit is specifically used for:
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中不存在空闲的存储空间,则确定所述第一设备为待存储所述第一内容数据的设备;或者It is determined that there is free storage space in the first device, and according to the first identifier, it is determined that there is no free storage space in the third device, then it is determined that the first device is a device to store the first content data ;or
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,则确定所述第一设备为待存储所述第一内容数据的设备;或者Determining that there is free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, and determining that the second benefit is greater than the first benefit, then determining the first benefit A device is a device to store the first content data; or
确定第一设备中不存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,且确定所述第一设备中存在待删除的内容数据,则确定所述第一设备为待存储所述第一内容数据的设备。determining that there is no free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, determining that the second benefit is greater than the first benefit, and determining that the If there is content data to be deleted in the first device, it is determined that the first device is a device to store the first content data.
可选的,所述第二效益满足以下公式:Optionally, the second benefit satisfies the following formula:
Ben=R×(h+1);或者Ben=R×(h+1); or
其中,Ben为所述第二效益,R为所述第一设备接收到请求所述第一内容数据的报文的次数,h为所述第一设备与存储所述第一内容数据的设备之间的距离;K为向所述第一设备发送控制消息的设备的数量,所述控制消息中包括所述第一内容数据在发送所述控制消息的设备中的效益以及发送所述控制消息的设备接收到请求所述第一内容数据的报文的次数;ri为K个设备中第i个设备的接收到请求所述第一内容数据的报文的次数,bmin为所述K个设备中所述第一内容数据的效益最小值,bmax为所述K个设备中所述第一内容数据的效益最大值。Among them, Ben is the second benefit, R is the number of times the first device receives the message requesting the first content data, and h is the difference between the first device and the device storing the first content data The distance between them; K is the number of devices sending control messages to the first device, and the control messages include the benefits of the first content data in the devices sending the control messages and the number of devices sending the control messages. The number of times that the device receives the message requesting the first content data; r i is the number of times that the ith device in the K devices receives the message requesting the first content data, and b min is the K The minimum benefit value of the first content data in the device, and b max is the maximum benefit value of the first content data in the K devices.
可选的,所述处理单元还用于:Optionally, the processing unit is also used for:
若确定所述第一设备中存在所述第一内容数据,则生成包括所述第一内容数据的第一数据报文,并通过所述收发单元向所述第二设备发送所述第一数据报文。If it is determined that the first content data exists in the first device, generate a first data packet including the first content data, and send the first data to the second device through the transceiver unit message.
可选的,所述装置还包括存储单元;Optionally, the device further includes a storage unit;
所述收发单元还用于:The transceiver unit is also used for:
接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The receiving fifth device sends a second data message including the second content data; the second data message includes a second identifier, a third identifier, and an identifier of the sixth device; the second identifier indicates the fifth the distance between the device and the device that stores the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth device is to be stored or a device that has stored the second content data;
所述处理单元还用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The processing unit is further configured to, if it is determined to store the second content data, modify the distance indicated by the second identifier to 0, and modify the third identifier to indicate that the second content data is stored at the location. the identifier stored on the transmission path of the second content data;
所述存储单元,用于存储所述第二内容数据;the storage unit for storing the second content data;
所述收发单元,用于发送修改后的所述第二数据报文。The transceiver unit is configured to send the modified second data message.
可选的,所述处理单元还用于:Optionally, the processing unit is also used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理单元还用于:Optionally, the processing unit is also used for:
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发单元发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, add one to the distance indicated by the second identifier, and send the The second data message.
可选的,所述处理单元具体用于:Optionally, the processing unit is specifically used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
第三方面,本申请实施例提供一种报文发送装置,包括:In a third aspect, an embodiment of the present application provides a device for sending a message, including:
收发器,用于接收第二设备发送的用于请求第一内容数据的内容请求报文;所述内容请求报文中包括第一标识、第一效益、第三设备的标识;所述第三设备为待存储所述第一内容数据的设备,所述第一标识指示所述第三设备中是否存在空闲的存储空间,所述第一效益指示出所述第三设备接收到请求所述第一内容数据的报文的次数;a transceiver, configured to receive a content request message sent by a second device for requesting first content data; the content request message includes a first identifier, a first benefit, and an identifier of a third device; the third The device is a device that is to store the first content data, the first identifier indicates whether there is free storage space in the third device, and the first benefit indicates that the third device has received a request for the third device. The number of messages of a content data;
处理器,用于若确定第一设备中不存在所述第一内容数据,则在确定所述第一设备为待存储所述第一内容数据的设备时,将所述内容请求报文中的第一效益修改为所述第二效益、将所述第三设备的标识修改为所述第一设备的标识、将所述第一标识修改为指示所述第一设备中存在空闲的存储空间的标识;所述第二效益指示出所述第一设备接收到请求所述第一内容数据的报文的次数;The processor is configured to, if it is determined that the first content data does not exist in the first device, when it is determined that the first device is a device to store the first content data, send the data in the content request message The first benefit is modified to the second benefit, the identifier of the third device is modified to the identifier of the first device, and the first identifier is modified to indicate that there is free storage space in the first device. identifier; the second benefit indicates the number of times that the first device receives a message requesting the first content data;
所述收发器,用于向第四设备发送修改后的所述内容请求报文。The transceiver is configured to send the modified content request message to the fourth device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备不是待存储所述第一内容数据的设备时,通过所述收发器向所述第四设备转发所述内容请求报文。If it is determined that the first content data does not exist in the first device, when it is determined that the first device is not a device to store the first content data, forwarding the data to the fourth device through the transceiver the content request message.
可选的,所述处理器具体用于:Optionally, the processor is specifically used for:
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中不存在空闲的存储空间,则确定所述第一设备为待存储所述第一内容数据的设备;或者It is determined that there is free storage space in the first device, and according to the first identifier, it is determined that there is no free storage space in the third device, then it is determined that the first device is a device to store the first content data ;or
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,则确定所述第一设备为待存储所述第一内容数据的设备;或者Determining that there is free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, and determining that the second benefit is greater than the first benefit, then determining the first benefit A device is a device to store the first content data; or
确定第一设备中不存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,且确定所述第一设备中存在待删除的内容数据,则确定所述第一设备为待存储所述第一内容数据的设备。determining that there is no free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, and determining that the second benefit is greater than the first benefit, and determining that the If there is content data to be deleted in the first device, it is determined that the first device is a device to store the first content data.
可选的,所述第二效益满足以下公式:Optionally, the second benefit satisfies the following formula:
Ben=R×(h+1);或者Ben=R×(h+1); or
其中,Ben为所述第二效益,R为所述第一设备接收到请求所述第一内容数据的报文的次数,h为所述第一设备与存储所述第一内容数据的设备之间的距离;K为向所述第一设备发送控制消息的设备的数量,所述控制消息中包括所述第一内容数据在发送所述控制消息的设备中的效益以及发送所述控制消息的设备接收到请求所述第一内容数据的报文的次数;ri为K个设备中第i个设备的接收到请求所述第一内容数据的报文的次数,bmin为所述K个设备中所述第一内容数据的效益最小值,bmax为所述K个设备中所述第一内容数据的效益最大值。Among them, Ben is the second benefit, R is the number of times the first device receives the message requesting the first content data, and h is the difference between the first device and the device storing the first content data The distance between them; K is the number of devices sending control messages to the first device, and the control messages include the benefits of the first content data in the devices sending the control messages and the number of devices sending the control messages. The number of times that the device receives the message requesting the first content data; r i is the number of times that the ith device in the K devices receives the message requesting the first content data, and b min is the K The minimum benefit value of the first content data in the device, and b max is the maximum benefit value of the first content data in the K devices.
可选的,所述处理器还用于:Optionally, the processor is also used for:
若确定所述第一设备中存在所述第一内容数据,则生成包括所述第一内容数据的第一数据报文,并通过所述收发器向所述第二设备发送所述第一数据报文。If it is determined that the first content data exists in the first device, generate a first data packet including the first content data, and send the first data to the second device through the transceiver message.
可选的,所述装置还包括存储器;Optionally, the device further includes a memory;
所述收发器还用于:The transceiver is also used to:
接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The receiving fifth device sends a second data message including the second content data; the second data message includes a second identifier, a third identifier, and an identifier of the sixth device; the second identifier indicates the fifth the distance between the device and the device that stores the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth device is to be stored or a device that has stored the second content data;
所述处理器还用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The processor is further configured to, if it is determined that the second content data is stored, modify the distance indicated by the second identifier to 0, and modify the third identifier to indicate that the second content data is stored at the location. the identifier stored on the transmission path of the second content data;
所述存储器,用于存储所述第二内容数据;the memory for storing the second content data;
所述收发器,用于发送修改后的所述第二数据报文。The transceiver is configured to send the modified second data message.
可选的,所述处理器还用于:Optionally, the processor is also used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发器发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, the distance indicated by the second identifier is added by one, and then the transceiver sends the The second data message.
可选的,所述处理器具体用于:Optionally, the processor is specifically used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
第四方面,本申请实施例提供了一种计算机存储介质,用于储存为上述第二方面提供的报文发送装置所用的计算机软件指令,其包含用于执行上述第一方面所设计的程序。In a fourth aspect, an embodiment of the present application provides a computer storage medium for storing computer software instructions used by the device for sending a message provided in the second aspect, including a program for executing the program designed in the first aspect.
第五方面,本申请实施例提供一种报文发送方法,包括:In a fifth aspect, an embodiment of the present application provides a method for sending a message, including:
所述第一设备接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The first device receives a second data message including the second content data sent by the fifth device; the second data message includes a second identifier, a third identifier, and an identifier of the sixth device; the second identifier Indicates the distance between the fifth device and the device storing the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth The device is a device to be stored or has stored the second content data;
所述第一设备若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;If the first device determines to store the second content data, it modifies the distance indicated by the second flag to 0, and modifies the third flag to indicate that the second content data is stored in the second content data. The identifier stored on the transmission path of the content data;
所述第一设备存储所述第二内容数据,并发送修改后的所述第二数据报文。The first device stores the second content data, and sends the modified second data message.
通过上述方法,第一设备接收到包括第二内容数据的第二数据报文之后,若确定存储所述第二内容数据,则将第二标识指示的距离修改为0,并将第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识,从而向接收到修改后的所述第二数据报文的设备指示出,第一设备为存储第二内容数据的设备。当存在其他设备需要请求第二内容数据时,可以快速确定第一设备,从而提高第二内容数据是命中率,有效节省传输能耗。Through the above method, after the first device receives the second data message including the second content data, if it is determined to store the second content data, the distance indicated by the second identifier is modified to 0, and the third identifier is modified To indicate that the second content data is stored on the transmission path of the second content data, so as to indicate to the device receiving the modified second data message that the first device is to store the second content data. device for content data. When other devices need to request the second content data, the first device can be quickly determined, thereby improving the hit rate of the second content data and effectively saving transmission energy consumption.
可选的,所述方法还包括:Optionally, the method further includes:
所述第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device are the same, and there is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identifier of the sixth device is modified to the identifier of the seventh device, and the After adding one to the distance indicated by the second identifier, send the second data message;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述方法还包括:Optionally, the method further includes:
所述第一设备若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,发送所述第二数据报文。If the first device determines that the second content data is stored on the transmission path of the second content data according to the third identifier, it adds one to the distance indicated by the second identifier, and sends the The second data message.
可选的,所述第一设备确定存储所述第二内容数据,包括:Optionally, determining by the first device to store the second content data includes:
所述第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and determines that the identifier of the sixth device is the same as the identifier of the first device If the identifiers are the same, and there is free storage space in the first device, it is determined to store the second content data; or
所述第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device and the target data content exists in the first device, determine to store the second content data, wherein the target data content in the first device is more efficient than the second data content in the The benefit in the first device is small.
第六方面,本申请实施例提供一种报文发送装置,包括;In a sixth aspect, an embodiment of the present application provides a device for sending a message, including:
收发单元用于,接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The transceiver unit is configured to receive a second data message including the second content data sent by the fifth device; the second data message includes a second identifier, a third identifier, and an identifier of the sixth device; the second identifier Indicates the distance between the fifth device and the device storing the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth The device is a device to be stored or has stored the second content data;
处理单元用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The processing unit is configured to, if it is determined to store the second content data, modify the distance indicated by the second identifier to 0, and modify the third identifier to indicate that the second content data is stored in the second The identifier stored on the transmission path of the content data;
存储单元,用于存储所述第二内容数据;a storage unit for storing the second content data;
所述收发单元,用于发送修改后的所述第二数据报文。The transceiver unit is configured to send the modified second data message.
可选的,所述处理单元还用于:Optionally, the processing unit is also used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理单元还用于:Optionally, the processing unit is also used for:
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发单元发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, add one to the distance indicated by the second identifier, and send the The second data message.
可选的,所述处理单元具体用于:Optionally, the processing unit is specifically used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
第七发明,本申请实施例提供一种报文发送装置,包括:In the seventh invention, an embodiment of the present application provides a device for sending a message, including:
收发器用于,接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The transceiver is used to receive a second data message including the second content data sent by the fifth device; the second data message includes the second identifier, the third identifier, and the identifier of the sixth device; the second identifier indicates the distance between the fifth device and the device that stores the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth device is a device to be stored or has stored the second content data;
处理器用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The processor is configured to, if it is determined to store the second content data, modify the distance indicated by the second identification to 0, and modify the third identification to indicate that the second content data is stored in the second content The identifier stored on the transmission path of the data;
存储器,用于存储所述第二内容数据;a memory for storing the second content data;
所述收发器,用于发送修改后的所述第二数据报文。The transceiver is configured to send the modified second data message.
可选的,所述处理器还用于:Optionally, the processor is also used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理器还用于:Optionally, the processor is also used for:
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发器发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, the distance indicated by the second identifier is added by one, and then the transceiver sends the The second data message.
可选的,所述处理器具体用于:Optionally, the processor is specifically used for:
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
第八方面,本申请实施例提供了一种计算机存储介质,用于储存为上述第六方面提供的报文发送装置所用的计算机软件指令,其包含用于执行上述第五方面所设计的程序。In an eighth aspect, an embodiment of the present application provides a computer storage medium for storing computer software instructions used by the message sending apparatus provided in the sixth aspect, including a program for executing the program designed in the fifth aspect.
附图说明Description of drawings
图1为本申请实施例提供的一种报文发送方法流程示意图;1 is a schematic flowchart of a method for sending a message according to an embodiment of the present application;
图2为本申请实施例提供的一种内容请求报文处理方法流程示意图;2 is a schematic flowchart of a method for processing a content request message provided by an embodiment of the present application;
图3为本申请实施例提供的一种内容请求报文处理方法流程示意图;3 is a schematic flowchart of a method for processing a content request message provided by an embodiment of the present application;
图4为本申请实施例提供的一种报文发送示意图;FIG. 4 is a schematic diagram of sending a message according to an embodiment of the present application;
图5为本申请实施例提供的一种报文发送示意图;FIG. 5 is a schematic diagram of sending a message according to an embodiment of the present application;
图6为本申请实施例提供的一种报文发送装置结构示意图;FIG. 6 is a schematic structural diagram of a device for sending a message according to an embodiment of the present application;
图7为本申请实施例提供的一种报文发送装置结构示意图;FIG. 7 is a schematic structural diagram of a device for sending a message according to an embodiment of the present application;
图8为本申请实施例提供的一种报文发送装置结构示意图;FIG. 8 is a schematic structural diagram of a message sending apparatus according to an embodiment of the present application;
图9为本申请实施例提供的一种报文发送装置结构示意图。FIG. 9 is a schematic structural diagram of an apparatus for sending a message according to an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例中,第一设备至第七设备等设备可以单独处理内容请求报文,也可以单独处理数据报文,也可以先处理内容请求报文后处理数据报文,还可以先处理数据报文后处理内容请求报文,在此并不限定处理报文的先后顺序,具体根据实际情况来确定。以下实施例以先处理内容请求报文后处理数据报文为例进行说明,其他情况中,处理报文的方式可以参考下面的描述,在此不再逐一举例说明。In this embodiment of the present application, devices such as the first device to the seventh device may process the content request message independently, or may process the data message independently, or may process the content request message first and then process the data message, or may process the data message first The content request message is processed after the message, and the order of processing the message is not limited here, and is determined according to the actual situation. In the following embodiments, the content request message is processed first and then the data message is processed as an example for description. In other cases, the manner of processing the message can be referred to the following description, which will not be described one by one.
本申请实施例中,终端可以是可以为无线终端,例如可以为移动电话、计算机、平板电脑、个人数码助理(英文:personal digital assistant,缩写:PDA)、移动互联网设备(英文:mobile Internet device,缩写:MID)、可穿戴设备、互联网协议(英文:InternetProtocol,缩写:IP)电话、网络打印机和电子书阅读器(英文:e-book reader)等。In this embodiment of the present application, the terminal may be a wireless terminal, such as a mobile phone, a computer, a tablet computer, a personal digital assistant (English: personal digital assistant, abbreviation: PDA), a mobile Internet device (English: mobile Internet device, Abbreviation: MID), wearable devices, Internet Protocol (English: Internet Protocol, Abbreviation: IP) phones, network printers and e-book readers (English: e-book reader), etc.
本申请实施例中,第一设备以及第二设备等设备可以是指路由器,或者具有路由器功能的设备。In this embodiment of the present application, devices such as the first device and the second device may refer to a router, or a device having a router function.
基于上述描述,如图1所示,为本申请实施例提供的一种报文发送方法流程示意图。Based on the above description, as shown in FIG. 1 , a schematic flowchart of a method for sending a message provided by an embodiment of the present application is shown.
参见图1,该方法包括:Referring to Figure 1, the method includes:
步骤101:第一设备接收第二设备发送的用于请求第一内容数据的内容请求报文;所述内容请求报文中包括第一标识、第一效益、第三设备的标识;所述第三设备为待存储所述第一内容数据的设备,所述第一标识指示所述第三设备中是否存在空闲的存储空间,所述第一效益指示出所述第三设备接收到请求所述第一内容数据的报文的次数。Step 101: The first device receives a content request message sent by the second device for requesting the first content data; the content request message includes the first identifier, the first benefit, and the identifier of the third device; the first The third device is a device to store the first content data, the first identifier indicates whether there is free storage space in the third device, and the first benefit indicates that the third device has received a request for the The number of packets of the first content data.
步骤102:所述第一设备若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备为待存储所述第一内容数据的设备时,将所述内容请求报文中的第一效益修改为所述第二效益、将所述第三设备的标识修改为所述第一设备的标识、将所述第一标识修改为指示所述第一设备中存在空闲的存储空间的标识;所述第二效益指示出所述第一设备接收到请求所述第一内容数据的报文的次数。Step 102: If the first device determines that the first content data does not exist in the first device, when it is determined that the first device is a device to store the first content data, the content data is stored in the first device. The first benefit in the request message is modified to the second benefit, the identifier of the third device is modified to the identifier of the first device, and the first identifier is modified to indicate that the first device exists The identifier of the free storage space; the second benefit indicates the number of times that the first device receives the message requesting the first content data.
步骤103:所述第一设备向第四设备发送修改后的所述内容请求报文。Step 103: The first device sends the modified content request message to the fourth device.
步骤101中,内容请求报文可以是指NDN网络中的interest packet。相应的,本申请实施例中的数据报文可以是指NDN网络中的data packet。In
现有技术中,内容请求报文一般包括三个字段:内容名(content name)、选择器(selector)以及随机数(nonce)。关于上述三个字段的具体内容可以参考现有技术,在此不再详细描述。In the prior art, a content request message generally includes three fields: a content name (content name), a selector (selector), and a nonce (nonce). For the specific content of the above three fields, reference may be made to the prior art, which will not be described in detail here.
相对于现有技术,本申请实施例中,内容请求报文中可以新增三个字段,分别为缓存标识字段、效益字段、设备标识字段。其中,设备标识字段指示了待存储该内容请求报文所请求的内容数据的设备;效益字段用于指示该内容请求报文所请求的内容数据在设备标识字段所指示的设备上的效益;缓存标识字段用于指示设备标识字段所指示的设备是否有空闲的存储空间。Compared with the prior art, in the embodiment of the present application, three fields may be newly added to the content request message, which are a cache identification field, a benefit field, and a device identification field. Wherein, the device identification field indicates the device to store the content data requested by the content request message; the benefit field is used to indicate the benefit of the content data requested by the content request message on the device indicated by the device identification field; cache The identification field is used to indicate whether the device indicated by the device identification field has free storage space.
可选的,本申请实施例中,设备标识字段指示的设备为内容请求报文所请求的内容数据在所述内容请求报文所经过的路径中、内容请求报文所请求的内容数据对应的效益最大的设备。Optionally, in this embodiment of the present application, the device indicated by the device identification field is the content data requested by the content request message in the path traversed by the content request message and the content data requested by the content request message. The most efficient equipment.
本申请实施例中,内容请求报文可以如表1所示,表1中示意了新增三个字段后的内容请求报文。In this embodiment of the present application, the content request message may be as shown in Table 1. Table 1 shows the content request message after adding three fields.
表1Table 1
当然,以上只是示例,内容请求报文还可以有其他形式,在此不再赘述。Of course, the above are just examples, and the content request message may also have other forms, which will not be repeated here.
可选的,本申请实施例中,第一设备还可以把接收到的内容请求报文中设备标识字段、效益字段、缓存标识字段中的内容记录在待定请求表(Pending Interest Table,PIT)中,第一设备从而可以实时确定内容请求报文所请求的内容数据对应的最大效益所对应的设备。Optionally, in this embodiment of the present application, the first device may also record the content in the device identification field, benefit field, and cache identification field in the received content request message in a pending request table (Pending Interest Table, PIT). , so that the first device can determine in real time the device corresponding to the maximum benefit corresponding to the content data requested by the content request message.
结合前面的描述,对于用于请求第一内容数据的内容请求报文,可以用缓存标识字段存储第一标识,用效益字段存储第一效益,用设备标识字段存储第三设备的标识。In combination with the foregoing description, for the content request message for requesting the first content data, the cache identification field may be used to store the first identification, the benefit field may be used to store the first benefit, and the device identification field may be used to store the identification of the third device.
本申请实施例中,缓存标识字段可以为一个布尔标志,举例来说,当布尔标志为TRUE时,表示设备标识字段存储的设备的标识所对应的设备有空闲的存储空间;当布尔标志为FALSE时,表示设备标识字段存储的设备的标识所对应的设备需要删除已存储的数据才能缓存新的数据。In this embodiment of the present application, the cache identification field may be a Boolean flag. For example, when the Boolean flag is TRUE, it indicates that the device corresponding to the device ID stored in the device identification field has free storage space; when the Boolean flag is FALSE , it means that the device corresponding to the device ID stored in the device ID field needs to delete the stored data to cache new data.
可选的,缓存标识字段为布尔标志时,默认设置为FALSE。Optionally, when the cache ID field is a boolean flag, it is set to FALSE by default.
本申请实施例中,针对目标内容数据(目标内容数据为任意一个内容数据),该目标内容数据在任意一个目标设备上的效益BenA可以由以下公式计算:In the embodiment of the present application, for target content data (target content data is any content data), the benefit Ben A of this target content data on any target device can be calculated by the following formula:
BenA=RA×(hA+1)…………………………(1)Ben A =R A ×(h A +1)…………………………(1)
或者, or,
其中,RA为所述目标设备接收到请求所述目标内容数据的报文的次数,hA为所述目标设备与存储所述目标内容数据的设备之间的距离;kA为向所述目标设备发送控制消息的设备的数量,所述控制消息中包括所述目标内容数据在发送所述控制消息的设备中的效益以及发送所述控制消息的设备接收到请求所述目标内容数据的报文的次数;ri为K个设备中第i个设备的接收到请求所述目标内容数据的报文的次数,bmin为所述K个设备中所述目标内容数据的效益最小值,bmax为所述K个设备中所述目标内容数据的效益最大值。Wherein, R A is the number of times that the target device receives the message requesting the target content data, h A is the distance between the target device and the device storing the target content data; k A is the distance between the target device and the device storing the target content data; The number of devices that the target device sends a control message, the control message includes the benefit of the target content data in the device that sends the control message and the device that sends the control message receives a report requesting the target content data. The number of times of the message; ri is the number of times that the i -th device in the K devices receives the message requesting the target content data, b min is the minimum benefit value of the target content data in the K devices, b max is the maximum benefit value of the target content data in the K devices.
计算效益时,可以根据实际情况选择上述公式(1)和公式(2)。举例来说,目标设备是连接终端的接入路由器(Access Router)时,可以根据公式(1)计算每个内容数据在该目标设备上的效益。再举例来说,目标设备是网络中间的核心路由器(Core Router)时,可以根据公式(2)计算每个内容数据在该目标设备上的效益。When calculating the benefit, the above formula (1) and formula (2) can be selected according to the actual situation. For example, when the target device is an access router (Access Router) connecting the terminal, the benefit of each content data on the target device can be calculated according to formula (1). For another example, when the target device is a core router (Core Router) in the middle of the network, the benefit of each content data on the target device can be calculated according to formula (2).
结合前面的描述,本申请实施例中,第一效益以及第二效益均可以按照公式(1)或公式(2)进行计算。举例来说,第二效益满足以下公式:In combination with the foregoing description, in this embodiment of the present application, both the first benefit and the second benefit may be calculated according to formula (1) or formula (2). For example, the second benefit satisfies the following formula:
Ben=R×(h+1);或者 Ben=R×(h+1); or
其中,Ben为所述第二效益,R为所述第一设备接收到请求所述第一内容数据的报文的次数,h为所述第一设备与存储所述第一内容数据的设备之间的距离;K为向所述第一设备发送控制消息的设备的数量,所述控制消息中包括所述第一内容数据在发送所述控制消息的设备中的效益以及发送所述控制消息的设备接收到请求所述第一内容数据的报文的次数;ri为K个设备中第i个设备的接收到请求所述第一内容数据的报文的次数,bmin为所述K个设备中所述第一内容数据的效益最小值,bmax为所述K个设备中所述第一内容数据的效益最大值。Among them, Ben is the second benefit, R is the number of times the first device receives the message requesting the first content data, and h is the difference between the first device and the device storing the first content data The distance between them; K is the number of devices sending control messages to the first device, and the control messages include the benefits of the first content data in the devices sending the control messages and the number of devices sending the control messages. The number of times that the device receives the message requesting the first content data; r i is the number of times that the ith device in the K devices receives the message requesting the first content data, and b min is the K The minimum benefit value of the first content data in the device, and b max is the maximum benefit value of the first content data in the K devices.
步骤102中,第一设备接收到内容请求报文之后,可以先判断第一设备中是否已经存储了所述内容请求报文所请求的第一内容数据,若确定所述第一设备中存在第一内容数据,则生成包括所述第一内容数据的第一数据报文,并向所述第二设备发送所述第一数据报文。相应的,第一设备若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备不是待存储所述第一内容数据的设备时,向所述第四设备转发所述内容请求报文。In
本申请实施例中,第一设备可以在确定满足以下任一条件时,确定第一设备是待存储所述第一内容数据的设备:In this embodiment of the present application, the first device may determine that the first device is a device to store the first content data when it is determined that any of the following conditions are met:
条件一、第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中不存在空闲的存储空间,则确定所述第一设备为待存储所述第一内容数据的设备。Condition 1: There is free storage space in the first device, and it is determined according to the first identifier that there is no free storage space in the third device, then it is determined that the first device is to store the first content data device of.
条件二、第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,则确定所述第一设备为待存储所述第一内容数据的设备。Condition 2: There is free storage space in the first device, and it is determined according to the first identifier that there is free storage space in the third device, and it is determined that the second benefit is greater than the first benefit, then determine that the second benefit is greater than the first benefit. The first device is a device to store the first content data.
条件三、第一设备中不存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,且确定所述第一设备中存在待删除的内容数据,则确定所述第一设备为待存储所述第一内容数据的设备。其中,待删除的内容数据可以为存储时长超过阈值的内容数据,或者在第一设备上的效益小于第二效益的内容数据。Condition 3: There is no free storage space in the first device, and it is determined according to the first identifier that there is free storage space in the third device, and it is determined that the second benefit is greater than the first benefit, and it is determined If there is content data to be deleted in the first device, it is determined that the first device is a device to store the first content data. The content data to be deleted may be content data whose storage duration exceeds a threshold, or content data whose benefit on the first device is less than that of the second benefit.
现有技术中,数据报文一般包括内容名、签名(signature)、签名信息(signatureinformation)以及数据(data)等字段。关于上述字段的具体内容可以参考现有技术,在此不再详细描述。In the prior art, a data packet generally includes fields such as content name, signature (signature), signature information (signature information), and data (data). For the specific content of the above fields, reference may be made to the prior art, which will not be described in detail here.
相对于现有技术,本申请实施例中,数据报文中可以新增三个字段,分别为存储标识字段、距离字段、设备标识字段。设备标识字段用于指示待存储或已经存储了该数据报文中的内容数据的设备;距离字段用于指示当前该数据报文所处的设备至存储该数据报文中的内容数据的设备之间的距离;存储标识字段用于指示该数据报文中的内容数据是否在该数据报文中的内容数据的传输路径上被存储。Compared with the prior art, in the embodiment of the present application, three fields may be newly added to the data message, namely, a storage identification field, a distance field, and a device identification field. The device identification field is used to indicate the device that is to be stored or has stored the content data in the data packet; the distance field is used to indicate the distance between the device where the data packet is currently located and the device that stores the content data in the data packet. The storage identification field is used to indicate whether the content data in the data packet is stored on the transmission path of the content data in the data packet.
可选的,本申请实施例中,存储标识字段可以为一个布尔标志,举例来说,当存储标识字段中的布尔标志为TRUE时,表示数据报文中的内容数据在该数据报文中的内容数据的传输路径上被存储;当存储标识字段中的布尔标志为FALSE时,表示数据报文中的内容数据未在该数据报文中的内容数据的传输路径上被存储。Optionally, in this embodiment of the present application, the storage identification field may be a Boolean flag. For example, when the Boolean flag in the storage identification field is TRUE, it indicates that the content data in the data packet is in the data packet. The content data is stored on the transmission path of the content data; when the Boolean flag in the storage identification field is FALSE, it indicates that the content data in the data packet is not stored on the transmission path of the content data in the data packet.
需要说明的是,本申请实施例中,两个设备之间的距离可以为两个设备之间报文被转发的次数。例如,设备A和设备B相邻,报文从设备A到设备B时被转发了1次,那么设备A到设备B的距离为1。It should be noted that, in this embodiment of the present application, the distance between two devices may be the number of times a packet is forwarded between the two devices. For example, if device A and device B are adjacent, and the packet is forwarded once from device A to device B, the distance from device A to device B is 1.
本申请实施例中,内容请求报文可以如表2所示,表2中示意了新增三个字段后的内容请求报文。In the embodiment of the present application, the content request message may be as shown in Table 2. Table 2 shows the content request message after adding three fields.
表2Table 2
当然,以上只是示例,内容请求报文还可以有其他形式,在此不再赘述。Of course, the above are just examples, and the content request message may also have other forms, which will not be repeated here.
可选的,本申请实施例中,第一设备还可以把接收到的数据报文中设备标识字段、距离字段、存储标识字段中的内容记录在PIT中。Optionally, in this embodiment of the present application, the first device may further record the content in the device identification field, the distance field, and the storage identification field in the received data packet in the PIT.
结合前面的描述,第一设备生成的第一数据报文中,可以将设备标识字段设置为第一设备的标识或者设置为空(NULL);可以将距离字段设置为1;可以通过设置存储标识字段指示第一内容数据已经被存储。In combination with the foregoing description, in the first data message generated by the first device, the device identification field may be set to the identification of the first device or set to NULL; the distance field may be set to 1; the storage identification may be set by setting The field indicates that the first content data has been stored.
举例来说,结合前面的描述,如图2所示,为本申请实施例提供的一种内容请求报文处理方法流程示意图。For example, in combination with the foregoing description, as shown in FIG. 2 , a schematic flowchart of a method for processing a content request message provided by an embodiment of the present application is shown.
图2所示的流程包括:The process shown in Figure 2 includes:
步骤201:第一设备接收到第二设备发送的内容请求报文之后,判断第一设备中是否已经存储了所述内容请求报文所请求的第一内容数据;若是,则转至步骤202,否则转至步骤203。Step 201: After the first device receives the content request message sent by the second device, it determines whether the first device has stored the first content data requested by the content request message; if so, go to step 202, Otherwise, go to step 203 .
其中,所述内容请求报文中包括第一标识、第一效益、第三设备的标识。Wherein, the content request message includes the first identifier, the first benefit, and the identifier of the third device.
需要说明的是,第一设备确定第一设备中已经存储了所述内容请求报文所请求的第一内容数据之后,可以将内容请求报文丢弃。It should be noted that, after determining that the first device has stored the first content data requested by the content request message, the first device may discard the content request message.
步骤202:第一设备生成包括所述第一内容数据的第一数据报文,并向所述第二设备发送所述第一数据报文,转至步骤210。Step 202 : the first device generates a first data packet including the first content data, sends the first data packet to the second device, and goes to step 210 .
步骤203:第一设备检测所述内容请求报文是否已经被PIT记录,若是,则转至步骤204,否则转至步骤205。Step 203: The first device detects whether the content request message has been recorded by the PIT, and if so, goes to step 204, otherwise, goes to step 205.
步骤204:第一设备在PIT中记录第一设备接收所述内容请求报文的端口,以及记录所述内容请求报文中设备标识字段所指示的设备的标识,然后将所述内容请求报文丢弃,并转至步骤210。Step 204: The first device records in the PIT the port at which the first device receives the content request message, and records the identifier of the device indicated by the device ID field in the content request message, and then records the content request message Discard, and go to step 210.
步骤205:第一设备在PIT中新建一个对应所述内容请求报文的表项,并判断所述第一设备是否存在空闲的存储空间,若是则转至步骤206,否则转至步骤207。Step 205 : The first device creates a new entry in the PIT corresponding to the content request message, and determines whether the first device has free storage space, if so, go to step 206 , otherwise go to step 207 .
步骤206:第一设备若确定满足以下任一条件,则将所述内容请求报文中的第一标识修改为指示所述第一设备中存在空闲的存储空间的标识,并转至步骤208;否则转至步骤209:Step 206: If the first device determines that any of the following conditions are met, the first identifier in the content request message is modified to an identifier indicating that there is free storage space in the first device, and the process goes to step 208; Otherwise go to step 209:
根据所述内容请求报文中的第一标识确定所述第三设备中不存在空闲的存储空间,或者根据所述第一标识确定所述第三设备中存在空闲的存储空间、且确定所述内容请求报文所请求的第一数据内容在第一设备上的第二效益大于所述第一数据内容在所述内容请求报文中的第一效益。It is determined according to the first identifier in the content request message that there is no free storage space in the third device, or it is determined according to the first identifier that there is free storage space in the third device, and the The second benefit of the first data content requested in the content request message on the first device is greater than the first benefit of the first data content in the content request message.
步骤207:第一设备若确定满足以下条件,若是则转至步骤208,否则转至步骤209:Step 207: If the first device determines that the following conditions are met, if so, go to
第一设备若根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,且确定所述第一设备中存在待删除的内容数据。If the first device determines that there is free storage space in the third device according to the first identifier, and determines that the second benefit is greater than the first benefit, and determines that there is content to be deleted in the first device data.
步骤208:第一设备将所述内容请求报文中的第一效益修改为所述第二效益、将所述第三设备的标识修改为所述第一设备的标识,并转至步骤209。Step 208 : the first device modifies the first benefit in the content request message to the second benefit, modifies the identifier of the third device to the identifier of the first device, and goes to step 209 .
步骤209:第一设备查找前向转发表(forwarding information base,FIB),确定第四设备,并向第四设备发送修改后的所述内容请求报文。Step 209: The first device searches for a forwarding information base (FIB), determines the fourth device, and sends the modified content request message to the fourth device.
步骤210:结束。Step 210: End.
本申请实施例中,第一设备还会接收到其它设备发送的数据报文,下面描述第一设备如何处理数据报文。In this embodiment of the present application, the first device will also receive data packets sent by other devices. The following describes how the first device processes the data packets.
第一设备接收到第五设备发送的包括第二内容数据的第二数据报文之后,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;所述第一设备存储所述第二内容数据,并发送修改后的所述第二数据报文。After the first device receives the second data packet including the second content data sent by the fifth device, if it is determined to store the second content data, it modifies the distance indicated by the second identifier to 0, and changes the distance indicated by the second identifier to 0. The third identifier is modified to be an identifier indicating that the second content data is stored on the transmission path of the second content data; the first device stores the second content data, and sends the modified first Two data packets.
其中,所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备。Wherein, the second data message includes a second identification, a third identification, and an identification of the sixth device; the second identification indicates the distance between the fifth device and the device storing the second content data; The third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth device is a device that is to be stored or has stored the second content data.
所述第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文。待删除的内容数据可以为存储时长超过阈值的内容数据,或者在第一设备上的效益小于第二内容数据在所述第一设备上的效益的内容数据。If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device are the same, and there is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identifier of the sixth device is modified to the identifier of the seventh device, and the After adding one to the distance indicated by the second identifier, the second data packet is sent. The content data to be deleted may be content data whose storage duration exceeds a threshold, or content data whose benefit on the first device is less than that of the second content data on the first device.
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,第一设备若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,发送所述第二数据报文。Optionally, if the first device determines that the second content data is stored on the transmission path of the second content data according to the third identifier, the first device adds one to the distance indicated by the second identifier, and sends the data. the second data message.
本申请实施例中,第一设备若确定满足以下任一条件,则确定存储所述第二内容数据:In this embodiment of the present application, the first device determines to store the second content data if it determines that any of the following conditions are met:
条件一、第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据。Condition 1. If the first device determines that the second content data is not stored on the transmission path of the second content data according to the third identifier, and determines that the identifier of the sixth device is related to the first device The identifiers are the same, and there is free storage space in the first device, then it is determined to store the second content data.
条件二、第一设备若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。Condition 2: If the first device determines according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as that of the first device. If the identifiers are the same, and the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefits in the first device described above are small.
举例来说,,结合前面的描述,如图3所示,为本申请实施例提供的一种内容请求报文处理方法流程示意图。For example, with reference to the foregoing description, as shown in FIG. 3 , a schematic flowchart of a method for processing a content request message provided by an embodiment of the present application is shown.
图3所示的流程包括:The process shown in Figure 3 includes:
步骤301:第一设备接收到第二数据报文之后,若确定第二数据报文中的第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,则转至步骤302,否则转至步骤305。Step 301: After the first device receives the second data packet, if it is determined that the third identifier in the second data packet determines that the second content data is not stored on the transmission path of the second content data, and If it is determined that the identification of the sixth device is the same as the identification of the first device, go to step 302 , otherwise go to step 305 .
其中,所述第二数据报文中还包括第三标识、第六设备的标识。Wherein, the second data message further includes the third identifier and the identifier of the sixth device.
步骤302:第一设备若确定满足以下任一条件,若是,则转至步骤303,否则转至步骤304:Step 302: If the first device determines that any of the following conditions are met, if yes, go to
1、第一设备中存在待删除的内容数据;1. There is content data to be deleted in the first device;
2、第一设备中存在空闲的存储空间。2. There is free storage space in the first device.
步骤303:第一设备确定存储第二内容数据,并将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识,转至步骤306。Step 303: The first device determines to store the second content data, modifies the distance indicated by the second identifier to 0, and modifies the third identifier to indicate that the second content data is within the second content data The identifier stored on the transmission path of the , go to step 306 .
步骤304:第一设备确定从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备为第七设备,并将所述第六设备的标识修改为第七设备的标识,转至步骤305。Step 304: The first device determines that the device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device is the seventh device, and assigns the The identifier of the sixth device is modified to the identifier of the seventh device, and the process goes to step 305 .
步骤305:第一设备将第二标识指示的距离加一后,转至步骤306。Step 305 : After the first device adds one to the distance indicated by the second identifier, go to step 306 .
步骤306:第一设备发送修改后的第二数据报文。Step 306: The first device sends the modified second data packet.
下面的实施例中,缓存标识字段为一个布尔标志,当布尔标志为TRUE时,表示设备标识字段存储的设备的标识所对应的设备有空闲的存储空间;当布尔标志为FALSE时,表示设备标识字段存储的设备的标识所对应的设备需要删除已存储的数据才能缓存新的数据。存储标识字段为一个布尔标志,当存储标识字段中的布尔标志为TRUE时,表示数据报文中的内容数据在该数据报文中的内容数据的传输路径上被存储;当存储标识字段中的布尔标志为FALSE时,表示数据报文中的内容数据未在该数据报文中的内容数据的传输路径上被存储。其他情况可以参考下面的描述,在此不再赘述。In the following embodiment, the cache identification field is a Boolean mark. When the Boolean mark is TRUE, it means that the device corresponding to the identification of the device stored in the device identification field has free storage space; when the Boolean mark is FALSE, it means that the device identification The device corresponding to the device identifier stored in the field needs to delete the stored data to cache new data. The storage identification field is a Boolean flag. When the Boolean flag in the storage identification field is TRUE, it indicates that the content data in the data packet is stored on the transmission path of the content data in the data packet; When the Boolean flag is FALSE, it indicates that the content data in the data packet is not stored on the transmission path of the content data in the data packet. For other cases, reference may be made to the following description, which will not be repeated here.
如图4所示,为本申请实施例提供的一种报文发送示意图。As shown in FIG. 4 , it is a schematic diagram of sending a message according to an embodiment of the present application.
图4中,内容请求设备发送目标内容请求报文,目标内容请求报文从设备R1、设备R2、设备R3传递至目标内容请求报文所请求的目标内容数据的源设备。在内容请求设备发送目标内容请求报文之前,设备R3中存储目标内容数据,且设备R1、设备R2都具体空闲的存储空间。In FIG. 4 , the content requesting device sends a target content request message, and the target content request message is transmitted from the device R1 , the device R2 , and the device R3 to the source device of the target content data requested by the target content request message. Before the content requesting device sends the target content request message, the device R3 stores the target content data, and both the device R1 and the device R2 have specific free storage space.
若目标内容数据在设备R1、设备R2、设备R3上的效益分别为10、21、15。那么目标内容请求报文从设备R1发送出去时,目标内容请求报文中缓存标识字段、效益字段、设备标识字段分别为:TRUE、10、设备R1的标识;目标内容请求报文从设备R2发送出去时,目标内容请求报文中缓存标识字段、效益字段、设备标识字段分别为:TRUE、21、设备R2的标识;目标内容请求报文从设备R1发送出去时,目标内容请求报文中缓存标识字段、效益字段、设备标识字段分别为:TRUE、21、设备R2的标识。If the benefits of the target content data on the device R1, the device R2, and the device R3 are 10, 21, and 15, respectively. Then, when the target content request message is sent from device R1, the cache ID field, benefit field, and device ID field in the target content request message are: TRUE, 10, and the ID of device R1; the target content request message is sent from device R2. When going out, the cache ID field, benefit field, and device ID field in the target content request message are: TRUE, 21, and the ID of device R2; when the target content request message is sent from device R1, the cache ID field in the target content request message is cached. The identification field, the benefit field, and the equipment identification field are respectively: TRUE, 21, and the identification of the equipment R2.
设备R3接收到目标内容请求报文之后,根据目标内容请求报文中的设备标识字段,确定设备R2为待存储目标内容数据的设备,则生成包括目标内容数据的目标数据报文,设备R3生成的目标数据报文中的存储标识字段为FALSE、距离字段为1、设备标识字段为设备R2的标识。随后,设备R3向设备R2发送目标数据报文,并将存储的目标内容数据删除。After receiving the target content request message, the device R3 determines that the device R2 is the device to store the target content data according to the device identification field in the target content request message, then generates a target data message including the target content data, and the device R3 generates The storage identification field in the target data message is FALSE, the distance field is 1, and the device identification field is the identification of the device R2. Subsequently, the device R3 sends the target data message to the device R2, and deletes the stored target content data.
设备R2接收到目标数据报文之后,根据目标数据报文中的存储标识字段、距离字段、设备标识字段,确定需要在设备R2上存储目标内容数据。此时,设备R2将目标内容数据存储,并将目标数据报文中的存储标识字段修改为TRUE、距离字段修改为0后,转发修改后的目标数据报文至设备R1。After receiving the target data packet, the device R2 determines that the target content data needs to be stored on the device R2 according to the storage identification field, the distance field, and the device identification field in the target data packet. At this time, the device R2 stores the target content data, modifies the storage identification field in the target data message to TRUE, and modifies the distance field to 0, and then forwards the modified target data message to the device R1.
通过上述方法,实现了将目标内容数据存储至效益最大的设备,使得目标没人数据更容易被目标内容请求报文命中,提高数据传输效率。Through the above method, the target content data is stored in the device with the greatest benefit, so that the target unattended data is more likely to be hit by the target content request message, and the data transmission efficiency is improved.
如图5所示,为本申请实施例提供的一种报文发送示意图。As shown in FIG. 5 , it is a schematic diagram of sending a message according to an embodiment of the present application.
内容请求设备发送目标内容请求报文,目标内容请求报文从设备R1、设备R2、设备R3、设备R4、设备R5传递至目标内容请求报文所请求的目标内容数据的源设备。在上述过程中,计算出的目标数据内容分别在设备R1、设备R2、设备R3、设备R4、设备R5上的效益分别为:10、15、11、20、8。The content requesting device sends a target content request message, and the target content request message is transmitted from device R1, device R2, device R3, device R4, and device R5 to the source device of the target content data requested by the target content request message. In the above process, the calculated benefits of target data content on equipment R1, equipment R2, equipment R3, equipment R4, and equipment R5 are: 10, 15, 11, 20, and 8, respectively.
此时,设备R5接收到目标内容请求报文后,目标内容请求报文的设备标识字段指示的是设备R4的设备标识。At this time, after the device R5 receives the target content request message, the device identifier field of the target content request message indicates the device identifier of the device R4.
当包括目标内容数据的目标数据报文到达设备R4之后,设备R4若确定不能存储目标内容数据,则设备R4将目标数据报文中的设备标识字段设置为设备R1、设备R2、设备R3中目标数据报文对应的效益最高的设备的设备标识,即设备R2的标识。通过上述流程,实现增量式缓存内容数据。After the target data message including the target content data arrives at the device R4, if the device R4 determines that the target content data cannot be stored, the device R4 sets the device identification field in the target data message to the target in the device R1, device R2, and device R3. The device identifier of the device with the highest benefit corresponding to the data packet, that is, the identifier of the device R2. Through the above process, incremental caching of content data is implemented.
基于相同的技术构思,本申请实施例还提供一种报文发送装置,该装置可执行上述方法实施例。Based on the same technical concept, an embodiment of the present application further provides an apparatus for sending a message, and the apparatus can execute the foregoing method embodiments.
如图6所示,为本申请实施例提供一种报文发送装置结构示意图。As shown in FIG. 6 , a schematic structural diagram of an apparatus for sending a message is provided in an embodiment of the present application.
参见图6,该装置包括:Referring to Figure 6, the device includes:
收发单元601,用于接收第二设备发送的用于请求第一内容数据的内容请求报文;所述内容请求报文中包括第一标识、第一效益、第三设备的标识;所述第三设备为待存储所述第一内容数据的设备,所述第一标识指示所述第三设备中是否存在空闲的存储空间,所述第一效益指示出所述第三设备接收到请求所述第一内容数据的报文的次数;A
处理单元602,用于若确定第一设备中不存在所述第一内容数据,则在确定所述第一设备为待存储所述第一内容数据的设备时,将所述内容请求报文中的第一效益修改为所述第二效益、将所述第三设备的标识修改为所述第一设备的标识、将所述第一标识修改为指示所述第一设备中存在空闲的存储空间的标识;所述第二效益指示出所述第一设备接收到请求所述第一内容数据的报文的次数;The
所述收发单元601,用于向第四设备发送修改后的所述内容请求报文。The
可选的,所述处理单元602还用于:Optionally, the
若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备不是待存储所述第一内容数据的设备时,通过所述收发单元601向所述第四设备转发所述内容请求报文。If it is determined that the first content data does not exist in the first device, when it is determined that the first device is not a device to store the first content data, the sending and receiving
可选的,所述处理单元602具体用于:Optionally, the
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中不存在空闲的存储空间,则确定所述第一设备为待存储所述第一内容数据的设备;或者It is determined that there is free storage space in the first device, and according to the first identifier, it is determined that there is no free storage space in the third device, then it is determined that the first device is a device to store the first content data ;or
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,则确定所述第一设备为待存储所述第一内容数据的设备;或者Determining that there is free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, and determining that the second benefit is greater than the first benefit, then determining that the first benefit is greater than the first benefit. A device is a device to store the first content data; or
确定第一设备中不存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,且确定所述第一设备中存在待删除的内容数据,则确定所述第一设备为待存储所述第一内容数据的设备。determining that there is no free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, determining that the second benefit is greater than the first benefit, and determining that the If there is content data to be deleted in the first device, it is determined that the first device is a device to store the first content data.
可选的,所述第二效益满足以下公式:Optionally, the second benefit satisfies the following formula:
Ben=R×(h+1);或者Ben=R×(h+1); or
其中,Ben为所述第二效益,R为所述第一设备接收到请求所述第一内容数据的报文的次数,h为所述第一设备与存储所述第一内容数据的设备之间的距离;K为向所述第一设备发送控制消息的设备的数量,所述控制消息中包括所述第一内容数据在发送所述控制消息的设备中的效益以及发送所述控制消息的设备接收到请求所述第一内容数据的报文的次数;ri为K个设备中第i个设备的接收到请求所述第一内容数据的报文的次数,bmin为所述K个设备中所述第一内容数据的效益最小值,bmax为所述K个设备中所述第一内容数据的效益最大值。Among them, Ben is the second benefit, R is the number of times the first device receives the message requesting the first content data, and h is the difference between the first device and the device storing the first content data The distance between them; K is the number of devices sending control messages to the first device, and the control messages include the benefits of the first content data in the devices sending the control messages and the number of devices sending the control messages. The number of times that the device receives the message requesting the first content data; r i is the number of times that the ith device in the K devices receives the message requesting the first content data, and b min is the K The minimum benefit value of the first content data in the device, and b max is the maximum benefit value of the first content data in the K devices.
可选的,所述处理单元602还用于:Optionally, the
若确定所述第一设备中存在所述第一内容数据,则生成包括所述第一内容数据的第一数据报文,并通过所述收发单元601向所述第二设备发送所述第一数据报文。If it is determined that the first content data exists in the first device, a first data packet including the first content data is generated, and the first data packet is sent to the second device through the
可选的,所述装置还包括存储单元603;Optionally, the device further includes a
所述收发单元601还用于:The
接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The receiving fifth device sends a second data message including the second content data; the second data message includes a second identifier, a third identifier, and an identifier of the sixth device; the second identifier indicates the fifth the distance between the device and the device that stores the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth device is to be stored or a device that has stored the second content data;
所述处理单元602还用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The
所述存储单元603,用于存储所述第二内容数据;the
所述收发单元601,用于发送修改后的所述第二数据报文。The
可选的,所述处理单元602还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理单元602还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发单元601发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, after adding one to the distance indicated by the second identifier, the sending and receiving
可选的,所述处理单元602具体用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
基于相同的技术构思,本申请实施例还提供一种报文发送装置,该装置可执行上述方法实施例。Based on the same technical concept, an embodiment of the present application further provides an apparatus for sending a message, and the apparatus can execute the foregoing method embodiments.
如图7所示,为本申请实施例提供一种报文发送装置结构示意图。As shown in FIG. 7 , a schematic structural diagram of an apparatus for sending a message is provided in an embodiment of the present application.
参见图7,该装置包括:处理器701、收发器702、存储器703。Referring to FIG. 7 , the apparatus includes: a
收发器702,用于接收第二设备发送的用于请求第一内容数据的内容请求报文;所述内容请求报文中包括第一标识、第一效益、第三设备的标识;所述第三设备为待存储所述第一内容数据的设备,所述第一标识指示所述第三设备中是否存在空闲的存储空间,所述第一效益指示出所述第三设备接收到请求所述第一内容数据的报文的次数;A
处理器701,用于若确定第一设备中不存在所述第一内容数据,则在确定所述第一设备为待存储所述第一内容数据的设备时,将所述内容请求报文中的第一效益修改为所述第二效益、将所述第三设备的标识修改为所述第一设备的标识、将所述第一标识修改为指示所述第一设备中存在空闲的存储空间的标识;所述第二效益指示出所述第一设备接收到请求所述第一内容数据的报文的次数;The
所述收发器702,用于向第四设备发送修改后的所述内容请求报文。The
可选的,所述处理器701还用于:Optionally, the
若确定所述第一设备中不存在所述第一内容数据,则在确定所述第一设备不是待存储所述第一内容数据的设备时,通过所述收发器702向所述第四设备转发所述内容请求报文。If it is determined that the first content data does not exist in the first device, when it is determined that the first device is not a device to store the first content data, the
可选的,所述处理器701具体用于:Optionally, the
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中不存在空闲的存储空间,则确定所述第一设备为待存储所述第一内容数据的设备;或者It is determined that there is free storage space in the first device, and according to the first identifier, it is determined that there is no free storage space in the third device, then it is determined that the first device is a device to store the first content data ;or
确定第一设备中存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,则确定所述第一设备为待存储所述第一内容数据的设备;或者Determining that there is free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, and determining that the second benefit is greater than the first benefit, then determining the first benefit A device is a device to store the first content data; or
确定第一设备中不存在空闲的存储空间,且根据所述第一标识确定所述第三设备中存在空闲的存储空间,且确定所述第二效益大于所述第一效益,且确定所述第一设备中存在待删除的内容数据,则确定所述第一设备为待存储所述第一内容数据的设备。determining that there is no free storage space in the first device, and determining that there is free storage space in the third device according to the first identifier, determining that the second benefit is greater than the first benefit, and determining that the If there is content data to be deleted in the first device, it is determined that the first device is a device to store the first content data.
可选的,所述第二效益满足以下公式:Optionally, the second benefit satisfies the following formula:
Ben=R×(h+1);或者Ben=R×(h+1); or
其中,Ben为所述第二效益,R为所述第一设备接收到请求所述第一内容数据的报文的次数,h为所述第一设备与存储所述第一内容数据的设备之间的距离;K为向所述第一设备发送控制消息的设备的数量,所述控制消息中包括所述第一内容数据在发送所述控制消息的设备中的效益以及发送所述控制消息的设备接收到请求所述第一内容数据的报文的次数;ri为K个设备中第i个设备的接收到请求所述第一内容数据的报文的次数,bmin为所述K个设备中所述第一内容数据的效益最小值,bmax为所述K个设备中所述第一内容数据的效益最大值。Among them, Ben is the second benefit, R is the number of times the first device receives the message requesting the first content data, and h is the difference between the first device and the device storing the first content data The distance between them; K is the number of devices sending control messages to the first device, and the control messages include the benefits of the first content data in the devices sending the control messages and the number of devices sending the control messages. The number of times that the device receives the message requesting the first content data; r i is the number of times that the ith device in the K devices receives the message requesting the first content data, and b min is the K The minimum benefit value of the first content data in the device, and b max is the maximum benefit value of the first content data in the K devices.
可选的,所述处理器701还用于:Optionally, the
若确定所述第一设备中存在所述第一内容数据,则生成包括所述第一内容数据的第一数据报文,并通过所述收发器702向所述第二设备发送所述第一数据报文。If it is determined that the first content data exists in the first device, a first data packet including the first content data is generated, and the first data packet is sent to the second device through the
可选的,所述收发器702还用于:Optionally, the
接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The receiving fifth device sends a second data message including the second content data; the second data message includes a second identifier, a third identifier, and an identifier of the sixth device; the second identifier indicates the fifth the distance between the device and the device that stores the second content data; the third identifier indicates whether the second content data is stored on the transmission path of the second content data; the sixth device is to be stored or a device that has stored the second content data;
所述处理器701还用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The
所述存储器703,用于存储所述第二内容数据;the
所述收发器702,用于发送修改后的所述第二数据报文。The
可选的,所述处理器701还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理器701还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发器702发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, after adding one to the distance indicated by the second identifier, the
可选的,所述处理器701具体用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
基于相同的技术构思,本申请实施例还提供一种报文发送装置,该装置可执行上述方法实施例。Based on the same technical concept, an embodiment of the present application further provides an apparatus for sending a message, and the apparatus can execute the foregoing method embodiments.
如图8所示,为本申请实施例提供一种报文发送装置结构示意图。As shown in FIG. 8 , a schematic structural diagram of an apparatus for sending a message is provided in an embodiment of the present application.
收发单元801用于,接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The
处理单元802用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The
存储单元803,用于存储所述第二内容数据;a
所述收发单元801,用于发送修改后的所述第二数据报文。The
可选的,所述处理单元802还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理单元802还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发单元发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, add one to the distance indicated by the second identifier, and send the The second data message.
可选的,所述处理单元802具体用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
基于相同的技术构思,本申请实施例还提供一种报文发送装置,该装置可执行上述方法实施例。Based on the same technical concept, an embodiment of the present application further provides an apparatus for sending a message, and the apparatus can execute the foregoing method embodiments.
如图9所示,为本申请实施例提供一种报文发送装置结构示意图。As shown in FIG. 9 , a schematic structural diagram of an apparatus for sending a message is provided in an embodiment of the present application.
该装置包括:处理器901、收发器902、存储器903。The apparatus includes: a
收发器902用于,接收第五设备发送包括第二内容数据的第二数据报文;所述第二数据报文中包括第二标识、第三标识、第六设备的标识;所述第二标识指示所述第五设备与存储所述第二内容数据的设备的距离;所述第三标识指示所述第二内容数据是否在所述第二内容数据的传输路径上被存储;所述第六设备为待存储或已经存储所述第二内容数据的设备;The
处理器901用于,若确定存储所述第二内容数据,则将所述第二标识指示的距离修改为0,并将所述第三标识修改为指示所述第二内容数据在所述第二内容数据的传输路径上被存储的标识;The
存储器903,用于存储所述第二内容数据;a
所述收发器902,用于发送修改后的所述第二数据报文。The
可选的,所述处理器901还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中不存在空闲的存储空间,且所述第一设备中不存在待删除的数据内容,则将所述第六设备的标识修改为第七设备的标识,并将所述第二标识指示的距离加一后,发送所述第二数据报文;If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the There is no free storage space in the first device, and there is no data content to be deleted in the first device, then the identification of the sixth device is modified to the identification of the seventh device, and the second identification After adding one to the indicated distance, send the second data packet;
其中,所述第七设备为从请求所述第二内容数据的设备至所述第一设备之间的传输路径上、所述第二内容数据对应的效益最大的设备。The seventh device is a device with the greatest benefit corresponding to the second content data on the transmission path from the device requesting the second content data to the first device.
可选的,所述处理器901还用于:Optionally, the
若根据所述第三标识确定所述第二内容数据在所述第二内容数据的传输路径上被存储,则将所述第二标识指示的距离加一后,通过所述收发器702发送所述第二数据报文。If it is determined according to the third identifier that the second content data is stored on the transmission path of the second content data, after adding one to the distance indicated by the second identifier, the
可选的,所述处理器901具体用于:Optionally, the
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且确定所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在空闲的存储空间,则确定存储所述第二内容数据;或者If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and it is determined that the identifier of the sixth device is the same as the identifier of the first device, and the If there is free storage space in the first device, it is determined to store the second content data; or
若根据所述第三标识确定所述第二内容数据未在所述第二内容数据的传输路径上被存储,且所述第六设备的标识与所述第一设备的标识相同,且所述第一设备中存在目标数据内容,则确定存储所述第二内容数据,其中所述目标数据内容在所述第一设备中的的效益比所述第二数据内容在所述第一设备中的的效益小。If it is determined according to the third identifier that the second content data is not stored on the transmission path of the second content data, and the identifier of the sixth device is the same as the identifier of the first device, and the If the target data content exists in the first device, it is determined to store the second content data, wherein the benefit of the target data content in the first device is higher than that of the second data content in the first device. The benefit is small.
本申请实施例中,收发器可以是有线收发器,无线收发器或其组合。有线收发器例如可以为以太网接口。以太网接口可以是光接口,电接口或其组合。无线收发器例如可以为无线局域网收发器,蜂窝网络收发器或其组合。处理器可以是中央处理器(英文:centralprocessing unit,缩写:CPU),网络处理器(英文:network processor,缩写:NP)或者CPU和NP的组合。处理器1501还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic arraylogic,缩写:GAL)或其任意组合。存储器1502可以包括易失性存储器(英文:volatilememory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器1502也可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-onlymemory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器还可以包括上述种类的存储器的组合。In this embodiment of the present application, the transceiver may be a wired transceiver, a wireless transceiver, or a combination thereof. The wired transceiver may be, for example, an Ethernet interface. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. The wireless transceiver may be, for example, a wireless local area network transceiver, a cellular network transceiver, or a combination thereof. The processor may be a central processing unit (English: central processing unit, abbreviation: CPU), a network processor (English: network processor, abbreviation: NP) or a combination of CPU and NP. The processor 1501 may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviation: ASIC), a programmable logic device (English: programmable logic device, abbreviation: PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), a field programmable gate array (English: field-programmable gate array, abbreviation: FPGA), a general array logic (English: generic arraylogic , abbreviation: GAL) or any combination thereof. The memory 1502 may include a volatile memory (English: volatile memory), such as random-access memory (English: random-access memory, abbreviation: RAM); the memory 1502 may also include a non-volatile memory (English: non-volatile memory) , such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid-state hard disk (English: solid-state drive, Abbreviation: SSD); the memory may also comprise a combination of the above-mentioned kinds of memory.
其中,图7和图9中还可以包括总线接口,总线接口可以包括任意数量的互联的总线和桥,具体由处理器代表的一个或多个处理器和存储器代表的存储器的各种电路链接在一起。总线接口还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。7 and 9 may also include a bus interface, and the bus interface may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor and various circuits of the memory represented by the memory are linked in the Together. The bus interface may also link together various other circuits, such as peripherals, voltage regulators, and power management circuits, which are well known in the art and, therefore, will not be described further herein.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的范围。这样,倘若本申请的这些修改和变型属于本申请权利要求的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, provided that these modifications and variations of the present application fall within the scope of the claims of the present application, the present application is also intended to include these modifications and variations.
Claims (18)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611140448.9A CN108449277B (en) | 2016-12-12 | 2016-12-12 | Method and device for sending message |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611140448.9A CN108449277B (en) | 2016-12-12 | 2016-12-12 | Method and device for sending message |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108449277A CN108449277A (en) | 2018-08-24 |
CN108449277B true CN108449277B (en) | 2020-07-24 |
Family
ID=63190454
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611140448.9A Active CN108449277B (en) | 2016-12-12 | 2016-12-12 | Method and device for sending message |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108449277B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103649901A (en) * | 2013-07-26 | 2014-03-19 | 华为技术有限公司 | Data transmission method, data receiving method and sotring equipment |
CN104754687A (en) * | 2013-12-31 | 2015-07-01 | 华为技术有限公司 | Information sending method and device |
CN105099944A (en) * | 2014-04-22 | 2015-11-25 | 华为技术有限公司 | Data caching method and forwarding device |
CN106533733A (en) * | 2016-08-30 | 2017-03-22 | 中国科学院信息工程研究所 | CCN collaborative cache method and device based on network clustering and Hash routing |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160110466A1 (en) * | 2014-10-16 | 2016-04-21 | Palo Alto Research Center Incorporated | System and method for ranking named-data networking objects in a cache |
-
2016
- 2016-12-12 CN CN201611140448.9A patent/CN108449277B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103649901A (en) * | 2013-07-26 | 2014-03-19 | 华为技术有限公司 | Data transmission method, data receiving method and sotring equipment |
CN104754687A (en) * | 2013-12-31 | 2015-07-01 | 华为技术有限公司 | Information sending method and device |
CN105099944A (en) * | 2014-04-22 | 2015-11-25 | 华为技术有限公司 | Data caching method and forwarding device |
CN106533733A (en) * | 2016-08-30 | 2017-03-22 | 中国科学院信息工程研究所 | CCN collaborative cache method and device based on network clustering and Hash routing |
Non-Patent Citations (1)
Title |
---|
"Tube Caching: An Effective Caching Scheme in Content-Centric Networking";Hao Wu等;《IEEE》;20160621;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN108449277A (en) | 2018-08-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108696895B (en) | Resource acquisition method, device and system | |
KR102160494B1 (en) | Network nodes, endpoint nodes, and how to receive messages of interest | |
WO2019007226A1 (en) | Method and device for establishing session | |
CN104348722B (en) | Determine content obtaining path, the methods, devices and systems of request processing | |
CN104580107B (en) | malicious attack detection method and controller | |
CN108259328B (en) | Message forwarding method and device | |
WO2016197689A1 (en) | Method, apparatus and system for processing packet | |
WO2018184487A1 (en) | Bier message forwarding method and device | |
CN116032861B (en) | A message processing method and device | |
CN103873464B (en) | Message processing method and forwarding equipment | |
CN104869062B (en) | A kind of data packet forwarding method and equipment | |
CN108259348B (en) | A message transmission method and device | |
CN112995053A (en) | Method and device for sending message | |
CN107180118A (en) | A kind of file system cache data managing method and device | |
CN115278775A (en) | Reflective QoS control method, UPF entity, communication system and storage medium | |
CN104252423B (en) | Consistency processing method and device based on multi-core processor | |
CN108449277B (en) | Method and device for sending message | |
CN103973747A (en) | Method and device for acquiring content | |
US11063863B2 (en) | Systems and methods for transmitting and receiving interest messages | |
WO2015165270A1 (en) | Data packet processing method and device | |
CN106341775B (en) | A kind of data transmission method and device | |
CN112165505A (en) | Decentralized data processing method, electronic device and storage medium | |
CN109005115B (en) | A kind of intelligent topology method and device of distributed sensor network | |
CN106357688A (en) | Method and device for defending Internet Control Message Protocol (ICMP) flood attack | |
CN107332773A (en) | A kind of method and PTN device for learning ARP |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |