CN106507224B - Method and related device for acquiring target file - Google Patents
Method and related device for acquiring target file Download PDFInfo
- Publication number
- CN106507224B CN106507224B CN201510568118.9A CN201510568118A CN106507224B CN 106507224 B CN106507224 B CN 106507224B CN 201510568118 A CN201510568118 A CN 201510568118A CN 106507224 B CN106507224 B CN 106507224B
- Authority
- CN
- China
- Prior art keywords
- identification information
- onu
- request message
- target file
- olt
- 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
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000003860 storage Methods 0.000 claims abstract description 138
- 230000004044 response Effects 0.000 claims abstract description 60
- 230000003287 optical effect Effects 0.000 claims description 21
- 238000013468 resource allocation Methods 0.000 claims description 12
- 238000004904 shortening Methods 0.000 abstract description 6
- 238000010586 diagram Methods 0.000 description 18
- 238000004590 computer program Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000006854 communication Effects 0.000 description 5
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 230000008569 process Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
Images
Landscapes
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例公开了一种获取目标文件的方法及相关装置。本发明实施例中,OLT接收ONU发送的获取请求消息;所述获取请求消息中包括所述目标文件的标识信息;所述OLT根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件,并向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。本发明实施例中在OLT增设存储空间,若该存储空间中存储有目标文件,则OLT可将目标文件直接返回给用户,无需通过访问网络来获取,从而有效缩短了访问路径,明显提高了访问效率。
The embodiment of the present invention discloses a method and a related device for acquiring a target file. In the embodiment of the present invention, the OLT receives the acquisition request message sent by the ONU; the acquisition request message includes the identification information of the target file; the OLT retrieves the information from the storage space of the OLT according to the identification information of the target file Obtain the target file, and send a request response message to the ONU; the request response message includes the target file. In the embodiment of the present invention, a storage space is added to the OLT. If a target file is stored in the storage space, the OLT can directly return the target file to the user without accessing the network to obtain it, thereby effectively shortening the access path and significantly improving the access efficiency.
Description
技术领域technical field
本发明涉及通信技术领域,尤其涉及一种获取目标文件的方法及相关装置。The present invention relates to the field of communication technologies, and in particular, to a method for acquiring a target file and a related device.
背景技术Background technique
网盘是一种网络存储系统,能够提供在线存储、访问、备份、共享等资源管理的服务,即可以将网盘看成一个放在网络上的硬盘或U盘。用户在网盘中申请自己的网盘账号后,不管身处何地,都可以通过联网登陆访问或管理存储在自己的网盘账号中的资源。A network disk is a network storage system that can provide online storage, access, backup, sharing and other resource management services, that is, a network disk can be regarded as a hard disk or U disk placed on the network. After users apply for their own online storage account in the online storage, no matter where they are, they can access or manage the resources stored in their online storage account through online login.
现有技术中,以百度云网盘为例,用户访问互联网上的视频文件后,主动将文件缓存在百度公司提供个人的云空间中。实际上,用户的云空间存储于百度公司的IDC机房服务器中。用户需要再次访问该文件时,获取该文件的路径为:通过用户设备发起访问请求,经过路由器以及运营商提供的光纤线路后,到达百度公司的机房服务器,进而在百度公司的机房服务器中获取到所需的文件,由此可见,现有的网盘在应用过程中,用户获取所需文件的路径比较长,访问速度比较慢。In the prior art, taking Baidu cloud network disk as an example, after a user accesses a video file on the Internet, the user actively caches the file in the personal cloud space provided by Baidu. In fact, the user's cloud space is stored in Baidu's IDC room server. When the user needs to access the file again, the path to obtain the file is: initiate an access request through the user device, go through the router and the optical fiber line provided by the operator, and then reach Baidu's computer room server, and then obtain it from Baidu's computer room server. It can be seen that in the application process of the existing network disk, the path for the user to obtain the required file is relatively long, and the access speed is relatively slow.
因此,亟需一种能够高效获取用户所需文件的方法。Therefore, there is an urgent need for a method that can efficiently obtain files required by users.
发明内容SUMMARY OF THE INVENTION
本发明实施例提供一种确定获取目标文件的方法及相关装置,用以实现解决现有技术中用户获取目标文件所需的路径较长、访问速度比较慢的技术问题。Embodiments of the present invention provide a method and a related device for determining an acquisition target file, which are used to solve the technical problems in the prior art that a user needs to acquire a target file with a long path and a relatively slow access speed.
本发明实施例提供的一种获取目标文件的方法,包括:A method for obtaining a target file provided by an embodiment of the present invention includes:
光线路终端OLT接收光网络单元ONU发送的获取请求消息;所述获取请求消息中包括目标文件的标识信息;所述OLT根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件;所述OLT向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。The optical line terminal OLT receives the acquisition request message sent by the optical network unit ONU; the acquisition request message includes the identification information of the target file; the OLT acquires the information from the storage space of the OLT according to the identification information of the target file. the target file; the OLT sends a request response message to the ONU; the request response message includes the target file.
进一步地,所述OLT根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件,包括:所述OLT根据所述获取请求消息的类型,确定所述OLT的存储空间中用于获取所述目标文件的查询区域;所述OLT根据所述目标文件的标识信息,从所述查询区域中获取所述目标文件。Further, the OLT obtains the target file from the storage space of the OLT according to the identification information of the target file, comprising: the OLT determining the storage space of the OLT according to the type of the obtaining request message The query area used to obtain the target file in the OLT; the OLT obtains the target file from the query area according to the identification information of the target file.
进一步地,所述获取请求消息中还包括所述ONU的标识信息;所述OLT根据所述ONU的标识信息,确定所述OLT的存储空间中与所述ONU的标识信息对应的标记区域;Further, the identification information of the ONU is also included in the acquisition request message; the OLT determines the marked area corresponding to the identification information of the ONU in the storage space of the OLT according to the identification information of the ONU;
所述OLT根据所述获取请求消息的类型,确定所述存储空间中用于获取所述目标文件的查询区域,包括:The OLT determines, according to the type of the acquisition request message, a query area in the storage space for acquiring the target file, including:
在所述获取请求消息为第一获取请求消息的情况下,所述OLT确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域;所述第一获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下发送的;When the acquisition request message is the first acquisition request message, the OLT determines that the query area for acquiring the target file in the storage space of the OLT is a marked area corresponding to the identification information of the ONU; The first acquisition request message is sent when the ONU determines that the comparison result of the identification information of the target file and the stored identification information is the same;
在所述获取请求消息为第二获取请求消息的情况下,所述OLT确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间;所述第二获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下发送的。In the case where the acquisition request message is the second acquisition request message, the OLT determines that the query area in the storage space of the OLT for acquiring the target file is outside the marked area corresponding to the identification information of the ONU The second acquisition request message is sent when the ONU determines that the comparison result between the identification information of the target file and the stored identification information is different.
进一步地,所述获取请求消息中还包括所述ONU的标识信息;所述OLT根据所述ONU的标识信息,确定所述OLT的存储空间中与所述ONU的标识信息对应的标记区域和共享区域;Further, also comprise the identification information of described ONU in the described acquisition request message; Described OLT determines according to the identification information of described ONU, the marked area corresponding to the identification information of described ONU in the storage space of described OLT and sharing area;
所述OLT根据所述获取请求消息的类型,确定所述OLT的存储空间中用于获取所述目标文件的查询区域,包括:The OLT determines, according to the type of the acquisition request message, a query area in the storage space of the OLT for acquiring the target file, including:
在所述获取请求消息为第一获取请求消息的情况下,所述OLT确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域和共享区域;所述第一获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下发送的;In the case where the acquisition request message is the first acquisition request message, the OLT determines that the query area used to acquire the target file in the storage space of the OLT is the marked area corresponding to the identification information of the ONU and the Shared area; The first acquisition request message is sent when the ONU determines that the comparison result of the identification information of the target file and the stored identification information is the same;
在所述获取请求消息为第二获取请求消息的情况下,所述OLT确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间;所述第二获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下发送的。In the case where the acquisition request message is the second acquisition request message, the OLT determines that the query area in the storage space of the OLT for acquiring the target file is outside the marked area corresponding to the identification information of the ONU The second acquisition request message is sent when the ONU determines that the comparison result between the identification information of the target file and the stored identification information is different.
进一步地,所述在所述获取请求消息为第二获取请求消息的情况下,所述OLT确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间之后,还包括:Further, described in the situation that described obtaining request message is the second obtaining request message, described OLT determines in the storage space of described OLT that the query area for obtaining described target file is the identification information with described ONU. After the storage space outside the corresponding marked area, it also includes:
若所述OLT从与所述ONU的标识信息对应的标记区域以外的存储空间获取到所述目标文件,则将所述目标文件从与所述ONU的标识信息对应的存储区域以外的区域存放至共享区域;或,If the OLT acquires the target file from a storage space other than the marked area corresponding to the identification information of the ONU, the target file is stored in an area other than the storage area corresponding to the identification information of the ONU to shared area; or,
若所述OLT确定与所述ONU的标识信息对应的标记区域以外的存储空间不包括所述目标文件,则通过网络获取所述目标文件,并将所述目标文件存储在与所述ONU的标识信息对应的标记区域。If the OLT determines that the storage space other than the marked area corresponding to the identification information of the ONU does not include the target file, obtain the target file through the network, and store the target file in the identifier corresponding to the ONU. The marked area corresponding to the information.
进一步地,所述请求响应消息中还包括指示信息,所述指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述ONU的资源空间,所述ONU的资源空间用于存储标识信息。Further, the request response message also includes instruction information, and the instruction information is used to instruct the ONU to store the identification information of the target file in the resource space of the ONU, and the resource space of the ONU is used to store identification information.
本发明实施例还提供了一种获取目标文件的方法,该方法包括:光网络单元ONU接收用户发送的目标文件的访问请求消息;所述访问请求消息中包括所述目标文件的标识信息;所述ONU将所述目标文件的标识信息与已存储的标识信息进行比较,并根据比较结果向光线路终端OLT发送获取请求消息;所述ONU接收所述OLT根据所述获取请求消息发送的请求响应消息;所述请求响应消息中包括所述目标文件;所述ONU将所述目标文件发送给所述用户。An embodiment of the present invention also provides a method for acquiring a target file, the method comprising: an optical network unit ONU receiving an access request message of a target file sent by a user; the access request message includes identification information of the target file; Described ONU compares the identification information of described target file with stored identification information, and sends acquisition request message to optical line terminal OLT according to comparison result; Described ONU receives the request response that described OLT sends according to described acquisition request message message; the request response message includes the target file; the ONU sends the target file to the user.
进一步地,所述ONU将所述目标文件的标识信息与已存储的标识信息进行比较,并根据比较结果向OLT发送获取请求消息,包括:所述ONU确定所述目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下,向所述OLT发送的获取请求消息为第一获取请求消息;所述ONU确定所述目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下,向所述OLT发送的获取请求消息为第二获取请求消息。Further, the ONU compares the identification information of the target file with the stored identification information, and sends an acquisition request message to the OLT according to the comparison result, including: the ONU determines that the identification information of the target file is stored with the stored identification information. When the comparison result of the identification information is the same, the acquisition request message sent to the OLT is the first acquisition request message; The ONU determines that the comparison result of the identification information of the target file and the stored identification information is not. In the same case, the acquisition request message sent to the OLT is the second acquisition request message.
进一步地,所述获取请求消息为第二获取请求消息的情况下,所述ONU接收到的所述请求响应消息中还包括指示信息;所述指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述ONU的资源空间,所述资源空间用于存储标识信息。Further, when the acquisition request message is the second acquisition request message, the request response message received by the ONU also includes indication information; the indication information is used to instruct the ONU to convert the target file to the ONU. The identification information of the ONU is stored in the resource space of the ONU, and the resource space is used to store the identification information.
进一步地,所述ONU接收用户发送的所述目标文件的访问请求消息之前,还包括:所述ONU向所述OLT发送注册请求消息;所述注册请求消息中包括所述ONU的标识信息;所述注册请求消息用于使所述OLT分配与所述ONU的标识信息对应的标记区域;所述ONU接收所述OLT根据所述注册请求消息发送的资源分配消息,并根据所述资源分配消息建立所述ONU的资源空间;所述资源空间用于存储标识信息。Further, before the ONU receives the access request message of the target file sent by the user, it also includes: the ONU sends a registration request message to the OLT; the registration request message includes the identification information of the ONU; Described registration request message is used to make described OLT allocate the marking area corresponding to the identification information of described ONU; Described ONU receives the resource allocation message that described OLT sends according to described registration request message, and establishes according to described resource allocation message The resource space of the ONU; the resource space is used to store identification information.
本发明实施例还提供了一种光线路终端OLT,包括:接收模块,用于接收光网络单元ONU发送的获取请求消息;所述获取请求消息中包括目标文件的标识信息;处理模块,用于根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件;发送模块,用于向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。An embodiment of the present invention further provides an optical line terminal OLT, including: a receiving module for receiving an acquisition request message sent by an optical network unit ONU; the acquisition request message includes identification information of a target file; a processing module for Obtain the target file from the storage space of the OLT according to the identification information of the target file; a sending module is configured to send a request response message to the ONU; the request response message includes the target file.
进一步地,所述处理模块具体用于:根据所述获取请求消息的类型,确定所述OLT的存储空间中用于获取所述目标文件的查询区域;根据所述目标文件的标识信息,从所述查询区域中获取所述目标文件。Further, the processing module is specifically configured to: determine, according to the type of the acquisition request message, a query area used to acquire the target file in the storage space of the OLT; Obtain the target file in the query area.
进一步地,所述获取请求消息中还包括所述ONU的标识信息;所述处理模块还用于:根据所述ONU的标识信息,确定所述OLT的存储空间中与所述ONU的标识信息对应的标记区域;Further, the acquisition request message also includes the identification information of the ONU; the processing module is also used for: according to the identification information of the ONU, determine that the storage space of the OLT corresponds to the identification information of the ONU the marked area;
在所述获取请求消息为第一获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域;所述第一获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下发送的;In the case that the acquisition request message is the first acquisition request message, determine that the query area used to acquire the target file in the storage space of the OLT is a marked area corresponding to the identification information of the ONU; the first An acquisition request message is sent when the ONU determines that the comparison result of the identification information of the target file and the stored identification information is the same;
在所述获取请求消息为第二获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间;所述第二获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下发送的。In the case that the acquisition request message is the second acquisition request message, determine that the query area in the storage space of the OLT for acquiring the target file is a storage space other than the marked area corresponding to the identification information of the ONU The second acquisition request message is sent when the ONU determines that the comparison result between the identification information of the target file and the stored identification information is not the same.
进一步地,所述获取请求消息中还包括所述ONU的标识信息;所述处理模块还用于:根据所述ONU的标识信息,确定所述OLT的存储空间中与所述ONU的标识信息对应的标记区域和共享区域;Further, the acquisition request message also includes the identification information of the ONU; the processing module is also used for: according to the identification information of the ONU, determine that the storage space of the OLT corresponds to the identification information of the ONU marked areas and shared areas;
在所述获取请求消息为第一获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域和共享区域;所述第一获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下发送的;In the case that the acquisition request message is the first acquisition request message, it is determined that the query area for acquiring the target file in the storage space of the OLT is a marked area and a shared area corresponding to the identification information of the ONU; The first acquisition request message is sent when the ONU determines that the comparison result of the identification information of the target file and the stored identification information is the same;
在所述获取请求消息为第二获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间;所述第二获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下发送的。In the case that the acquisition request message is the second acquisition request message, determine that the query area in the storage space of the OLT for acquiring the target file is a storage space other than the marked area corresponding to the identification information of the ONU The second acquisition request message is sent when the ONU determines that the comparison result between the identification information of the target file and the stored identification information is not the same.
进一步地,所述处理模块还用于:若从与所述ONU的标识信息对应的标记区域以外的存储空间获取到所述目标文件,则将所述目标文件从与所述ONU的标识信息对应的存储区域以外的区域存放至共享区域;或,Further, the processing module is also used for: if the target file is obtained from the storage space outside the marked area corresponding to the identification information of the ONU, then the target file is corresponding to the identification information of the ONU from the target file. areas other than the storage area of to the shared area; or,
若确定与所述ONU的标识信息对应的标记区域以外的存储空间不包括所述目标文件,则通过网络获取所述目标文件,并将所述目标文件存储在与所述ONU的标识信息对应的标记区域。If it is determined that the storage space other than the marked area corresponding to the identification information of the ONU does not include the target file, obtain the target file through the network, and store the target file in a storage space corresponding to the identification information of the ONU marked area.
进一步地,所述请求响应消息中还包括指示信息,所述指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述ONU的资源空间,所述资源空间用于存储标识信息。Further, the request response message also includes indication information, and the indication information is used to instruct the ONU to store the identification information of the target file in the resource space of the ONU, and the resource space is used to store the identification information. .
本发明实施例还提供了一种光网络单元ONU,,该ONU包括:接收模块,用于接收用户发送的目标文件的访问请求消息;所述访问请求消息中包括所述目标文件的标识信息;接收光线路终端OLT根据所述获取请求消息发送的请求响应消息;所述请求响应消息中包括所述目标文件;处理模块,用于将所述目标文件的标识信息与已存储的标识信息进行比较,并根据比较结果通过发送模块向所述OLT发送获取请求消息;所述发送模块,用于向所述OLT发送获取请求消息,以及将所述目标文件发送给所述用户。An embodiment of the present invention also provides an optical network unit ONU, where the ONU includes: a receiving module for receiving an access request message of a target file sent by a user; the access request message includes identification information of the target file; receiving a request response message sent by the optical line terminal OLT according to the acquisition request message; the request response message includes the target file; a processing module configured to compare the identification information of the target file with the stored identification information , and send an obtaining request message to the OLT through a sending module according to the comparison result; the sending module is configured to send the obtaining request message to the OLT, and send the target file to the user.
进一步地,所述处理模块具体用于:确定所述目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下,通过所述发送模块向所述OLT发送的获取请求消息为第一获取请求消息;确定所述目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下,通过所述发送模块向所述OLT发送的获取请求消息为第二获取请求消息。Further, the processing module is specifically used to: determine that the comparison result between the identification information of the target file and the stored identification information is the same, and the acquisition request message sent to the OLT by the sending module is the first. an acquisition request message; if it is determined that the comparison result between the identification information of the target file and the stored identification information is different, the acquisition request message sent to the OLT by the sending module is the second acquisition request message.
进一步地,所述获取请求消息为第二获取请求消息的情况下,所述接收模块接收到的所述请求响应消息中还包括指示信息;所述指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述ONU的资源空间,所述资源空间用于存储标识信息。Further, when the acquisition request message is a second acquisition request message, the request response message received by the receiving module also includes indication information; the indication information is used to instruct the ONU to The identification information of the file is stored in the resource space of the ONU, and the resource space is used to store the identification information.
进一步地,所述发送模块还用于:向所述OLT发送注册请求消息;所述注册请求消息中包括所述ONU的标识信息;所述注册请求消息用于使所述OLT分配与所述ONU的标识信息对应的标记区域;所述接收模块还用于:接收所述OLT根据所述注册请求消息发送的资源分配消息,并根据所述资源分配消息建立所述ONU的资源空间;所述资源空间用于存储标识信息。Further, the sending module is also used to: send a registration request message to the OLT; the registration request message includes the identification information of the ONU; the registration request message is used to make the OLT allocate and the ONU The marking area corresponding to the identification information; the receiving module is further configured to: receive the resource allocation message sent by the OLT according to the registration request message, and establish the resource space of the ONU according to the resource allocation message; the resource Space is used to store identification information.
本发明的上述实施例中,OLT接收ONU发送的获取请求消息;所述获取请求消息中包括所述目标文件的标识信息;所述OLT根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件,并向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。本发明实施例中在OLT增设存储空间,若该存储空间中存储有目标文件,则OLT可将目标文件直接返回给用户,无需通过访问网络来获取,从而有效缩短了访问路径,明显提高了访问效率。In the above-mentioned embodiment of the present invention, the OLT receives the acquisition request message sent by the ONU; the acquisition request message includes the identification information of the target file; The target file is acquired in the space, and a request response message is sent to the ONU; the request response message includes the target file. In the embodiment of the present invention, a storage space is added to the OLT. If a target file is stored in the storage space, the OLT can directly return the target file to the user without accessing the network to obtain it, thereby effectively shortening the access path and significantly improving the access efficiency.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为本发明实施例适用的系统架构示意图;1 is a schematic diagram of a system architecture to which an embodiment of the present invention is applicable;
图2为本发明实施例提供的OLT的存储空间示意图;2 is a schematic diagram of a storage space of an OLT provided by an embodiment of the present invention;
图3为本发明实施例一提供的一种获取目标文件的方法示意图;3 is a schematic diagram of a method for obtaining a target file according to Embodiment 1 of the present invention;
图4为本发明实施例二提供的一种获取目标文件的方法示意图;4 is a schematic diagram of a method for obtaining a target file according to Embodiment 2 of the present invention;
图5为本发明实施例三提供的一种OLT的结构示意图;5 is a schematic structural diagram of an OLT according to Embodiment 3 of the present invention;
图6为本发明实施例四提供的一种ONU的结构示意图。FIG. 6 is a schematic structural diagram of an ONU according to Embodiment 4 of the present invention.
具体实施方式Detailed ways
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
本发明实施例涉及的一种系统架构中可以包括互联网服务器、OLT(optical lineterminal,光线路终端),多个ONU(Optical Network Unit,光网络单元),以及多个用户。其中,用户可以与对应的ONU进行通信,ONU可以与OLT进行通信,OLT可以与互联网服务器进行通信。图1为本发明实施例涉及的一种系统架构示意图,该系统架构中可以包括互联网服务器101、OLT102,ONU1031、ONU1032、ONU1033、用户1041、用户1042、用户1043、用户1044、用户1045、用户1046。其中,用户1041和用户1042可以与ONU1031进行通信,用户1043和用户1044可以与ONU1032进行通信,用户1045和用户1046可以与ONU1033进行通信,ONU1031、ONU1032和ONU1033可以与OLT102进行通信,OLT102可以与互联网服务器101进行通信。A system architecture involved in the embodiments of the present invention may include an Internet server, an OLT (optical line terminal, optical line terminal), multiple ONUs (Optical Network Unit, optical network unit), and multiple users. The user can communicate with the corresponding ONU, the ONU can communicate with the OLT, and the OLT can communicate with the Internet server. 1 is a schematic diagram of a system architecture involved in an embodiment of the present invention. The system architecture may include an
本发明实施例中的用户可以为具有通信功能的移动设备,比如智能手机、平板电脑等。The user in this embodiment of the present invention may be a mobile device with a communication function, such as a smart phone, a tablet computer, and the like.
本发明实施例在现有的OLT上安装存储设备,并增加智能管理功能,使得OLT可以管理多个用户放置上来的数据,从而实现在通过同一OLT访问的用户,可以从OLT的存储设备上读取文件,节省骨干网带宽。相应地,在ONU上提供存储访问能力,存储的实际存放位置,可以位于ONU本地也可以存放在OLT侧存储设备上。进一步地,当网络空闲时,OLT设备直接通过骨干网络访问互联网上的文件,缓存于自身的存储设备上,当用户需要访问时,直接通过ONU访问文件,提供较好的响应速度。In the embodiment of the present invention, a storage device is installed on the existing OLT, and an intelligent management function is added, so that the OLT can manage the data placed by multiple users, so that users accessing through the same OLT can read data from the storage device of the OLT. Fetch files to save backbone network bandwidth. Correspondingly, the storage access capability is provided on the ONU, and the actual storage location of the storage can be located locally on the ONU or stored on the storage device on the OLT side. Further, when the network is idle, the OLT device directly accesses the files on the Internet through the backbone network, and caches them on its own storage device. When the user needs to access, it directly accesses the files through the ONU, providing better response speed.
具体地,本发明实施例中,在OLT增设存储空间,为便于查询,OLT为发起注册请求消息的各个ONU分配相应的存储空间。如图2所示,为图1中对应的OLT102的存储空间示意图。ONU1031、ONU1032、ONU1033均向OLT102发起注册请求消息,其中,注册请求消息中携带有各个ONU的标识信息。OLT102根据接收到ONU1031的注册请求消息,分配与ONU1031的标识信息对应的第一标记区域;OLT102根据接收到ONU1032的注册请求消息,分配与ONU1032的标识信息对应的第二标记区域;OLT102根据接收到ONU1033的注册请求消息,分配与ONU1033的标识信息对应的第三标记区域。Specifically, in the embodiment of the present invention, a storage space is added to the OLT, and to facilitate query, the OLT allocates a corresponding storage space to each ONU that initiates a registration request message. As shown in FIG. 2 , it is a schematic diagram of the storage space of the
进一步地,为更好地实现信息的共享,OLT的存储空间中还设置有共享区域,该共享区域与ONU1031、ONU1032、ONU1033的标识信息均存在对应关系。OLT的存储空间还可以包括尚未进行分配的区域。Further, in order to better realize information sharing, a shared area is also set in the storage space of the OLT, and the shared area has a corresponding relationship with the identification information of ONU1031, ONU1032, and ONU1033. The storage space of the OLT may also include areas that have not yet been allocated.
本发明实施例中,第一标记区域、第二标记区域、第三标记区域以及共享区域的容量大小可以相同,也可以不相同,其具体容量大小可由OLT自动生成,也可由本领域技术人员根据实际情况进行配置。In this embodiment of the present invention, the capacities of the first marked area, the second marked area, the third marked area, and the shared area may be the same or different. actual configuration.
本发明实施例中,在ONU增设资源空间,该资源空间用于存储标识信息。具体地,此处以ONU1031建立资源空间的过程为例进行说明。OLT102根据注册请求消息为ONU1031分配对应的第一标记区域后,向ONU1031返回资源分配消息,ONU1031接收到资源分配消息后,建立与OLT102中的第一标记区域对应的资源空间,该资源空间可用于存储用户1041和用户1042访问的文件的标识信息。In the embodiment of the present invention, a resource space is added in the ONU, and the resource space is used for storing identification information. Specifically, the process of establishing the resource space by the
下面结合图1针对用户发起访问请求的各个阶段进行具体介绍,并具体说明ONU的资源空间中存储的标识信息与OLT存储空间中的文件之间的对应关系的建立过程。In the following, various stages of initiating an access request by a user will be introduced in detail with reference to FIG. 1 , and a process of establishing the correspondence between the identification information stored in the resource space of the ONU and the files in the OLT storage space will be described in detail.
(1)阶段一(1) Stage 1
此阶段为初始阶段,即ONU的资源空间中尚未存储有标识信息,且OLT的存储空间中也尚未存储有文件的初始阶段。This stage is the initial stage, that is, the identification information has not been stored in the resource space of the ONU, and the file has not been stored in the storage space of the OLT.
例如,用户1041向ONU1031发起想要访问文件a的请求消息。ONU1031接收到请求消息后,查询资源空间中存储的标识信息,确定不存在与文件a的标识信息相同的标识信息的情况下,向OLT102发送第二获取请求消息。OLT102接收到第二获取请求消息后,可以对整个存储空间进行查询,以确定存储空间中是否存在与文件a的标识信息对应的文件,即文件a;也可以查询与ONU1031的标识信息对应的第一标记区域以外的存储空间。此时,若确定存储空间中不存在文件a,则OLT102通过网络访问互联网服务器101,从互联网服务器101中获取到文件a后,将文件a存储在与ONU1031的标识信息对应的第一标记区域,并向ONU1031返回请求响应消息,该请求响应消息中包括文件a,还可以包括指示消息。ONU1031接收到请求响应消息后,将请求响应消息中的文件a发送给用户1041,并根据指示信息将文件a的标识信息存储至ONU1031的资源空间,从而建立了ONU1031的资源空间中的标识信息与第一标识区域中的文件之间的对应关系。For example, the
(2)阶段二(2) Stage 2
此阶段为在阶段一的基础上,用户访问OLT的存储空间中已存储的文件的阶段。This stage is a stage in which the user accesses the files stored in the storage space of the OLT on the basis of the first stage.
在阶段一之后,用户1041再次向ONU1031发起想要访问文件a的请求消息,或者,用户1042向ONU1031发起想要访问文件a的请求消息,ONU1031接收到请求消息后,查询资源空间中存储的标识信息,确定存在与文件a的标识信息相同的标识信息的情况下,向OLT102发送第一获取请求消息。OLT102接收到第一获取请求消息后,可以对整个存储空间进行查询,以确定存储空间中是否存在文件a。优选地,OLT102可根据第一获取请求消息中的文件a的标识信息,仅查询与ONU1031的标识信息对应的第一标记区域和共享区域,从而能够有效节省查询的工作量,提高获取文件a的效率。OLT102从第一标记区域获取到文件a后,向ONU1031返回请求响应消息,此时,该请求响应消息中可以仅包括文件a。ONU1031接收到请求响应消息后,将文件a发送给用户1041。After the first stage, the
(3)阶段三(3) Stage three
此阶段为OLT将文件存储至共享区域的阶段。This stage is the stage in which the OLT stores files in the shared area.
在阶段一或阶段二之后,用户1043或用户1044向ONU1032发起想要访问文件a的请求消息,ONU1032接收到请求消息后,查询资源空间中存储的标识信息,在确定不存在与文件a的标识信息相同的标识信息的情况下,向OLT102发送第二获取请求消息。OLT102接收到第二获取请求消息后,可以对整个存储空间进行查询,以确定存储空间中是否存在文件a。优选地,由于与ONU1032的标识信息对应的第二标记区域不存在文件a,因此,为节省查询的工作量,OLT102可根据第二获取请求消息中的文件a的标识信息,仅查询与ONU1032的标识信息对应的第二标记区域以外的存储空间,经查询,OLT102从第一标记区域获取到文件a,并向ONU1032返回请求响应消息,此时,该请求响应消息中包括文件a,还可以包括指示消息。ONU1032接收到请求响应消息后,将请求响应消息中的文件a发送给用户1043或1044,并根据指示信息将文件a的标识信息存储至ONU1032的资源空间。After Phase 1 or Phase 2, user 1043 or user 1044 initiates a request message to
上述过程中,OLT102从与ONU1031的标识信息对应的第一标记区域获取到文件a,说明文件a为ONU1031和ONU1032所连接的多个用户均会访问的文件,此时,OLT102可将文件a从第一标记区域存放至共享区域,从而能够实现当ONU1032所连接的用户发起访问文件a的请求消息后,OLT102可直接查询与ONU1032的标识信息对应的存储区域(包括第二标记区域和共享区域),得到文件a,相比于查询第二标记区域以外的存储空间,能够有效节省查询的工作量,提高获取文件a的效率。而且,通过上述方式建立了ONU1032的资源空间中的标识信息与共享区域中的文件之间的对应关系。In the above process, OLT102 obtains file a from the first marked area corresponding to the identification information of ONU1031, indicating that file a is a file that multiple users connected by ONU1031 and ONU1032 can access. At this time, OLT102 can convert file a from The first marked area is stored in the shared area, so that when the user connected to ONU1032 initiates a request message for accessing file a, OLT102 can directly query the storage area (including the second marked area and the shared area) corresponding to the identification information of ONU1032 , to obtain file a. Compared with querying the storage space outside the second marked area, the workload of query can be effectively saved, and the efficiency of obtaining file a can be improved. Moreover, the correspondence between the identification information in the resource space of the
(4)阶段四(4) Stage Four
在阶段三之后,用户1045或用户1046向ONU1033发起想要访问文件a的请求消息,ONU1033接收到请求消息后,查询资源空间中存储的标识信息,确定不存在与文件a的标识信息相同的标识信息的情况下,向OLT102发送第二获取请求消息。OLT102接收到第二获取请求消息后,可以对整个存储空间进行查询,以确定存储空间中是否存在文件a。优选地,OLT102也可以仅查询与ONU1033的标识信息对应的第三标记区域以外的存储空间,以节省查询的工作量。经查询,OLT102从共享区域获取到文件a后,向ONU1033发送请求响应消息,此时,该请求响应消息中包括文件a,还可以包括指示消息。ONU1033接收到请求响应消息后,将请求响应消息中的文件a发送给用户1045或1046,并根据指示信息将文件a的标识信息存储至资源空间,建立起ONU1033的资源空间中的标识信息与共享区域中的文件之间的对应关系。After the third stage, the
优选地,为保证用户能够更快速、更顺畅地获取目标文件,各个ONU中也可以存储其资源空间中各个标识信息所对应的文件的部分初始内容。以视频文件为例,假设该视频文件为300M,则可以在ONU中存储视频文件的前30M,并将后270M存储在OLT的存储空间中,当用户向ONU发起访问视频的请求消息后,ONU根据请求消息向OLT发送获取请求消息,并将其存储的30M视频文件发送给用户,以更快地响应用户的访问请求。在获取到OLT发送的270M视频文件后,将该270M视频文件发送给用户,从而使得用户能够顺畅地观看视频,有效避免了在初始阶段通信过程中,由于通信速度慢而导致用户观看视频不顺畅的问题。Preferably, in order to ensure that the user can obtain the target file more quickly and smoothly, each ONU may also store part of the initial content of the file corresponding to each identification information in its resource space. Taking a video file as an example, assuming that the video file is 300M, the first 30M of the video file can be stored in the ONU, and the last 270M can be stored in the storage space of the OLT. When the user sends a request message to the ONU to access the video, the ONU According to the request message, send an acquisition request message to the OLT, and send the stored 30M video file to the user, so as to respond to the user's access request faster. After obtaining the 270M video file sent by the OLT, the 270M video file is sent to the user, so that the user can watch the video smoothly, which effectively avoids the slow communication in the initial stage of the communication process. The problem.
本发明实施例所提供的获取目标文件的方法中至少涉及到OLT、ONU以及用户之间的通信过程,下面分别从OLT、ONU的角度对本发明实施例进行介绍。The method for acquiring a target file provided by the embodiment of the present invention involves at least a communication process among the OLT, the ONU, and the user. The embodiments of the present invention are introduced from the perspectives of the OLT and the ONU, respectively.
图3为本发明实施例一提供的一种获取目标文件的方法示意图,该方法基于OLT的角度,具体包括:3 is a schematic diagram of a method for obtaining a target file provided by Embodiment 1 of the present invention. The method is based on the perspective of the OLT, and specifically includes:
步骤301,OLT接收ONU发送的获取请求消息;所述获取请求消息中包括所述目标文件的标识信息;
步骤302,所述OLT根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件;
步骤303,所述OLT向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。
本发明实施例,在步骤301中,获取请求消息可以为第一获取请求消息,也可以为第二获取请求消息,其中,第一获取请求消息和第二获取请求消息可通过设置不同的标识来进行区分,例如,可在获取请求消息中增设一个标识位,标识位可设置为0或1,可假设标识位为0时,获取请求消息为第一获取请求消息,标识位为1时,获取请求消息为第二获取请求消息。In this embodiment of the present invention, in
在步骤302中,OLT根据所述获取请求消息的类型,确定所述OLT的存储空间中用于获取所述目标文件的查询区域,进而根据目标文件的标识信息,从所述查询区域中获取所述目标文件。In
本发明实施例中,OLT中的存储空间的分配情况不同,则确定出的查询区域也不相同。以下通过两种方式介绍OLT确定出的查询区域。In the embodiment of the present invention, if the storage space in the OLT is allocated differently, the determined query areas are also different. The following describes the query area determined by the OLT in two ways.
方式一:method one:
OLT根据ONU的标识信息为ONU分配相应的标记区域,即,每一个在OLT上注册的ONU均对应一个标记区域。The OLT allocates a corresponding marked area to the ONU according to the identification information of the ONU, that is, each ONU registered on the OLT corresponds to a marked area.
具体地,OLT接收到ONU发送的获取请求消息后,通过判断标识位的值,确定出该获取请求消息为第一获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域。OLT接收到ONU发送的获取请求消息后,通过判断标识位的值,确定出该获取请求消息为第二获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间。Specifically, after receiving the acquisition request message sent by the ONU, the OLT determines that the acquisition request message is the first acquisition request message by judging the value of the identification bit, and determines that the storage space of the OLT is used to acquire the acquisition request message. The query area of the target file is a marked area corresponding to the identification information of the ONU. After receiving the acquisition request message sent by the ONU, the OLT determines, by judging the value of the identification bit, that the acquisition request message is the second acquisition request message, and determines the storage space of the OLT for acquiring the target file. The query area is a storage space other than the marked area corresponding to the identification information of the ONU.
方式二:Method two:
OLT根据ONU的标识信息为ONU分配相应的标记区域,即,每一个在OLT上注册的ONU均对应一个标记区域。且,OLT的存储空间中还包括共享区域。The OLT allocates a corresponding marked area to the ONU according to the identification information of the ONU, that is, each ONU registered on the OLT corresponds to a marked area. Moreover, the storage space of the OLT also includes a shared area.
OLT接收到ONU发送的获取请求消息后,通过判断标识位的值,确定出该获取请求消息为第一获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域和共享区域。OLT接收到ONU发送的获取请求消息后,通过判断标识位的值,确定出该获取请求消息为第二获取请求消息的情况下,OLT确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间。After receiving the acquisition request message sent by the ONU, the OLT determines, by judging the value of the flag bit, that the acquisition request message is the first acquisition request message, and determines the storage space of the OLT for acquiring the target file. The query area is a marked area and a shared area corresponding to the identification information of the ONU. After receiving the acquisition request message sent by the ONU, the OLT determines that the acquisition request message is the second acquisition request message by judging the value of the identification bit, and the OLT determines that the storage space of the OLT is used to acquire the target file. The query area is a storage space other than the marked area corresponding to the ONU identification information.
本发明实施例中,ONU确定目标文件的标识信息与资源空间中存储的标识信息相同,则说明该目标文件存储在OLT中与ONU的标识信息对应的标记区域和共享区域,此时,ONU向OLT发送第一获取请求消息。OLT根据第一获取请求消息中的标识信息,有针对性地查询与ONU的标识信息对应的标记区域和共享区域,从而能够有效节省查询的工作量,提高获取目标文件的效率。In the embodiment of the present invention, if the ONU determines that the identification information of the target file is the same as the identification information stored in the resource space, it means that the target file is stored in the marked area and the shared area corresponding to the identification information of the ONU in the OLT. The OLT sends the first acquisition request message. According to the identification information in the first acquisition request message, the OLT specifically queries the marked area and the shared area corresponding to the identification information of the ONU, thereby effectively saving the workload of the query and improving the efficiency of acquiring the target file.
本发明实施例中,ONU确定目标文件的标识信息与资源空间中存储的标识信息不相同,则说明该目标文件并未存储在OLT中与ONU的标识信息对应的标记区域,此时,ONU向OLT发送第二获取请求消息。OLT根据第二获取请求消息中的标识信息,有针对性地查询OLT的存储空间中与ONU的标识信息对应的标记区域以外的区域,从而能达到节省查询的工作量,提高获取目标文件的效率。In the embodiment of the present invention, if the ONU determines that the identification information of the target file is different from the identification information stored in the resource space, it means that the target file is not stored in the marked area corresponding to the identification information of the ONU in the OLT. The OLT sends a second acquisition request message. According to the identification information in the second acquisition request message, the OLT specifically queries the storage space of the OLT for areas other than the marked area corresponding to the identification information of the ONU, thereby saving the workload of the query and improving the efficiency of acquiring the target file .
本发明实施例中,在获取请求消息为第二获取请求消息的情况下,若OLT从与所述ONU的标识信息对应的标记区域以外的存储空间获取到所述目标文件,则将所述目标文件从与所述ONU的标识信息对应的存储区域以外的区域存放至所述共享区域;或者,若OLT确定与所述ONU的标识信息对应的标记区域以外的存储空间不包括所述目标文件,则通过网络获取所述目标文件,并将所述目标文件存储在与所述ONU的标识信息对应的标记区域。In this embodiment of the present invention, when the acquisition request message is the second acquisition request message, if the OLT acquires the target file from a storage space other than the marked area corresponding to the ONU identification information, the target file is The file is stored in the shared area from the area outside the storage area corresponding to the identification information of the ONU; or, if the OLT determines that the storage space outside the marked area corresponding to the identification information of the ONU does not include the target file, Then, the target file is acquired through the network, and the target file is stored in the marked area corresponding to the identification information of the ONU.
在步骤303中,OLT向ONU发送的请求响应消息中还可以包括指示信息,该指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述资源空间。In
本发明实施例中,在OLT增设存储空间,若该存储空间中存储有目标文件,则OLT可将目标文件直接返回给ONU,进而通过ONU返回给用户,无需通过访问网络来获取,从而有效缩短了访问路径,明显提高了访问效率。In the embodiment of the present invention, a storage space is added to the OLT. If a target file is stored in the storage space, the OLT can directly return the target file to the ONU, and then return the target file to the user through the ONU without accessing the network to obtain it, thereby effectively shortening the The access path is improved, and the access efficiency is obviously improved.
图4为本发明实施例二提供的一种获取目标文件的方法示意图,该方法基于ONU的角度,具体包括:4 is a schematic diagram of a method for obtaining a target file according to Embodiment 2 of the present invention. The method is based on the perspective of the ONU, and specifically includes:
步骤401,ONU接收用户发送的所述目标文件的访问请求消息;所述访问请求消息中包括所述目标文件的标识信息;
步骤402,所述ONU将所述目标文件的标识信息与资源空间中存储的标识信息进行比较,并根据比较结果向OLT发送获取请求消息;
步骤403,所述ONU接收所述OLT根据所述获取请求消息发送的请求响应消息;所述请求响应消息中包括所述目标文件;
步骤404,所述ONU将所述目标文件发送给所述用户。
本发明实施例,在步骤402中,ONU将所述目标文件的标识信息与资源空间中存储的标识信息进行比较,若目标文件的标识信息与资源空间中存储的标识信息相同,则向OLT发送第一获取请求消息;若目标文件的标识信息与资源空间中存储的标识信息不相同,则向OLT发送第二获取请求消息。In this embodiment of the present invention, in
在步骤403中,所述获取请求消息为第二获取请求消息的情况下,所述ONU接收到的所述请求响应消息中还包括指示信息,所述指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述资源空间。In
本发明实施例中,在ONU增设资源空间,ONU确定目标文件的标识信息与资源空间中的标识信息相同的情况下,向OLT发送获取请求消息,若OLT的存储空间中存储有目标文件,则OLT可将目标文件直接返回给ONU,进而通过ONU返回给用户,无需通过访问网络来获取,从而有效缩短了访问路径,明显提高了访问效率。In the embodiment of the present invention, when the ONU adds a resource space, and the ONU determines that the identification information of the target file is the same as the identification information in the resource space, the ONU sends an acquisition request message to the OLT. If the storage space of the OLT stores the target file, then The OLT can directly return the target file to the ONU, and then return it to the user through the ONU, without accessing the network to obtain it, thereby effectively shortening the access path and significantly improving the access efficiency.
本发明的上述实施例中,OLT接收ONU发送的获取请求消息;所述获取请求消息中包括所述目标文件的标识信息;所述OLT根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件,并向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。本发明实施例中在OLT增设存储空间,若该存储空间中存储有目标文件,则OLT可将目标文件直接返回给用户,无需通过访问网络来获取,从而有效缩短了访问路径,明显提高了访问效率。In the above-mentioned embodiment of the present invention, the OLT receives the acquisition request message sent by the ONU; the acquisition request message includes the identification information of the target file; The target file is obtained in the space, and a request response message is sent to the ONU; the request response message includes the target file. In the embodiment of the present invention, a storage space is added to the OLT. If a target file is stored in the storage space, the OLT can directly return the target file to the user without accessing the network to obtain it, thereby effectively shortening the access path and significantly improving the access efficiency.
针对上述方法流程,本发明实施例还提供一种OLT,该OLT的具体内容可以参照上述方法实施。For the above method flow, an embodiment of the present invention further provides an OLT, and the specific content of the OLT may be implemented with reference to the above method.
图5所示为本发明实施例提供的一种OLT的结构示意图,该OLT包括:FIG. 5 is a schematic structural diagram of an OLT provided by an embodiment of the present invention, and the OLT includes:
接收模块501,用于接收ONU发送的获取请求消息;所述获取请求消息中包括目标文件的标识信息;A receiving module 501 is used to receive an acquisition request message sent by the ONU; the acquisition request message includes the identification information of the target file;
处理模块502,用于根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件;A processing module 502, configured to obtain the target file from the storage space of the OLT according to the identification information of the target file;
发送模块503,用于向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。The sending module 503 is configured to send a request response message to the ONU; the request response message includes the target file.
较佳地,所述处理模块502具体用于:Preferably, the processing module 502 is specifically used for:
根据所述获取请求消息的类型,确定所述OLT的存储空间中用于获取所述目标文件的查询区域;According to the type of the acquisition request message, determine the query area used to acquire the target file in the storage space of the OLT;
根据所述目标文件的标识信息,从所述查询区域中获取所述目标文件。The target file is acquired from the query area according to the identification information of the target file.
较佳地,所述获取请求消息中还包括所述ONU的标识信息;Preferably, the acquisition request message also includes the identification information of the ONU;
所述处理模块502还用于:The processing module 502 is also used for:
根据所述ONU的标识信息,确定所述OLT的存储空间中与所述ONU的标识信息对应的标记区域;According to the identification information of the ONU, determine the marked area corresponding to the identification information of the ONU in the storage space of the OLT;
在所述获取请求消息为第一获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域;所述第一获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下发送的;In the case that the acquisition request message is the first acquisition request message, determine that the query area used to acquire the target file in the storage space of the OLT is a marked area corresponding to the identification information of the ONU; the first An acquisition request message is sent when the ONU determines that the comparison result of the identification information of the target file and the stored identification information is the same;
在所述获取请求消息为第二获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间;所述第二获取请求消息为所述ONU确定目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下发送的。In the case that the acquisition request message is the second acquisition request message, determine that the query area in the storage space of the OLT for acquiring the target file is a storage space other than the marked area corresponding to the identification information of the ONU The second acquisition request message is sent when the ONU determines that the comparison result between the identification information of the target file and the stored identification information is not the same.
较佳地,,所述获取请求消息中还包括所述ONU的标识信息;Preferably, the acquisition request message also includes the identification information of the ONU;
所述处理模块502还用于:The processing module 502 is also used for:
根据所述ONU的标识信息,确定所述OLT的存储空间中与所述ONU的标识信息对应的标记区域和共享区域;According to the identification information of the ONU, determine the marked area and the shared area corresponding to the identification information of the ONU in the storage space of the OLT;
在所述获取请求消息为第一获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域和共享区域;所述第一获取请求消息为所述ONU确定目标文件的标识信息与资源空间中存储的标识信息的比较结果为相同的情况下发送的;In the case that the acquisition request message is the first acquisition request message, it is determined that the query area for acquiring the target file in the storage space of the OLT is a marked area and a shared area corresponding to the identification information of the ONU; The first acquisition request message is sent when the ONU determines that the comparison result of the identification information of the target file and the identification information stored in the resource space is the same;
在所述获取请求消息为第二获取请求消息的情况下,确定所述OLT的存储空间中用于获取所述目标文件的查询区域为与所述ONU的标识信息对应的标记区域以外的存储空间;所述第二获取请求消息为所述ONU确定目标文件的标识信息与资源空间中存储的标识信息的比较结果为不相同的情况下发送的。In the case that the acquisition request message is the second acquisition request message, determine that the query area in the storage space of the OLT for acquiring the target file is a storage space other than the marked area corresponding to the identification information of the ONU The second acquisition request message is sent when the ONU determines that the comparison result between the identification information of the target file and the identification information stored in the resource space is not the same.
较佳地,所述处理模块502还用于:Preferably, the processing module 502 is also used for:
若从与所述ONU的标识信息对应的标记区域以外的存储空间获取到所述目标文件,则将所述目标文件从与所述ONU的标识信息对应的存储区域以外的区域存放至所述共享区域;或,If the target file is acquired from a storage space other than the marked area corresponding to the ONU identification information, the target file is stored in the shared storage space from an area other than the storage area corresponding to the ONU identification information area; or,
若确定与所述ONU的标识信息对应的标记区域以外的存储空间不包括所述目标文件,则通过网络获取所述目标文件,并将所述目标文件存储在与所述ONU的标识信息对应的标记区域。If it is determined that the storage space other than the marked area corresponding to the identification information of the ONU does not include the target file, obtain the target file through the network, and store the target file in a storage space corresponding to the identification information of the ONU marked area.
较佳地,所述请求响应消息中还包括指示信息,所述指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述资源空间。Preferably, the request response message further includes indication information, where the indication information is used to instruct the ONU to store the identification information of the target file in the resource space.
针对上述方法流程,本发明实施例还提供一种ONU,该ONU的具体内容可以参照上述方法实施。For the above method flow, an embodiment of the present invention further provides an ONU, and the specific content of the ONU can be implemented with reference to the above method.
图6所示为本发明实施例提供的一种ONU的结构示意图,该ONU包括:6 shows a schematic structural diagram of an ONU provided by an embodiment of the present invention, and the ONU includes:
接收模块601,用于接收用户发送的目标文件的访问请求消息;所述访问请求消息中包括所述目标文件的标识信息;接收光线路终端OLT根据所述获取请求消息发送的请求响应消息;所述请求响应消息中包括所述目标文件;A receiving
处理模块602,用于将所述目标文件的标识信息与已存储的标识信息进行比较,并根据比较结果通过发送模块603向所述OLT发送获取请求消息;A
所述发送模块603,用于向所述OLT发送获取请求消息,以及将所述目标文件发送给所述用户。The sending
较佳地,所述处理模块602具体用于:Preferably, the
确定所述目标文件的标识信息与已存储的标识信息的比较结果为相同的情况下,通过所述发送模块603向所述OLT发送的获取请求消息为第一获取请求消息;When it is determined that the comparison result between the identification information of the target file and the stored identification information is the same, the acquisition request message sent to the OLT by the sending
确定所述目标文件的标识信息与已存储的标识信息的比较结果为不相同的情况下,通过所述发送模块603向所述OLT发送的获取请求消息为第二获取请求消息。When it is determined that the comparison result between the identification information of the target file and the stored identification information is not the same, the acquisition request message sent to the OLT by the sending
较佳地,所述获取请求消息为第二获取请求消息的情况下,所述接收模块601接收到的所述请求响应消息中还包括指示信息;所述指示信息用于指示所述ONU将所述目标文件的标识信息存储至所述资源空间。Preferably, when the acquisition request message is the second acquisition request message, the request response message received by the receiving
较佳地,所述发送模块603还用于:Preferably, the sending
向所述OLT发送注册请求消息;所述注册请求消息中包括所述ONU的标识信息;所述注册请求消息用于使所述OLT分配与所述ONU的标识信息对应的标记区域;Send a registration request message to the OLT; Include the identification information of the ONU in the registration request message; The registration request message is used to make the OLT allocate a marked area corresponding to the identification information of the ONU;
所述接收模块601还用于:The receiving
接收所述OLT根据所述注册请求消息发送的资源分配消息,并根据所述资源分配消息建立资源空间;所述资源空间用于存储所述标识信息。A resource allocation message sent by the OLT according to the registration request message is received, and a resource space is established according to the resource allocation message; the resource space is used for storing the identification information.
从上述内容可以看出:From the above it can be seen that:
本发明实施例中,OLT接收ONU发送的获取请求消息;所述获取请求消息中包括所述目标文件的标识信息;所述OLT根据所述目标文件的标识信息,从所述OLT的存储空间中获取所述目标文件,并向所述ONU发送请求响应消息;所述请求响应消息中包括所述目标文件。本发明实施例中在OLT增设存储空间,若该存储空间中存储有目标文件,则OLT可将目标文件直接返回给用户,无需通过访问网络来获取,从而有效缩短了访问路径,明显提高了访问效率。In the embodiment of the present invention, the OLT receives the acquisition request message sent by the ONU; the acquisition request message includes the identification information of the target file; the OLT retrieves the information from the storage space of the OLT according to the identification information of the target file Obtain the target file, and send a request response message to the ONU; the request response message includes the target file. In the embodiment of the present invention, a storage space is added to the OLT. If a target file is stored in the storage space, the OLT can directly return the target file to the user without accessing the network to obtain it, thereby effectively shortening the access path and significantly improving the access efficiency.
本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, or as a computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. 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.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。Although preferred embodiments of the present invention have been described, additional changes and modifications to these embodiments may occur to those skilled in the art once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiment and all changes and modifications that fall within the scope of the present invention.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the spirit and scope of the invention. Thus, provided that these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510568118.9A CN106507224B (en) | 2015-09-08 | 2015-09-08 | Method and related device for acquiring target file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510568118.9A CN106507224B (en) | 2015-09-08 | 2015-09-08 | Method and related device for acquiring target file |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106507224A CN106507224A (en) | 2017-03-15 |
CN106507224B true CN106507224B (en) | 2020-02-07 |
Family
ID=58287585
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510568118.9A Active CN106507224B (en) | 2015-09-08 | 2015-09-08 | Method and related device for acquiring target file |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106507224B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109150927B (en) * | 2017-06-15 | 2022-01-11 | 北京京东尚科信息技术有限公司 | File issuing method and device for file storage system |
CN116684766B (en) * | 2023-07-04 | 2024-11-05 | 深圳市西迪特科技股份有限公司 | Data reading and writing method, communication equipment, optical network unit and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102195798A (en) * | 2010-03-16 | 2011-09-21 | 中兴通讯股份有限公司 | Method for upgrading optical network unit |
CN101193408B (en) * | 2006-12-01 | 2011-12-28 | 富士通株式会社 | Efficient utilization of cache servers in mobile communication system |
CN104158868A (en) * | 2014-08-06 | 2014-11-19 | 杭州华三通信技术有限公司 | File transmission method and management server |
CN104506436A (en) * | 2014-12-22 | 2015-04-08 | 上海斐讯数据通信技术有限公司 | Data message sending method for Ethernet passive optical network |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101247258B (en) * | 2007-02-12 | 2011-02-09 | 华为技术有限公司 | A service distribution method and system |
-
2015
- 2015-09-08 CN CN201510568118.9A patent/CN106507224B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101193408B (en) * | 2006-12-01 | 2011-12-28 | 富士通株式会社 | Efficient utilization of cache servers in mobile communication system |
CN102195798A (en) * | 2010-03-16 | 2011-09-21 | 中兴通讯股份有限公司 | Method for upgrading optical network unit |
CN104158868A (en) * | 2014-08-06 | 2014-11-19 | 杭州华三通信技术有限公司 | File transmission method and management server |
CN104506436A (en) * | 2014-12-22 | 2015-04-08 | 上海斐讯数据通信技术有限公司 | Data message sending method for Ethernet passive optical network |
Also Published As
Publication number | Publication date |
---|---|
CN106507224A (en) | 2017-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106933648B (en) | Method and system for multi-tenant container resource management | |
US10225871B2 (en) | Method and system for hosting network access point | |
US20160239540A1 (en) | Data Query Method and Apparatus, Server, and System | |
US10447793B2 (en) | Detecting shared access | |
US9584481B2 (en) | Host providing system and communication control method | |
CN104954468A (en) | Resource allocation method and resource allocation device | |
CN109379448B (en) | File distributed deployment method and device, electronic equipment and storage medium | |
WO2017101761A1 (en) | Method for loading drive program, and server | |
CN113691575B (en) | Communication method, device and system | |
CN113361913A (en) | Communication service arranging method, device, computer equipment and storage medium | |
WO2017107463A1 (en) | Method and apparatus for delivering cdn addresses | |
CN109729115A (en) | Realize method, apparatus, the proxy server, terminal device of distributed computing | |
CN112615945B (en) | Domain name resolution record management method and device, computer equipment and storage medium | |
CN109471713B (en) | Method and device for inquiring information | |
US11411887B2 (en) | Method and device for performing traffic control on user equipment | |
CN106507224B (en) | Method and related device for acquiring target file | |
CN110909030B (en) | Information processing method and server cluster | |
CN110958278A (en) | API gateway-based data processing method and system and API gateway | |
CN107171976B (en) | Method and device for realizing resource reservation | |
CN107547680B (en) | Data processing method and device | |
CN110933121A (en) | Connection establishing method, communication processing method and device and communication equipment | |
CN109711193B (en) | Storage space sharing method and device | |
WO2017096886A1 (en) | Content pushing method, apparatus and system | |
CN117608751A (en) | Virtual machine cloning method, virtual machine cloning device, electronic device and storage medium | |
CN113301136B (en) | Service request processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | 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 | ||
OL01 | Intention to license declared | ||
OL01 | Intention to license declared |