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
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention discloses a method for acquiring a target file and a related device. In the embodiment of the invention, an OLT receives an acquisition request message sent by an ONU; the acquisition request message comprises identification information of the target file; the OLT acquires the target file from the storage space of the OLT according to the identification information of the target file and sends a request response message to the ONU; the request response message includes the target file. In the embodiment of the invention, the OLT is additionally provided with the storage space, and if the target file is stored in the storage space, the OLT can directly return the target file to the user without acquiring the target file through an access network, so that the access path is effectively shortened, and the access efficiency is obviously improved.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method for acquiring a target file and a related apparatus.
Background
The network disk is a network storage system, can provide services of resource management such as online storage, access, backup and sharing, and can be regarded as a hard disk or a U disk placed on a network. After the user applies for the own network disk account number in the network disk, the user can access or manage the resources stored in the own network disk account number through the network login no matter where the user is.
In the prior art, taking a hundred-degree cloud disk as an example, after a user accesses a video file on the internet, the file is actively cached in a personal cloud space provided by a hundred-degree company. In practice, the cloud space of the user is stored in the IDC room server of the hundred degrees company. When the user needs to access the file again, the path for acquiring the file is as follows: the user equipment initiates an access request, and the access request reaches the machine room server of the hundred-degree company after passing through the router and the optical fiber line provided by the operator, so that the required file is acquired in the machine room server of the hundred-degree company.
Therefore, a method for efficiently acquiring a file required by a user is needed.
Disclosure of Invention
The embodiment of the invention provides a method for determining to acquire a target file and a related device, which are used for solving the technical problems of long path and slow access speed required by a user to acquire the target file in the prior art.
The method for acquiring the target file provided by the embodiment of the invention comprises the following steps:
an optical line terminal OLT receives an acquisition request message sent by an optical network unit ONU; the acquisition request message comprises identification information of a target file; the OLT acquires the target file from a storage space of the OLT according to the identification information of the target file; the OLT sends a request response message to the ONU; the request response message includes the target file.
Further, the acquiring, by the OLT, the target file from the storage space of the OLT according to the identification information of the target file includes: the OLT determines a query area for acquiring the target file in a storage space of the OLT according to the type of the acquisition request message; and the OLT acquires the target file from the query region according to the identification information of the target file.
Further, the acquisition request message further includes identification information of the ONU; the OLT determines a marking area corresponding to the identification information of the ONU in a storage space of the OLT according to the identification information of the ONU;
the determining, by the OLT according to the type of the acquisition request message, a query region in the storage space for acquiring the target file includes:
under the condition that the acquisition request message is a first acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a mark 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;
when the acquisition request message is a second acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU; the second 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 different.
Further, the acquisition request message further includes identification information of the ONU; the OLT determines a mark area and a shared area corresponding to the identification information of the ONU in a storage space of the OLT according to the identification information of the ONU;
the determining, by the OLT according to the type of the acquisition request message, a query region for acquiring the target file in a storage space of the OLT includes:
under the condition that the acquisition request message is a first acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a mark 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;
when the acquisition request message is a second acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU; the second 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 different.
Further, after the OLT determines that an inquiry area used for acquiring the target file in the storage space of the OLT is a storage space other than the mark area corresponding to the identification information of the ONU, when the acquisition request message is the second acquisition request message, the method further includes:
if the OLT acquires the target file from a storage space outside the mark area corresponding to the identification information of the ONU, storing the target file from an area outside the storage area corresponding to the identification information of the ONU to a shared area; or the like, or, alternatively,
and if the OLT determines that the storage space except the mark area corresponding to the identification information of the ONU does not comprise the target file, acquiring the target file through a network and storing the target file in the mark area corresponding to the identification information of the ONU.
Further, the request response message further includes indication information, where the indication information is used to indicate 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 the identification information.
The embodiment of the invention also provides a method for acquiring the target file, which comprises the following steps: an optical network unit ONU receives an access request message of a target file sent by a user; the access request message comprises identification information of the target file; the ONU compares the identification information of the target file with the stored identification information and sends an acquisition request message to an Optical Line Terminal (OLT) according to the comparison result; the ONU receives a request response message sent by the OLT according to the acquisition request message; the request response message comprises the target file; and the ONU sends the target file to the user.
Further, the comparing, by the ONU, the identification information of the target file with the stored identification information, and sending an acquisition request message to the OLT according to a comparison result, including: the ONU determines that the acquisition request message sent to the OLT is a first acquisition request message under the condition that the comparison result of the identification information of the target file and the stored identification information is the same; and the ONU determines that the identification information of the target file is different from the stored identification information in comparison result, and the acquisition request message sent to the OLT is a second acquisition request message.
Further, in a case that the acquisition request message is a second acquisition request message, the request response message received by the ONU further includes indication information; the indication information is used for indicating the ONU to store the identification information of the target file into a resource space of the ONU, and the resource space is used for storing the identification information.
Further, before the ONU receives the access request message of the target file sent by the user, the method further includes: the ONU sends a registration request message to the OLT; the registration request message comprises identification information of the ONU; the registration request message is used for enabling the OLT to allocate a mark area corresponding to the identification information of the ONU; the ONU receives a resource allocation message sent by the OLT according to the registration request message and establishes a resource space of the ONU according to the resource allocation message; the resource space is used for storing identification information.
An embodiment of the present invention further provides an optical line terminal OLT, including: the receiving module is used for receiving an acquisition request message sent by an optical network unit ONU; the acquisition request message comprises identification information of a target file; the processing module is used for acquiring the target file from the storage space of the OLT according to the identification information of the target file; a sending module, configured to send a request response message to the ONU; the request response message includes the target file.
Further, the processing module is specifically configured to: determining a query area for acquiring the target file in a storage space of the OLT according to the type of the acquisition request message; and acquiring the target file from the query area according to the identification information of the target file.
Further, the acquisition request message further includes identification information of the ONU; the processing module is further configured to: determining a mark area corresponding to the identification information of the ONU in the storage space of the OLT according to the identification information of the ONU;
determining, when the acquisition request message is a first acquisition request message, that an inquiry area for acquiring the target file in a storage space of the OLT is a mark 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;
determining that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU under the condition that the acquisition request message is a second acquisition request message; the second 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 different.
Further, the acquisition request message further includes identification information of the ONU; the processing module is further configured to: determining a mark area and a shared area corresponding to the identification information of the ONU in a storage space of the OLT according to the identification information of the ONU;
determining, when the acquisition request message is a first acquisition request message, that an inquiry area for acquiring the target file in a storage space of the OLT is a mark 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;
determining that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU under the condition that the acquisition request message is a second acquisition request message; the second 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 different.
Further, the processing module is further configured to: if the target file is acquired from a storage space outside the mark area corresponding to the identification information of the ONU, storing the target file from an area outside the storage area corresponding to the identification information of the ONU to a shared area; or the like, or, alternatively,
and if the storage space except the mark area corresponding to the identification information of the ONU does not contain the target file, acquiring the target file through a network, and storing the target file in the mark area corresponding to the identification information of the ONU.
Further, the request response message further includes indication information, where the indication information is used to indicate the ONU to store the identification information of the target file in a resource space of the ONU, and the resource space is used to store the identification information.
An embodiment of the present invention further provides an optical network unit ONU, where the ONU includes: the receiving module is used for receiving an access request message of a target file sent by a user; the access request message comprises identification information of the target file; receiving a request response message sent by an Optical Line Terminal (OLT) according to the acquisition request message; the request response message comprises the target file; the processing module is used for comparing the identification information of the target file with the stored identification information and sending an acquisition request message to the OLT through the sending module according to the comparison result; the sending module is configured to send an acquisition request message to the OLT, and send the target file to the user.
Further, the processing module is specifically configured to: determining that the acquisition request message sent to the OLT through the sending module is a first acquisition request message under the condition that the comparison result of the identification information of the target file and the stored identification information is the same; and under the condition that the comparison result of the identification information of the target file and the stored identification information is different, the acquisition request message sent to the OLT through the sending module is a second acquisition request message.
Further, in a case that the obtaining request message is a second obtaining request message, the request response message received by the receiving module further includes indication information; the indication information is used for indicating the ONU to store the identification information of the target file into a resource space of the ONU, and the resource space is used for storing the identification information.
Further, the sending module is further configured to: sending a registration request message to the OLT; the registration request message comprises identification information of the ONU; the registration request message is used for enabling the OLT to allocate a mark area corresponding to the identification information of the ONU; the receiving module is further configured to: receiving a resource allocation message sent by the OLT according to the registration request message, and establishing a resource space of the ONU according to the resource allocation message; the resource space is used for storing identification information.
In the above embodiment of the present invention, the OLT receives an acquisition request message sent by the ONU; the acquisition request message comprises identification information of the target file; the OLT acquires the target file from the storage space of the OLT according to the identification information of the target file and sends a request response message to the ONU; the request response message includes the target file. In the embodiment of the invention, the OLT is additionally provided with the storage space, and if the target file is stored in the storage space, the OLT can directly return the target file to the user without acquiring the target file through an access network, so that the access path is effectively shortened, and the access efficiency is obviously improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a diagram of a system architecture suitable for use with an embodiment of the present invention;
fig. 2 is a schematic diagram of a memory space of an OLT according to an embodiment of the present invention;
fig. 3 is a schematic diagram of a method for obtaining a target file according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a method for acquiring a target file according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of an OLT according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an ONU according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The system architecture according to the embodiment of the present invention may include an internet server, an OLT (Optical line terminal), a plurality of ONUs (Optical Network units), and a plurality of subscribers. The user can communicate with the corresponding ONU, the ONU can communicate with the OLT, and the OLT can communicate with the Internet server. Fig. 1 is a schematic diagram of a system architecture according to an embodiment of the present invention, where the system architecture may include an internet server 101, an OLT102, an ONU1031, an ONU1032, an ONU1033, a user 1041, a user 1042, a user 1043, a user 1044, a user 1045, and a user 1046. User 1041 and user 1042 may communicate with ONU1031, user 1043 and user 1044 may communicate with ONU1032, user 1045 and user 1046 may communicate with ONU1033, ONU1031, ONU1032 and ONU1033 may communicate with OLT102, and OLT102 may communicate with internet server 101.
The user in the 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.
The embodiment of the invention installs the storage equipment on the existing OLT and adds the intelligent management function, so that the OLT can manage the data placed by a plurality of users, thereby realizing that the users accessed by the same OLT can read the files from the storage equipment of the OLT and saving the bandwidth of a backbone network. Correspondingly, the ONU is provided with storage access capability, and the actual storage position of the storage can be located locally on the ONU or stored on the OLT side storage device. Furthermore, when the network is idle, the OLT equipment directly accesses the files on the Internet through the backbone network and caches the files on the storage equipment of the OLT equipment, and when a user needs to access the files, the files are directly accessed through the ONU, so that better response speed is provided.
Specifically, in the embodiment of the present invention, the OLT adds a storage space, and in order to facilitate the query, the OLT allocates a corresponding storage space to each ONU that initiates the registration request message. Fig. 2 is a schematic diagram of a memory space of the corresponding OLT102 in fig. 1. ONU1031, ONU1032, and ONU1033 all initiate a registration request message to OLT102, where the registration request message carries identification information of each ONU. OLT102 allocates a first mark region corresponding to identification information of ONU1031 according to the received registration request message of ONU 1031; the OLT102 allocates a second label area corresponding to the identification information of the ONU1032 according to the received registration request message of the ONU 1032; the OLT102 allocates a third label area corresponding to the identification information of the ONU1033 according to the received registration request message of the ONU 1033.
Further, to better implement information sharing, a shared area is further provided in the storage space of the OLT, and the shared area corresponds to the identification information of ONU1031, ONU1032, and ONU 1033. The OLT's memory space may also include areas that have not been allocated.
In the embodiment of the present invention, the first mark area, the second mark area, the third mark area, and the shared area may have the same or different capacities, and the specific capacities may be automatically generated by the OLT, or may be configured by a person skilled in the art according to actual situations.
In the embodiment of the invention, the ONU is additionally provided with a resource space which is used for storing the identification information. Specifically, the process of ONU1031 establishing a resource space is described as an example. OLT102 allocates a corresponding first label area to ONU1031 according to the registration request message, and then returns a resource allocation message to ONU1031, and after receiving the resource allocation message, ONU1031 establishes a resource space corresponding to the first label area in OLT102, where the resource space is used to store identification information of files accessed by user 1041 and user 1042.
With reference to fig. 1, a detailed description is given below for each stage of initiating an access request by a user, and a process of establishing a correspondence between identification information stored in a resource space of an ONU and a file in a storage space of an OLT is specifically described.
(1) Stage one
This stage is an initial stage, that is, the resource space of the ONU has not stored the identification information, and the storage space of the OLT has not stored the file.
For example, user 1041 initiates a request message to ONU1031 that wants to access file a. After receiving the request message, ONU1031 queries the identification information stored in the resource space, and sends a second acquisition request message to OLT102 when determining that there is no identification information identical to the identification information of file a. After receiving the second acquisition request message, the OLT102 may query the entire storage space to determine whether a file corresponding to the identification information of the file a, that is, the file a, exists in the storage space; the storage space other than the first mark area corresponding to the identification information of ONU1031 may be inquired. At this time, if it is determined that file a does not exist in the storage space, OLT102 accesses internet server 101 via the network, acquires file a from internet server 101, stores file a in the first flag area corresponding to the identification information of ONU1031, and returns a request response message to ONU1031, where the request response message includes file a and may further include an instruction message. After receiving the request response message, ONU1031 sends file a in the request response message to user 1041, and stores the identification information of file a to the resource space of ONU1031 according to the indication information, thereby establishing the correspondence between the identification information in the resource space of ONU1031 and the file in the first identification region.
(2) Stage two
This stage is a stage in which the user accesses the file already stored in the storage space of the OLT on the basis of stage one.
After stage one, user 1041 initiates a request message to ONU1031 again, or user 1042 initiates a request message to ONU1031, and after receiving the request message, ONU1031 queries the identification information stored in the resource space, and sends a first acquisition request message to OLT102 when determining that the identification information identical to the identification information of file a exists. After receiving the first get request message, the OLT102 may query the entire storage space to determine whether the file a exists in the storage space. Preferably, OLT102 may query only the first flag area and the shared area corresponding to the identification information of ONU1031 according to the identification information of file a in the first acquisition request message, so as to effectively save the workload of query and improve the efficiency of acquiring file a. After acquiring file a from the first mark area, OLT102 returns a request response message to ONU1031, where the request response message may only include file a. After receiving the request response message, ONU1031 transmits file a to user 1041.
(3) Stage three
This stage is a stage in which the OLT stores the file in the shared area.
After the stage one or the stage two, the user 1043 or the user 1044 initiates a request message to the ONU1032, where the request message is received by the ONU1032, the identification information stored in the resource space is queried, and when it is determined that the identification information identical to the identification information of the file a does not exist, a second acquisition request message is sent to the OLT 102. After receiving the second obtaining request message, the OLT102 may query the entire storage space to determine whether the file a exists in the storage space. Preferably, since the file a does not exist in the second label region corresponding to the identification information of the ONU1032, to save the workload of the query, the OLT102 may query, according to the identification information of the file a in the second acquisition request message, only the storage space outside the second label region corresponding to the identification information of the ONU1032, and after the query, the OLT102 acquires the file a from the first label region and returns a request response message to the ONU1032, where the request response message includes the file a and may further include an indication message. After receiving the request response message, ONU1032 sends file a in the request response message to user 1043 or 1044, and stores the identification information of file a to the resource space of ONU1032 according to the indication information.
In the above process, OLT102 acquires file a from the first flag region corresponding to the identification information of ONU1031, where file a is a file that multiple users connected to ONU1031 and ONU1032 all access, and at this time, OLT102 may store file a from the first flag region to the shared region, so that after a request message for accessing file a is initiated by a user connected to ONU1032, OLT102 may directly query the storage region (including the second flag region and the shared region) corresponding to the identification information of ONU1032, and obtain file a. Further, the correspondence between the identification information in the resource space of the ONU1032 and the file in the shared area is established in the above manner.
(4) Stage four
After the third stage, the user 1045 or the user 1046 initiates a request message for accessing the file a to the ONU1033, and after receiving the request message, the ONU1033 queries the identification information stored in the resource space, and sends a second acquisition request message to the OLT102 when determining that the identification information identical to the identification information of the file a does not exist. After receiving the second obtaining request message, the OLT102 may query the entire storage space to determine whether the file a exists in the storage space. Preferably, the OLT102 may also query only the storage space outside the third label area corresponding to the identification information of the ONU1033, so as to save the workload of the query. After querying, after acquiring the file a from the shared area, the OLT102 sends a request response message to the ONU1033, where the request response message includes the file a and may further include an indication message. After receiving the request response message, ONU1033 sends file a in the request response message to user 1045 or 1046, and stores the identification information of file a to the resource space according to the indication information, and establishes a correspondence between the identification information in the resource space of ONU1033 and the file in the shared area.
Preferably, in order to ensure that the user can acquire the target file more quickly and more smoothly, each ONU may also store part of the initial content of the file corresponding to each identification information in the resource space of the ONU. 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 is stored in the storage space of the OLT, and after a user initiates a request message for accessing the video to the ONU, the ONU sends an acquisition request message to the OLT according to the request message, and sends the stored 30M video file to the user, so as to respond to the access request of the user more quickly. After the 270M video file sent by the OLT is obtained, the 270M video file is sent to the user, so that the user can watch the video smoothly, and the problem that the video watched by the user is not smooth due to low communication speed in the initial stage communication process is effectively solved.
The method for acquiring the target file provided by the embodiment of the invention at least relates to the communication process between the OLT, the ONU and the user, and the embodiment of the invention is introduced from the perspective of the OLT and the ONU respectively.
Fig. 3 is a schematic diagram of a method for acquiring a target file according to an embodiment of the present invention, where the method is based on an angle of an OLT, and specifically includes:
In step 301, in the embodiment of the present invention, the obtaining request message may be a first obtaining request message or a second obtaining request message, where the first obtaining request message and the second obtaining request message may be distinguished by setting different identifiers, for example, an identifier bit may be added to the obtaining request message, and the identifier bit may be set to 0 or 1, and it may be assumed that when the identifier bit is 0, the obtaining request message is the first obtaining request message, and when the identifier bit is 1, the obtaining request message is the second obtaining request message.
In step 302, the OLT determines, according to the type of the acquisition request message, an inquiry area in a storage space of the OLT, where the inquiry area is used to acquire the target file, and then acquires the target file from the inquiry area according to the identification information of the target file.
In the embodiment of the invention, the determined query areas are different if the distribution conditions of the storage space in the OLT are different. The query area determined by the OLT is described in two ways below.
The first method is as follows:
the OLT allocates corresponding marking areas for the ONUs according to the identification information of the ONUs, namely, each ONU registered on the OLT corresponds to one marking area.
Specifically, after receiving an acquisition request message sent by an ONU, an OLT determines that an inquiry area for acquiring the target file in a storage space of the OLT is a mark area corresponding to identification information of the ONU, when determining that the acquisition request message is a first acquisition request message by judging a value of an identification bit. After receiving an acquisition request message sent by an ONU, an OLT determines that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to identification information of the ONU under the condition that the acquisition request message is determined to be a second acquisition request message by judging the value of the identification bit.
The second method comprises the following steps:
the OLT allocates corresponding marking areas for the ONUs according to the identification information of the ONUs, namely, each ONU registered on the OLT corresponds to one marking area. And, the memory space of the OLT also comprises a shared area.
After receiving an acquisition request message sent by an ONU, an OLT determines that an inquiry area for acquiring the target file in a storage space of the OLT is a mark area and a shared area corresponding to identification information of the ONU under the condition that the acquisition request message is determined to be a first acquisition request message by judging the value of an identification bit. After receiving an acquisition request message sent by an ONU, the OLT determines that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU under the condition that the acquisition request message is determined to be a second acquisition request message by judging the value of the identification bit.
In the embodiment of the invention, the ONU determines that the identification information of the target file is the same as the identification information stored in the resource space, which indicates that the target file is stored in the mark area and the shared area corresponding to the identification information of the ONU in the OLT, and at this time, the ONU sends a first acquisition request message to the OLT. The OLT queries the mark region and the shared region corresponding to the identification information of the ONU in a targeted manner according to the identification information in the first acquisition request message, so that the workload of querying can be effectively saved, and the efficiency of acquiring the target file is improved.
In the embodiment of the invention, the ONU determines that the identification information of the target file is different from the identification information stored in the resource space, and indicates that the target file is not stored in a mark area corresponding to the identification information of the ONU in the OLT, and at this time, the ONU sends a second acquisition request message to the OLT. The OLT queries the area outside the mark area corresponding to the identification information of the ONU in the storage space of the OLT in a targeted manner according to the identification information in the second acquisition request message, so that the workload of query can be saved, and the efficiency of acquiring the target file is improved.
In the 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 mark area corresponding to the identification information of the ONU, the target file is stored in the shared area from an area other than the storage area corresponding to the identification information of the ONU; or, if the OLT determines that the storage space other than the mark area corresponding to the identification information of the ONU does not include the target file, acquiring the target file through the network, and storing the target file in the mark area corresponding to the identification information of the ONU.
In step 303, the request response message sent by the OLT to the ONU may further include 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.
In the embodiment of the invention, the OLT is additionally provided with the storage space, and if the 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 acquiring the target file through accessing a network, so that the access path is effectively shortened, and the access efficiency is obviously improved.
Fig. 4 is a schematic diagram of a method for acquiring a target file according to a second embodiment of the present invention, where the method is based on an angle of an ONU, and specifically includes:
In step 402, the ONU compares the identification information of the target file with the identification information stored in the resource space, and sends a first acquisition request message to the OLT if the identification information of the target file is the same as the identification information stored in the resource space; and if the identification information of the target file is different from the identification information stored in the resource space, sending a second acquisition request message to the OLT.
In step 403, in a case that the obtaining request message is a second obtaining request message, the request response message received by the ONU 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.
In the embodiment of the invention, under the condition that the ONU is additionally provided with the 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 the acquisition request message to the OLT, if the target file is stored in the storage space of the OLT, the OLT can directly return the target file to the ONU and then return the target file to the user through the ONU without acquiring the target file through an access network, so that the access path is effectively shortened and the access efficiency is obviously improved.
In the above embodiment of the present invention, the OLT receives an acquisition request message sent by the ONU; the acquisition request message comprises identification information of the target file; the OLT acquires the target file from the storage space of the OLT according to the identification information of the target file and sends a request response message to the ONU; the request response message includes the target file. In the embodiment of the invention, the OLT is additionally provided with the storage space, and if the target file is stored in the storage space, the OLT can directly return the target file to the user without acquiring the target file through an access network, so that the access path is effectively shortened, and the access efficiency is obviously improved.
In view of the above method flows, an embodiment of the present invention further provides an OLT, and specific content of the OLT may be implemented with reference to the above method.
Fig. 5 is a schematic structural diagram of an OLT according to an embodiment of the present invention, where the OLT includes:
a receiving module 501, configured to receive an acquisition request message sent by an ONU; the acquisition request message comprises identification information of a target file;
a processing module 502, configured to obtain the target file from a storage space of the OLT according to the identification information of the target file;
a sending module 503, configured to send a request response message to the ONU; the request response message includes the target file.
Preferably, the processing module 502 is specifically configured to:
determining a query area for acquiring the target file in a storage space of the OLT according to the type of the acquisition request message;
and acquiring the target file from the query area according to the identification information of the target file.
Preferably, the obtaining request message further includes identification information of the ONU;
the processing module 502 is further configured to:
determining a mark area corresponding to the identification information of the ONU in the storage space of the OLT according to the identification information of the ONU;
determining, when the acquisition request message is a first acquisition request message, that an inquiry area for acquiring the target file in a storage space of the OLT is a mark 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;
determining that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU under the condition that the acquisition request message is a second acquisition request message; the second 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 different.
Preferably, the acquisition request message further includes identification information of the ONU;
the processing module 502 is further configured to:
determining a mark area and a shared area corresponding to the identification information of the ONU in a storage space of the OLT according to the identification information of the ONU;
determining, when the acquisition request message is a first acquisition request message, that an inquiry area for acquiring the target file in a storage space of the OLT is a mark area and a shared area corresponding to the identification information of the ONU; the first acquisition request message is sent when the comparison result of the identification information of the target file determined by the ONU and the identification information stored in the resource space is the same;
determining that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU under the condition that the acquisition request message is a second acquisition request message; 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 different.
Preferably, the processing module 502 is further configured to:
if the target file is acquired from a storage space outside the mark area corresponding to the identification information of the ONU, storing the target file from an area outside the storage area corresponding to the identification information of the ONU to the shared area; or the like, or, alternatively,
and if the storage space except the mark area corresponding to the identification information of the ONU does not contain the target file, acquiring the target file through a network, and storing the target file in the mark area corresponding to the identification information of the 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.
For the above method flow, an embodiment of the present invention further provides an ONU, where specific content of the ONU can be implemented with reference to the above method.
Fig. 6 is a schematic structural diagram of an ONU according to an embodiment of the present invention, where the ONU includes:
a receiving module 601, configured to receive an access request message of a target file sent by a user; the access request message comprises identification information of the target file; receiving a request response message sent by an Optical Line Terminal (OLT) according to the acquisition request message; the request response message comprises the target file;
a processing module 602, configured to compare the identification information of the target file with stored identification information, and send an acquisition request message to the OLT through a sending module 603 according to a comparison result;
the sending module 603 is configured to send an acquisition request message to the OLT, and send the target file to the user.
Preferably, the processing module 602 is specifically configured to:
determining that the comparison result between the identification information of the target file and the stored identification information is the same, an acquisition request message sent to the OLT through the sending module 603 is a first acquisition request message;
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 acquiring request message sent to the OLT through the sending module 603 is a second acquiring request message.
Preferably, in the case that the obtaining request message is a second obtaining request message, the request response message received by the receiving module 601 further includes indication information; the indication information is used for indicating the ONU to store the identification information of the target file into the resource space.
Preferably, the sending module 603 is further configured to:
sending a registration request message to the OLT; the registration request message comprises identification information of the ONU; the registration request message is used for enabling the OLT to allocate a mark area corresponding to the identification information of the ONU;
the receiving module 601 is further configured to:
receiving a resource allocation message sent by the OLT according to the registration request message, and establishing a resource space according to the resource allocation message; the resource space is used for storing the identification information.
From the above, it can be seen that:
in the embodiment of the invention, an OLT receives an acquisition request message sent by an ONU; the acquisition request message comprises identification information of the target file; the OLT acquires the target file from the storage space of the OLT according to the identification information of the target file and sends a request response message to the ONU; the request response message includes the target file. In the embodiment of the invention, the OLT is additionally provided with the storage space, and if the target file is stored in the storage space, the OLT can directly return the target file to the user without acquiring the target file through an access network, so that the access path is effectively shortened, and the access efficiency is obviously improved.
It should be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, or 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, and the like) 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 of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such 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 such modifications and variations.
Claims (14)
1. A method for obtaining a target document, the method comprising:
an optical line terminal OLT receives an acquisition request message sent by an optical network unit ONU; the acquisition request message comprises a target file and identification information of the ONU; the OLT determines a marking area corresponding to the identification information of the ONU in a storage space of the OLT according to the identification information of the ONU; under the condition that the acquisition request message is a first acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a mark 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;
when the acquisition request message is a second acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU; the second 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 different; the OLT acquires the target file from the mark area or a storage space outside the mark area according to the identification information of the target file;
the OLT sends a request response message to the ONU; the request response message includes the target file.
2. The method of claim 1, wherein the acquisition request message further includes identification information of the ONU;
the OLT determines a mark area and a shared area corresponding to the identification information of the ONU in a storage space of the OLT according to the identification information of the ONU;
the determining, by the OLT according to the type of the acquisition request message, a query region for acquiring the target file in a storage space of the OLT includes:
under the condition that the acquisition request message is a first acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a mark 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;
when the acquisition request message is a second acquisition request message, the OLT determines that a query area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU; the second 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 different.
3. The method of claim 1, wherein after the OLT determines that an inquiry area for acquiring the target file in the storage space of the OLT is a storage space other than a tag area corresponding to the identification information of the ONU, if the acquisition request message is a second acquisition request message, further comprising:
if the OLT acquires the target file from a storage space outside the mark area corresponding to the identification information of the ONU, storing the target file from an area outside the storage area corresponding to the identification information of the ONU to a shared area; or the like, or, alternatively,
and if the OLT determines that the storage space except the mark area corresponding to the identification information of the ONU does not comprise the target file, acquiring the target file through a network and storing the target file in the mark area corresponding to the identification information of the ONU.
4. The method of claim 1, wherein the request response message further includes indication information, the indication information being used to instruct the ONU to store the identification information of the target file in a resource space of the ONU, the resource space of the ONU being used to store the identification information.
5. A method for obtaining a target document, the method comprising:
an optical network unit ONU receives an access request message of a target file sent by a user; the access request message comprises identification information of the target file;
the ONU determines that the acquisition request message sent to the OLT is a first acquisition request message under the condition that the comparison result of the identification information of the target file and the stored identification information is the same;
the ONU determines that the identification information of the target file is different from the stored identification information in comparison result, and sends an acquisition request message to the OLT as a second acquisition request message;
the ONU receives a request response message sent by the OLT according to the acquisition request message; the request response message comprises the target file;
and the ONU sends the target file to the user.
6. The method according to claim 5, wherein, in case that the acquiring request message is a second acquiring request message, the request response message received by the ONU further includes indication information; the indication information is used for indicating the ONU to store the identification information of the target file into a resource space of the ONU, and the resource space is used for storing the identification information.
7. The method of claim 5, wherein before the ONU receives the access request message of the target file sent by the user, the method further comprises:
the ONU sends a registration request message to the OLT; the registration request message comprises identification information of the ONU; the registration request message is used for enabling the OLT to allocate a mark area corresponding to the identification information of the ONU;
the ONU receives a resource allocation message sent by the OLT according to the registration request message and establishes a resource space of the ONU according to the resource allocation message; the resource space is used for storing identification information.
8. An optical line termination, OLT, comprising:
the receiving module is used for receiving an acquisition request message sent by an optical network unit ONU; the acquisition request message comprises a target file and identification information of the ONU;
the processing module is used for determining a marking area corresponding to the identification information of the ONU in the storage space of the OLT according to the identification information of the ONU;
determining, when the acquisition request message is a first acquisition request message, that an inquiry area for acquiring the target file in a storage space of the OLT is a mark 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;
determining that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU under the condition that the acquisition request message is a second acquisition request message; the second 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 different; the OLT acquires the target file from the mark area or a storage space outside the mark area according to the identification information of the target file; a sending module, configured to send a request response message to the ONU; the request response message includes the target file.
9. The OLT of claim 8, wherein the get request message further includes identification information of the ONU;
the processing module is further configured to:
determining a mark area and a shared area corresponding to the identification information of the ONU in a storage space of the OLT according to the identification information of the ONU;
determining, when the acquisition request message is a first acquisition request message, that an inquiry area for acquiring the target file in a storage space of the OLT is a mark 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;
determining that an inquiry area for acquiring the target file in a storage space of the OLT is a storage space outside a mark area corresponding to the identification information of the ONU under the condition that the acquisition request message is a second acquisition request message; the second 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 different.
10. The OLT of claim 8 or 9, wherein the processing module is further configured to:
if the target file is acquired from a storage space outside the mark area corresponding to the identification information of the ONU, storing the target file from an area outside the storage area corresponding to the identification information of the ONU to a shared area; or the like, or, alternatively,
and if the storage space except the mark area corresponding to the identification information of the ONU does not contain the target file, acquiring the target file through a network, and storing the target file in the mark area corresponding to the identification information of the ONU.
11. The OLT of claim 10, wherein the request response message further includes indication information, the indication information instructing the ONU to store identification information of the target file in a resource space of the ONU, the resource space being used to store identification information.
12. An optical network unit, ONU, comprising:
the receiving module is used for receiving an access request message of a target file sent by a user; the access request message comprises 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 comprises the target file;
the processing module is used for determining that the comparison result of the identification information of the target file and the stored identification information is the same, and the acquisition request message sent to the OLT through the sending module is a first acquisition request message;
under the condition that the comparison result of the identification information of the target file and the stored identification information is different, an acquisition request message sent to the OLT through a sending module is a second acquisition request message; the sending module is configured to send an acquisition request message to the OLT, and send the target file to the user.
13. The ONU according to claim 12, wherein in a case that the get request message is a second get request message, the request response message received by the receiving module further includes indication information; the indication information is used for indicating the ONU to store the identification information of the target file into a resource space of the ONU, and the resource space is used for storing the identification information.
14. The ONU of claim 12, wherein the sending module is further configured to:
sending a registration request message to the OLT; the registration request message comprises identification information of the ONU; the registration request message is used for enabling the OLT to allocate a mark area corresponding to the identification information of the ONU;
the receiving module is further configured to:
receiving a resource allocation message sent by the OLT according to the registration request message, and establishing a resource space of the ONU according to the resource allocation message; the resource space is used for storing identification information.
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 |
CN116684766A (en) * | 2023-07-04 | 2023-09-01 | 深圳市西迪特科技股份有限公司 | 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 | 华为技术有限公司 | 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 |
---|---|---|
CN109561425B (en) | Cloud SIM card management server, binding device, management method, binding method and system | |
US11646973B2 (en) | Method for managing hardware resource, method for querying location of hardware resource, and related apparatus | |
CN105049268A (en) | Distributed computing resource allocation system and task processing method | |
CN104954468A (en) | Resource allocation method and resource allocation device | |
WO2016180182A1 (en) | Service package recommendation method and device | |
US20180227139A1 (en) | Method of Terminal-Based Conference Load-Balancing, and Device and System Utilizing Same | |
CN109151512A (en) | The method and device of content is obtained in CDN network | |
CN113361913A (en) | Communication service arranging method, device, computer equipment and storage medium | |
US11102145B2 (en) | Resource sharing method, computer device, and storage medium | |
CN109729115A (en) | Realize method, apparatus, the proxy server, terminal device of distributed computing | |
CN106571942B (en) | Configuration data updating method, client and server | |
CN110688523A (en) | Video service providing method, device, electronic equipment and storage medium | |
CN103516763B (en) | Method for processing resource and system and device | |
CN111353136B (en) | Method and device for processing operation request | |
CN106507224B (en) | Method and related device for acquiring target file | |
CN110874304A (en) | Pressure testing method, device, equipment and computer readable storage medium | |
CN105872635A (en) | Video resource distribution method and device | |
CN103973747A (en) | Method and device for acquiring content | |
WO2015197001A1 (en) | Data processing method and system based on asymmetric p2p network | |
CN105243078A (en) | File resource distribution method, system and apparatus | |
US10784982B2 (en) | Method and system for allocating wavelength channels in passive optical network, and optical line terminal | |
CN110784510A (en) | Method for accessing target service node to bus and information interaction method of service node | |
CN106028303B (en) | Intelligent device discovery method and device | |
CN115686746A (en) | Access method, task processing method, computing device, and computer storage medium | |
CN114238404A (en) | Data query method and device, storage medium and equipment |
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 |