Data reading and writing method, communication equipment, optical network unit and storage medium
By integrating NAS functions into optical network unit (ONU) and unified resource scheduling within the scope of OLT, the problems of high cost and high usage threshold of existing NAS are solved, and low-cost data storage and network resource optimization are achieved .
Patent Information
- Application Number
- CN202310816400.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-04
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2043-07-04
AI Technical Summary
The implementation of existing NAS relies on professional storage devices, resulting in high costs and high usage thresholds, making it difficult to reduce the user's data storage and processing costs.
Integrate NAS functions into the optical network unit (ONU), receive and process data read and write instructions on the ONU through the main control chip and communication module, realize data storage and transmission, and perform unified resource scheduling and allocation within the scope of the OLT , provides distributed storage services.
It reduces the cost of NAS deployment and use, optimizes network resource configuration, enriches ONU functions, and improves the utilization rate and user experience of NAS resources.
Smart Images

Figure CN116684766B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a data reading and writing method, a communication device, an optical network unit, and a storage medium. Background Art
[0002] NAS (Network Attached Storage) is a device that is connected to the network and has data storage functions, so it is also called "network storage". As a dedicated data storage server, NAS is data-centric, completely separates storage devices from servers, and centrally manages data, thereby freeing up bandwidth, improving performance, reducing total cost of ownership, and protecting investment. However, the current implementation of NAS relies on professional storage devices, and professional storage devices are expensive, which naturally makes it difficult to reduce user costs and has a high threshold for use. Summary of the invention
[0003] In order to reduce the cost and threshold of using NAS, the present application provides a data reading and writing method, a communication device, an optical network unit and a storage medium.
[0004] In a first aspect, the present application provides an optical network unit (Optical Network Unit, optical network unit), including: a main control chip and a NAS and a communication module respectively connected to the main control chip for communication, the NAS including a data access module and a memory module;
[0005] The communication module is configured to receive data read and write instructions from an external device under the control of the main control chip, and send data read and write results corresponding to the data read and write instructions to the external device under the control of the main control chip; the NAS is configured to read and write data according to the data read and write instructions under the control of the main control chip, wherein the memory module is configured to store data from the external device; the data access module is configured to read and write data in the memory module according to the data read and write instructions under the control of the main control chip.
[0006] By adopting the above technical solution, NAS is deployed on ONU. Since ONU is deployed in almost every household and every enterprise, and the total deployment amount is huge, integrating NAS function into ONU can reduce NAS deployment cost and use cost. Moreover, compared with professional storage devices, ONU is closer to the user side that needs to use NAS function, which is conducive to reducing the consumption of overall network resources during the use of NAS and is more conducive to realizing the optimal configuration of network resources. At the same time, compared with the existing ONU, the ONU provided by this application not only provides network business services, but also adds storage services, enriching the functions of ONU.
[0007] Optionally, the communication module includes a LAN interface and a fiber optic interface, and the external device includes at least one of a local LAN device connected to the LAN interface via a LAN and an OLT (Optical Line Terminal) connected to the fiber optic interface via an optical fiber.
[0008] By adopting the above technical solution, the local area network device in the local area network under the ONU and the OLT connected to the ONU can be used as external devices to send data read and write instructions to the ONU to instruct the ONU to read and write data and return the data read and write results: when the external device is the local area network device under the ONU, the ONU can be used as a "private cloud" of the local area network device, providing data storage services for each LAN device in the local area network under the ONU, thereby lowering the threshold for using the private cloud. When the external device is an OLT, the ONU (such as the first ONU) can also provide data storage services for each LAN device in the local area network under other ONUs (such as the second ONU) connected to the OLT. Correspondingly, the data of each LAN device in the local area network under the first ONU can also be stored in the NAS on the second ONU. This solution can realize the unified scheduling and allocation of NAS resources within the scope of the OLT, realize the "distributed storage" of data, and is conducive to improving the utilization rate of NAS resources.
[0009] In a second aspect, the data reading and writing method provided by the present application is applied to any of the aforementioned ONUs, and the data reading and writing method includes:
[0010] Receive data read and write instructions sent by external devices;
[0011] Read and write data on the NAS in the ONU according to the data read and write instructions;
[0012] The data read and write results corresponding to the data read and write instructions are sent to the external device.
[0013] By adopting the above technical solution, NAS is deployed on ONU. Since ONU is deployed in almost every household and every enterprise, and the total deployment amount is huge, integrating NAS function on ONU can reduce NAS deployment cost and use cost. Moreover, compared with professional storage devices, ONU is closer to the user side that needs to use NAS function, which is conducive to reducing the consumption of overall network resources during the use of NAS service, and is more conducive to realizing the optimal configuration of network resources. At the same time, compared with the existing ONU, in the data reading and writing solution provided by this application, ONU adds storage service while providing network service, enriching the function of ONU.
[0014] Optionally, receiving a data read / write instruction sent by an external device includes: receiving a first data read / write instruction sent by a first local area network device on the optical network unit side;
[0015] Sending the data read / write result corresponding to the data read / write instruction to the external device includes: sending the first data read / write result corresponding to the first data read / write instruction to the first local area network device.
[0016] By adopting the above technical solution, the ONU can receive the first data read and write instruction sent by the first LAN device in the LAN under the ONU, and read and write data on the NAS according to the first data read and write instruction, and return the first data read and write result to the first LAN device. The ONU can serve as a "private cloud" of the first LAN device, providing data storage services for each LAN device in the LAN under the ONU, thereby lowering the threshold for using the private cloud.
[0017] Optionally, receiving the data read and write instruction sent by the external device includes: receiving a second data read and write instruction sent by an optical line terminal to which the optical network unit is connected, the second data read and write instruction is sent by a second optical network unit connected to the optical line terminal, and the second data read and write instruction is sent by a second local area network device under the second optical network unit;
[0018] Sending the data read and write result corresponding to the data read and write instruction to the external device includes: sending the second data read and write result corresponding to the second data read and write instruction to the optical line terminal, so that the optical line terminal sends the second data read and write result to the second local area network device under the second optical network unit.
[0019] Optionally, the data reading and writing method further includes:
[0020] Receiving a second data read / write instruction sent by a first local area network device under the optical network unit;
[0021] Sending the second data read-write instruction to the optical line terminal, so that the optical line terminal sends the second data read-write instruction to the second optical network unit, and instructs the second optical network unit to read and write data according to the second data read-write instruction to obtain a second data read-write result;
[0022] receiving a second data read / write result corresponding to the second data read / write instruction sent by the optical line terminal;
[0023] The second data reading and writing result is sent to the first local area network device.
[0024] By adopting the above technical solution, in the data reading and writing solution provided by the present application, an ONU (for example, the first ONU) can also provide data storage services for various LAN devices in the LAN under other ONUs (for example, the second ONU) connected to the OLT. Correspondingly, the data of various LAN devices in the LAN under the first ONU can also be stored in the NAS on the second ONU. This solution can realize the unified scheduling and allocation of NAS resources within the scope of the OLT, realize the "distributed storage" of data, and is conducive to improving the utilization rate of NAS resources.
[0025] Optionally, before reading and writing data on the NAS in the ONU according to the data read and write instruction, the method further includes:
[0026] Authentication is performed on a read / write requester that generates a data read / write instruction, and the result of the authentication is determined to be passed; the read / write requester includes at least one of a first LAN device and a second LAN device, and the strictness of the authentication of the second LAN device exceeds the strictness of the authentication of the first LAN device; the first LAN device and the second LAN device are respectively a LAN device under an optical network unit and a LAN device under a second optical network unit, and the second optical network unit and the optical network unit are connected to the same optical line terminal.
[0027] By adopting the above technical solution, in the data reading and writing solution provided by the present application, after receiving the data reading and writing instruction sent by the external device, the ONU will authenticate the read and write requester that generates the data reading and writing instruction, and will read and write data according to the data reading and writing instruction only when the result of the identity authentication is determined to be passed, so as to ensure the security of the data in the NAS on the ONU. The read and write requester includes at least one of the following: a first LAN device under the ONU, a second LAN device under the second ONU connected to the same OLT as the ONU, in some examples, the strictness of the ONU's identity authentication for the second LAN device exceeds the strictness of the identity authentication for the first LAN device, because the first LAN device itself refers to a device that communicates with the ONU through the LAN, which can originally characterize the first LAN device as being relatively safe to a certain extent. In this case, the strictness of the identity authentication for the first LAN device is relatively reduced, which can improve the response speed to the user-side data reading and writing request, thereby enhancing the user experience; it is also conducive to reducing the processing resources of the ONU consumed by the identity authentication.
[0028] In a third aspect, the present application provides a data reading and writing method, which is applied to an OLT, comprising:
[0029] Receiving a second data read / write instruction sent by a second ONU, and the second ONU accesses the OLT;
[0030] Determining the read / write position indicated by the second data read / write instruction;
[0031] Sending the second data read / write instruction to the first ONU where the read / write position is located, and the first ONU is connected to the OLT;
[0032] Receiving a second data read-write result generated by the first ONU performing data reading and writing according to the second data read-write instruction;
[0033] The second data reading and writing result is sent to the second ONU.
[0034] By adopting the above technical solution, after receiving the second data read and write instruction sent by the second ONU, the OLT will determine the read and write position indicated by the second data read and write instruction, and then send the second data read and write instruction to the first ONU where the read and write position is located, and then the OLT will receive the second data read and write result generated by the first ONU reading and writing data according to the second data read and write instruction, and send the second data read and write result to the second ONU. The OLT can act as an intermediate role to realize the transfer of data read and write instructions and data read and write results between the two ONUs, so that the LAN device under one ONU can read and write data from the NAS of another ONU, allowing the ONU to provide NAS services for the LAN devices under other ONUs, so that the unified scheduling and allocation of NAS resources can be realized within the scope of the OLT, and the "distributed storage" of data can be realized, which is conducive to improving the utilization rate of NAS resources on each ONU.
[0035] In a fourth aspect, the present application also provides a communication device, comprising a processor and a memory connected to the processor for communication, the memory storing at least one of a first data reading and writing program and a second data reading and writing program, the first data reading and writing program being executable by the processor to implement any one of the data reading and writing methods in the aforementioned second aspect; the second data reading and writing program being executable by the processor to implement the data reading and writing method in the aforementioned second aspect.
[0036] In a fifth aspect, the present application also provides a computer-readable storage medium, which stores at least one of a first data reading and writing program and a second data reading and writing program, wherein the first data reading and writing program can be executed by a processor to implement any one of the data reading and writing methods in the aforementioned second aspect; the second data reading and writing program can be executed by a processor to implement the data reading and writing method in the aforementioned third aspect.
[0037] By adopting the above technical solution, a carrier of a computer program for implementing any of the above data reading and writing methods is provided.
[0038] In summary, the present application includes at least the following beneficial technical effects:
[0039] 1. The functions of ONU are expanded so that ONU can provide network services and data storage services at the same time.
[0040] 2. Integrating NAS functions into ONU can reduce NAS deployment and usage costs.
[0041] 3. It is helpful to reduce the consumption of overall network resources during the use of NAS services, and is more conducive to the optimal configuration of network resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of the hardware structure of the ONU provided in the first embodiment of the present application;
[0043] Figure 2 A schematic diagram of the communication connection between the communication module in the ONU and the outside provided in the first embodiment of the present application;
[0044] Figure 3 The application provided in the first embodiment of the present application is Figure 1 A flow chart of a method for reading and writing data on an ONU;
[0045] Figure 4 A schematic diagram of a system architecture of a data reading and writing system provided in Embodiment 2 of the present application;
[0046] Figure 5 The application provided in the second embodiment of the present application is Figure 4 A flow chart of a data reading and writing method of a data reading and writing system;
[0047] Figure 6 A schematic diagram of a system architecture of a data reading and writing system provided in Embodiment 3 of the present application;
[0048] Figure 7 The application provided in the third embodiment of the present application is Figure 6 A flow chart of a data reading and writing method of a data reading and writing system;
[0049] Figure 8 A schematic diagram of the hardware structure of a communication device provided in Example 4 of the present application.
[0050] Description of reference numerals:
[0051] 10-ONU; 11-main control chip; 12-NAS; 121-data access module; 122-memory module; 13-communication module; 131-optical fiber interface; 132-LAN interface; 20-local LAN device; 4-data reading and writing system; 60-OLT; 61-first ONU; 62-second ONU; 63-first LAN device; 64-second LAN device; 8-communication device; 801-processor; 802-memory. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] Embodiment 1:
[0054] This embodiment first provides an ONU 10, see Figure 1 A hardware structure diagram of the ONU 10 is shown: the ONU 10 includes a main control chip 11, a NAS 12 and a communication module 13, wherein the NAS 12 and the communication module 13 are respectively connected to the main control chip 11 for communication.
[0055] The main control chip 11 is a device with processing functions in the ONU 10, which can be used as the CPU (Central Processing Unit) of the ONU 10. In some other examples, the main control chip 11 can also be a processing unit that is separately provided and communicates with the CPU of the ONU 10. It can be understood that if the main control chip 11 is the only processing device with processing functions in the ONU 10, then the main control chip 11 needs to process the network communication services on the ONU 10 in addition to controlling the communication module 13 and the NAS 12 to implement the data storage service. If the main control chip 11 is a processing device independent of the CPU in the ONU 10, the CPU in the ONU 10 can process the network communication services to implement the basic network communication functions of the ONU 10, and the main control chip 11 controls the communication module 13 and the NAS 12 to process the data storage service.
[0056] NAS12 is a device with storage function in ONU 10, which is connected to the main control chip 11 in communication. NAS12 includes a data access module 121 and a memory module 122. The memory module 122 is used to store data from external devices, which may include but is not limited to at least one of a disk array and a removable storage medium. The data access module 121 is used to write the data to be written from the external device to the memory module 122 according to the control of the main control chip 11, and read the data to be read specified by the external device from the memory module 122 according to the control of the main control chip 11, so that the main control chip 11 controls the communication module 13 to send the read data to the external device. It is understandable that NAS12 may be the only device with storage function in ONU 10. In this case, NAS12 needs to store several computer programs in addition to data of external devices. At least one of these computer programs can be executed by a processor with processing function in ONU 10 (such as CPU of ONU 10 or the aforementioned main control chip 11) to realize the network communication function of ONU 10, and at least one can be executed by a processor with processing function in ONU 10 to realize the data reading and writing function of ONU 10. In other examples, NAS12 is not the only device with storage function on ONU 10. In this case, NAS12 can be used only to store data of external devices, and computer programs on ONU 10 can be stored through other storage devices.
[0057] The communication module 13 is used to realize the communication between the ONU 10 and the external device under the control of the main control chip 11, so in this embodiment, the communication module 13 is also connected to the main control chip 11 for communication. Figure 1 As shown. It can be understood that, as an important role in the PON (Passive Optical Network) system, the ONU 10 needs to realize service communication with the OLT. As a central office device, the OLT is interconnected with the optical splitter at the user end through a single optical fiber to realize the control and management of the ONU 10. Therefore, the communication module 13 on the ONU 10 has an optical fiber interface 131. The optical fiber interface 131 of the ONU 10 communicates with the wide area network (WAN) through optical fiber, as shown in FIG. Figure 2 Meanwhile, the ONU 10 used by enterprises or home users is generally provided by operators and deployed in the enterprise or the user's home, and a local area network (LAN) is formed under the ONU 10, so the communication module 13 also has a LAN interface 132, and the LAN interface 132 communicates with the devices in the LAN, that is, the LAN devices.
[0058] Based on the hardware structure of the aforementioned ONU 10, a data reading and writing method applied to the ONU 10 is provided below. Figure 3 A flow chart of a data reading and writing method is shown:
[0059] S302: Receive a data read / write instruction sent by an external device.
[0060] ONU 10 receives data read and write instructions sent by an external device through its communication module 13. It can be understood that data read and write instructions are generally divided into data write instructions and data read instructions. Among them, the data write instruction is used to indicate that the data to be written is written to NAS12. In some examples of the present embodiment, the data write instruction includes not only the instruction information indicating the writing, but also the data to be written. In this way, after receiving the data write instruction, ONU 10 can obtain the instruction information and the data to be written by parsing the instruction, and then directly write the data to be written to the specified position of NAS12 according to the instruction information. In other examples, the data to be written is sent independently from the data write instruction, so the data write instruction only includes the instruction information, which indicates that the operation that ONU 10 needs to perform is data writing, and indicates the writing position. The data to be written will be sent through a separate data packet. The data read instruction is used to indicate that the data currently stored on NAS12 is read out and sent to an external device, and the data read instruction usually includes the position of the data to be read.
[0061] The external device in this embodiment refers to other devices outside the ONU 10. According to the above introduction, the LAN device and the OLT under the ONU 10 can communicate with the ONU 10. Therefore, in some examples of this embodiment, the external device may refer to the LAN device under the ONU 10, or may refer to the OLT to which the ONU 10 is connected.
[0062] S304: Read and write data on the NAS in the ONU according to the data read and write instruction.
[0063] After receiving the data read / write instruction, the communication module 13 of the ONU 10 transmits the data read / write instruction to the main control chip 11. The main control chip 11 parses the data read / write instruction and then controls the data access module 121 in the NAS 12 to write data to the memory module 122 according to the instruction or read data from the memory module 122 according to the instruction.
[0064] S306: Send the data read / write result corresponding to the data read / write instruction to the external device.
[0065] After the control data access module 121 completes the corresponding data write operation or data read operation according to the data read and write instruction, the main control chip 11 can generate a data read and write result corresponding to the data read and write instruction, and control the communication module 13 to send the data read and write result to the corresponding external device as a response to the data read and write instruction sent by the external device. It can be understood that if the data read and write instruction is a data write instruction, the corresponding data read and write result can include information indicating the success or failure of the data write; if the data read and write instruction is a data read instruction, the corresponding data read and write result includes the read data.
[0066] In some examples of this embodiment, ONU 10 only supports receiving data read and write instructions sent from the LAN device under the ONU 10, that is, NAS12 on the ONU 10 is only used to provide NAS services to the LAN device corresponding to the ONU 10. In this case, ONU 10 is equivalent to providing a "private cloud" service to the LAN device under it, which lowers the threshold for users to enjoy the "private cloud" service.
[0067] In some examples of this embodiment, ONU 10 not only supports receiving data read and write instructions sent from the LAN device under the ONU 10, but also supports receiving data read and write instructions sent from the OLT to which the ONU 10 is connected. The data read and write instructions sent by the OLT come from other ONUs connected to the OLT. It can be understood that other ONUs also receive data read and write instructions from their corresponding LAN devices. Therefore, the NAS service on the ONU 10 is not only for the LAN device under the ONU 10, but also for the LAN devices corresponding to other ONUs under the same OLT.
[0068] When the NAS service on the ONU 10 is directed to the LAN device under the ONU 10 and the LAN devices corresponding to other ONUs under the OLT at the same time, in order to facilitate the distinction between the ONU 10 and other ONUs when explaining the technical solution, in this embodiment, one of the ONUs is recorded as the "first ONU" and the other ONU is recorded as the "second ONU". It can be understood by those skilled in the art that the "first ONU" and the "second ONU" are only used to distinguish the two ONUs when expressing, and do not mean that the first ONU and the second ONU have substantial differences in structure and function. In some situations, the roles of the first ONU and the second ONU can also be swapped. It can be understood that the LAN device corresponding to the first ONU and the LAN device corresponding to the second ONU can be implemented by at least one of several devices such as a laptop computer, a desktop computer, a mobile phone, a PAD (tablet computer), a PDA (Personal Digital Assistant), and a wearable device. In order to distinguish the LAN device corresponding to the first ONU and the LAN device corresponding to the second ONU in terms of description, in some examples of this embodiment, the LAN device corresponding to the first ONU is recorded as "the first LAN device", and the LAN device corresponding to the second ONU is recorded as "the second LAN device". Therefore, in some examples of this embodiment, the NAS service on the first ONU is simultaneously oriented to the first LAN device and the second LAN device, and the NAS service on the second ONU is also simultaneously oriented to the first LAN device and the second LAN device. For the first ONU, the first LAN device is the LAN device on its side, and the second LAN device belongs to the LAN device on the other side; correspondingly, for the second ONU, the second LAN device is the LAN device on its side, and the first LAN device is the LAN device on the other side. Therefore, in some examples of this embodiment, the NAS resources on the ONU 10 are simultaneously open to the LAN device on its side and the LAN device on the other side.
[0069] It is understandable that when the ONU 10 provides NAS services to users, it is necessary to ensure data security and prevent data loss, data leakage, etc. caused by malicious attacks. Therefore, in some examples of this embodiment, before the main control chip 11 controls the data access module 121 to read and write data on the memory module 122 according to the data read and write instructions, it is necessary to first authenticate the requester of the data read and write, and only when the result of the identity authentication is passed, will the corresponding read operation or write operation be performed in the memory module 122 according to the data read and write instructions.
[0070] In some examples of the present embodiment, the data read and write instructions received by the communication module 13 also include information for verifying the identity of the read and write requester. Of course, in some other examples, the information for the main control chip 11 to authenticate the identity of the read and write requester can also be sent independently of the data read and write instructions, for example, before or after sending the data read and write instructions. The following is an example of the first ONU providing data storage services to the first LAN device and the second LAN device at the same time: after the first ONU receives the data read and write instructions, before reading and writing data according to the data read and write instructions, the main control chip 11 of the first ONU will verify the identity of the read and write requester. It can be understood that because the first LAN device is a device in the LAN under the first ONU, its identity reliability is relatively high. Therefore, if the read and write requester is a LAN device on this side, the first ONU has a higher trust level for it, and the strictness of the main control chip 11 in authenticating the identity of the first LAN device can be relatively low. However, if the data read / write instruction is sent through the OLT, and the corresponding data read / write requester is a LAN device on the other side, such as a second LAN device, then compared with the first LAN device, the trust level of the first ONU to the second LAN device is relatively low, and the corresponding strictness will be higher when performing identity authentication. Therefore, in this embodiment, when an ONU 10 performs identity authentication on the read / write requester according to the data read / write instruction, the strictness of the identity authentication of the LAN device on the other side exceeds the strictness of the identity authentication of the LAN device on the local side.
[0071] The ONU 10 provided in this embodiment and the data reading and writing method applied to the ONU 10, by integrating the NAS function on the ONU 10, enables the ONU 10 to not only provide network communication services, but also provide data storage services to the outside, which not only enriches the functions of the ONU 10, but also, if the ONU 10 only provides data storage services for the local area network devices on this side, users can enjoy the private cloud service based on the ONU 10; if the ONU 10 provides data storage services for the local area network devices on this side and the local area network devices on the other side at the same time, the "distributed storage" of data can be realized within the scope of the OLT, and the unified scheduling and allocation of the NAS resources of all ONUs 10 under the OLT can be realized, and the resource configuration can be optimized. In short, by deploying NAS12 on the ONU 10, compared with the deployment of professional storage devices in the related art to realize the NAS function, the solution provided in this embodiment realizes the NAS function at a relatively low deployment cost, reducing the use cost of the NAS service.
[0072] Embodiment 2:
[0073] This embodiment will explain the scheme of ONU 10 providing NAS service to the local area network device on the basis of the above-mentioned embodiment. In the subsequent explanation of the scheme of this embodiment, the data read and write instruction is referred to as the first data read and write instruction. Figure 4 The schematic diagram of the architecture of a data reading and writing system 4 is shown: the data reading and writing system 4 includes an ONU 10 and a local area network device 20 of the ONU 10 (in this embodiment, it is assumed that the ONU 10 is the first ONU and the local area network device is the first local area network device), and the two are communicatively connected. It can be understood that the local area network device 20 is communicatively connected to the local area network interface 132 on the ONU 10 via the local area network.
[0074] The following is based on Figure 4 The data reading and writing system 4 shown provides a data reading and writing method, see Figure 5 The flowchart of the data reading and writing method is shown as follows:
[0075] S502: The ONU receives a first data read / write instruction sent by a local area network device.
[0076] In some scenarios, the first data read / write instruction is a first data write instruction, and in other scenarios, the first data read / write instruction is a first data read instruction. The LAN interface of the communication module in the ONU 10 receives the first data read / write instruction from the local LAN device (such as a mobile phone, PAD, etc. in a home, a desktop computer, a laptop computer, etc. in an enterprise) 20 through the corresponding LAN.
[0077] S504. The ONU reads and writes data on the NAS in the optical network unit according to the first data read and write instruction.
[0078] After receiving the first data read / write instruction, the LAN interface in ONU 10 transmits the first data read / write instruction to the main control chip, which parses the instruction to determine the operation indicated by the first data read / write instruction and authenticates the read / write requester of the first data read / write instruction when necessary.
[0079] Subsequently, the main control chip controls the data access module in the NAS to perform a data read operation on the memory module. If the first data read / write instruction indicates data writing, the corresponding data to be written is written to the memory module; if the first data read / write instruction indicates data reading, data is read according to the storage location indicated by the first data read instruction.
[0080] After the data read and write operation of the data access module is completed, the main control chip generates a first data read and write result corresponding to the first data read and write instruction: if the first data read and write instruction is a first data read instruction, the generated first data read and write result is a first data read result, which includes the data read from the memory module by the data access module; if the first data read and write instruction is a first data write instruction, the generated first data read and write result is a first data write result, which may include a status indication representing the success or failure of the data access module to write data to the memory module. In some other examples of this embodiment, the first data write result may also include the storage location of the data.
[0081] S506. The ONU sends the first data read / write result corresponding to the first data read / write instruction to the local area network device.
[0082] After generating the first data read-write result corresponding to the first data read-write instruction, the main control chip controls the LAN interface in the communication module to send the first data read-write result to the corresponding local area network device 20, and uses the first data read-write result to respond to the first data read-write instruction sent by the local area network device 20. It can be understood that if the first data read-write result is the first data read result, the local area network device 20 on this side can display the read data to the user, and if the first data read-write result is the first data write result, the local area network device 20 on this side can also display the data write success or data write failure status to the user. In the case where the first data result includes the data storage location, the local area network device 20 on this side can also save the data storage location after receiving the first data write result, so that when the local area network device 20 on this side needs to read the part of the data later, the data storage location can be carried in the corresponding first data read instruction.
[0083] In this embodiment, the NAS resources on the ONU 10 are only for the local area network, so the ONU 10 will not receive data read and write instructions through the optical fiber interface, and will not be open to other local area network devices under other ONUs. For example, if the ONU 10 is deployed in a home, the NAS resources on the ONU 10 are the private cloud storage resources of the home, and if the ONU 10 is deployed in an enterprise, the NAS resources on the ONU 10 are the private cloud storage resources of the enterprise.
[0084] The data reading and writing method provided in this embodiment uses the ONU 10 with NAS function to provide private cloud services for the local area network device 20 under the ONU 10 at a relatively low cost, thereby lowering the threshold for using the private cloud and enriching the functions of the ONU 10. It should be understood that for the local area network device 20 under the ONU 10, it stores part of the user's data in the NAS on the ONU 10, which not only releases the storage resources originally occupied by these data on the local area network device 20 or the storage device, but also does not need to occupy the network resources of the Ethernet when reading and writing data, and does not affect the transmission rate of network services of other devices in the local area network under the ONU 10.
[0085] Embodiment three:
[0086] This embodiment will explain the scheme of the first ONU providing NAS service to the LAN device under the second ONU based on the above-mentioned embodiment. In the subsequent explanation of the scheme of this embodiment, the data read and write instruction is referred to as the second data read and write instruction.
[0087] See also Figure 6 Another architecture diagram of implementing the data reading and writing system 4 is shown: the data reading and writing system 4 includes an OLT 60, a first ONU 61, and a second ONU 62, and the data reading and writing system 4 also includes at least a local area network device under the second ONU 62. In some examples, the data reading and writing system 4 also includes a local area network device under the first ONU 61. In order to facilitate the distinction between the local area network devices under the first ONU 61 and the second ONU 62, the local area network device under the first ONU 61 is still referred to as the first local area network device 63, and the local area network device under the second ONU 62 is referred to as the second local area network device 64.
[0088] The first ONU 61 and the second ONU 62 are both connected to the OLT 60, and the optical fiber interfaces of the first ONU 61 and the second ONU 62 are connected to the OLT 60 through optical fibers. The first LAN device 63 is connected to the LAN interface of the first ONU 61 through a LAN, and the second LAN device 64 is connected to the LAN interface of the second ONU 64 through a LAN.
[0089] The following is based on Figure 6 The data reading and writing system 4 shown provides a data reading and writing method, see Figure 7 A flow chart of the data reading and writing method is shown:
[0090] S702: The second ONU receives a second data read / write instruction sent by its second local area network device.
[0091] The second data read / write instruction received by the second ONU 62 comes from the second LAN device 64 . The second LAN device 64 is a local LAN device of the second ONU 62 , but is also a foreign LAN device of the first ONU 61 .
[0092] The second data read and write instructions can be divided into second data write instructions and second data read instructions. In some examples of the present embodiment, the second data write instruction includes instruction information indicating writing, and also includes a data write location and data to be written; the second data read instruction includes instruction information indicating data reading, and may also include information indicating a data read location.
[0093] S704: The second ONU sends the second data read / write instruction to the OLT.
[0094] After receiving the second data read / write instruction, the second ONU 62 sends the second data read / write instruction to the OLT 60 , so that the OLT 60 sends the second data read / write instruction to the corresponding first ONU 61 .
[0095] S706: The OLT determines the read / write position indicated by the second data read / write instruction.
[0096] First, an optional implementation method for OLT 60 to determine the data write location when the second data read and write instruction is a second data write instruction is introduced: in some examples of this embodiment, OLT 60 can automatically determine which ONU's NAS the data to be written should be written into according to the occupancy of the NAS resources on each ONU. In this case, OLT 60 may need to understand the occupancy rate of the NAS resources on each ONU. For example, after receiving the second data write instruction, OLT 60 sends an occupancy report instruction to each ONU deployed with NAS, so that each ONU with NAS resources reports the occupancy of its own NAS resources; in other examples, each ONU deployed with NAS can actively report the occupancy of its own NAS resources to OLT 60, such as reporting at a fixed time, or reporting after each data read and write. In some other examples, when generating the second data write instruction, the LAN device under an ONU can specify which ONU's NAS the data to be written is to be written into. However, this situation usually occurs when a user of a LAN device specifies to write data into the NAS of the ONU to which the LAN device is connected. For example, the second data write instruction sent by the second LAN device 64 requires that the data to be written be written into the NAS of the second ONU 62, and the second data read and write instruction sent by the first LAN device 63 requires that the data to be written be written into the NAS of the first ONU 61. Because it is difficult for the user of the LAN device to clearly understand the situation of other ONUs under the OLT 60, and it is even more difficult to determine the NAS resource occupancy rate on each ONU, and it may only be relatively familiar with the situation of the ONU to which the LAN device is connected.
[0097] When the second data read and write instruction is a second data read instruction, since the way in which OLT 60 determines the data read position is related to the implementation of the data write scheme, this part of the content is explained later. Here, technical personnel in this field only need to understand that OLT 60 will determine the read position indicated by the second data read instruction. The read position is not necessarily the detailed storage location of the data to be read, but at least it can determine on which ONU the data to be read is.
[0098] S708. The OLT sends the second data read / write instruction to the first ONU where the read / write position is located.
[0099] Here, it is taken as an example that the OLT 60 determines that the ONU where the read / write position indicated by the second data read / write instruction is located is the first ONU 61 . Therefore, after the OLT 60 determines, it will send the second data read / write instruction to the first ONU 61 .
[0100] S710. The first ONU reads and writes data according to a second data read and write instruction and generates a second data read and write result.
[0101] After receiving the second data read and write instruction from the OLT 60, the first ONU 61 will perform data read and write operations according to the second data read and write instruction. It can be understood that the way in which the first ONU 61 performs data read and write operations according to the second data read and write instruction in this embodiment is basically the same as the way in which the ONU 10 performs data read and write operations according to the first data read and write instruction in the second embodiment: the optical fiber interface in the first ONU 61 transmits the received second data read and write instruction to the main control chip, and the main control chip can parse the second data read and write instruction, determine the operation indicated by the second data read and write instruction, and authenticate the read and write requester of the second data read and write instruction when necessary. Subsequently, the main control chip controls the data access module in the NAS to perform a data read operation on the memory module. If the second data read and write instruction indicates data writing, the corresponding data to be written is written to the memory module; if the second data read and write instruction indicates data reading, data reading is performed according to the storage location indicated by the second data read instruction. After the data read and write operation of the data access module is completed, the main control chip generates a second data read and write result corresponding to the second data read and write instruction: if the second data read and write instruction is a second data read instruction, the generated second data read and write result is a second data read result, which includes the data read from the memory module by the data access module; if the second data read and write instruction is a second data write instruction, the generated second data read and write result is a second data write result, which may include a status indication representing the success or failure of the data access module to write data to the memory module. In some other examples of this embodiment, the second data write result may also include the storage location of the data.
[0102] S712. The first ONU sends the second data reading and writing result to the OLT.
[0103] After the main control chip in the first ONU 61 generates the second data read-write result corresponding to the second data read-write instruction, the optical fiber interface in the control communication module sends the first data read-write result to the OLT 60 .
[0104] S714. The OLT sends the second data reading and writing result to the second ONU.
[0105] After receiving the second data read / write result, the OLT 60 sends it to the second ONU 62 as a response to the second data read / write instruction sent by the second ONU 62 .
[0106] S716. The second ONU sends the second data reading and writing result to the second LAN device.
[0107] After receiving the second data read-write result, the second ONU 62 will send the second data read-write result to the second LAN device 64. If the second data read-write result is the second data read result, the second LAN device 64 can display the read data to the user, and if the second data read-write result is the second data write result, the second LAN device 64 can also display the data write success or data write failure status to the user. In the case where the second data result includes the data storage location, the second LAN device 64 can also save the data storage location after receiving the second data write result, so that when the second LAN device 64 needs to read the part of data later, the data storage location can be carried in the corresponding second data read instruction.
[0108] In some examples of this embodiment, the second data writing result does not include the storage location of the data, so when the user of the second LAN device 64 under the second ONU 62 has a data reading demand, the second data reading instruction generated by the second LAN device 64 does not include the detailed storage location of the data to be read. In this case, in order to ensure that the OLT 60 knows which ONU to which the second data reading instruction should be sent after receiving it, in the data writing process, after the first ONU 61 completes the data writing, at least one of the OLT 60, the second ONU 62 and the second LAN device 64 needs to record that the ONU where the data is located is the first ONU 61, otherwise the data may not be read normally.
[0109] exist Figure 7 In the corresponding process, the first ONU 61 is an ONU that provides NAS services, and its role can be defined as a "NAS service provider", while the second ONU 62 is only a device that realizes communication between the second LAN device 64 when the first ONU 61 provides NAS services to the second LAN device 64, and its role can be defined as a "communication transitor". However, in some other scenarios, the roles of the first ONU 61 and the second ONU 62 can also be exchanged, so in some examples of this embodiment, the first ONU 61 can also realize the function of a "communication transitor": that is, the first ONU 61 can receive the second data read and write instruction sent by its local LAN device, that is, the first LAN device 63, and then send the second data read and write instruction to the OLT 60, so that the OLT 60 sends the second data read and write instruction to the second ONU 62, and instructs the second ONU 62 to read and write data according to the second data read and write instruction to obtain a second data read and write result. Subsequently, the first ONU 61 may also receive a second data read / write result corresponding to the second data read / write instruction sent by the OLT 60 , and send the second data read / write result to the first LAN device 63 .
[0110] It is understandable that in Figure 6 and Figure 7 Under the data reading and writing scheme shown, the data of the first LAN device 63 may be stored in the first ONU 61, and the data of the second LAN device 64 may also be stored in the second ONU 62. In this case, when the first LAN device 63 reads and writes data on the first ONU 61, the participation of the OLT 60 and other ONUs under the OLT 60 is not required. Correspondingly, when the second LAN device 64 reads and writes data on the second ONU 62, the participation of the OLT 60 and other ONUs under the OLT 60 is not required.
[0111] The data reading and writing method and data reading and writing system provided in this embodiment enrich the functions of the ONU by integrating the NAS function on the ONU. At the same time, an ONU provides data storage services to the local area network devices and the LAN devices on the other side at the same time, so that "distributed storage" of data can be realized within the scope of the OLT, and the unified scheduling and allocation of NAS resources of all ONUs under the OLT can be realized, thereby optimizing resource configuration.
[0112] Embodiment 4:
[0113] This embodiment provides a communication device 8, see Figure 8 A hardware structure diagram of the communication device 8 is shown: the communication device 8 includes a processor 801 and a memory 802 that is communicatively connected to the processor 801. In some examples of this embodiment, the processor 801 and the memory 802 can communicate with each other via a communication bus.
[0114] The memory 802 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function, and instructions for implementing the data reading and writing method provided in the above embodiment, etc.; the data storage area may store data involved in the data reading and writing method provided in the above embodiment, etc.
[0115] The processor 801 may include one or more processing cores. The processor 801 calls the data stored in the memory 802 by running or executing the instructions, programs, code sets or instruction sets stored in the memory 802, and performs various functions and processes data of the present application. The processor 801 may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller and a microprocessor. It is understandable that for different devices, the electronic device used to implement the above-mentioned processor 801 function can also be other, and the embodiments of the present application are not specifically limited.
[0116] In some examples of this embodiment, at least one of a first data reading and writing program and a second data reading and writing program is stored on the memory 802, wherein the first data reading and writing program can be executed by the processor 801 to implement the steps of any of the aforementioned data reading and writing methods applied to the ONU; the second data reading and writing program can be executed by the processor 801 to implement the steps of any of the aforementioned data reading and writing methods applied to the OLT. For the specific details of the ONU side process or the OLT side process of the data reading and writing method implemented by the processor 801 executing the computer program, please refer to the introduction of the aforementioned embodiment, which will not be repeated here.
[0117] Generally, when the first data read and write program is stored in the memory 802, the communication device 8 can be an ONU that can implement the data read and write method provided in the above embodiment. The specific structure of the ONU can refer to the introduction of the above embodiment and will not be repeated here. In this case, the processor 801 can include the main control chip of the ONU. In one example, all functions of the processor 801 are implemented by the main control chip; in other examples, the processor 801 includes other devices with processing functions in addition to the main control chip, such as a CPU. In this case, the functions of the processor 801 are implemented by the main control chip and other devices with processing functions. In addition, the memory 802 can include NAS. In one example, all functions of the memory 802 are implemented by NAS; in other examples, the memory 802 includes other storage media in addition to NAS. In this case, the functions of the memory 802 are implemented by NAS and other storage media. Generally, when the second data read and write program is stored in the memory 802, the communication device 8 can be an OLT that can implement the data read and write method provided in the above embodiment.
[0118] The embodiment of the present application provides a computer-readable storage medium, for example, including: a U disk, a mobile hard disk, a read-only memory module (ROM), a random access memory module (RAM), a disk or an optical disk, and other media that can store program codes. The computer-readable storage medium stores a first computer program that can be loaded by the processor 801 and execute the data reading and writing method applied to the ONU in the above embodiment, and / or the computer-readable storage medium stores a second computer program that can be loaded by the processor 801 and execute the data reading and writing method applied to the OLT in the above embodiment.
[0119] As described above, the above embodiments are only used to introduce the technical solution of the present application in detail, but the description of the above embodiments is only used to help understand the method and core idea of the present application and should not be understood as limiting the present application. Any changes or substitutions that can be easily thought of by technicians in this technical field within the technical scope disclosed in the present application should be included in the protection scope of the present application.
Claims
1. A data reading and writing method, characterized in that: Applied to an optical network unit, the optical network unit comprises: a main control chip, and a network attached storage NAS and a communication module respectively connected to the main control chip for communication, the NAS comprising a data access module and a memory module; The communication module is configured to receive data read and write instructions from an external device under the control of the main control chip, and send data read and write results corresponding to the data read and write instructions to the external device; the NAS is configured to read and write data according to the data read and write instructions under the control of the main control chip, wherein the memory module is configured to store data from the external device; the data access module is configured to read and write data in the memory module according to the data read and write instructions under the control of the main control chip; The communication module includes a local area network interface and an optical fiber interface, and the external device includes a local area network device connected to the local area network interface via a local area network and an optical line terminal connected to the optical fiber interface via an optical fiber; The data reading and writing method comprises: Receiving a data read and write instruction sent by an external device; including receiving a first data read and write instruction sent by a first local area network device on the optical network unit side; and receiving a second data read and write instruction sent by an optical line terminal connected to the optical network unit, wherein the second data read and write instruction is sent by a second optical network unit connected to the optical line terminal, and the second data read and write instruction is sent by a second local area network device under the second optical network unit; Read and write data on the NAS in the optical network unit according to the data read and write instruction; Sending the data read and write result corresponding to the data read and write instruction to the external device; including sending the first data read and write result corresponding to the first data read and write instruction to the first local area network device; and sending the second data read and write result corresponding to the second data read and write instruction to the optical line terminal, so that the optical line terminal sends the second data read and write result to the second local area network device under the second optical network unit.
2. The data reading and writing method according to claim 1, characterized in that: The data reading and writing method also includes: Receiving a second data read / write instruction sent by a first local area network device under the optical network unit; Sending the second data read / write instruction to the optical line terminal, so that the optical line terminal sends the second data read / write instruction to the second optical network unit, and instructs the second optical network unit to read and write data according to the second data read / write instruction, to obtain a second data read / write result; receiving the second data read-write result corresponding to the second data read-write instruction sent by the optical line terminal; The second data reading and writing result is sent to the first local area network device.
3. The data reading and writing method according to claim 1, characterized in that: Before reading and writing data on the NAS in the optical network unit according to the data read and write instruction, the method further includes: Authentication is performed on the read / write requester that generates the data read / write instruction, and the result of the identity authentication is determined to be passed; the read / write requester includes at least one of a first LAN device and a second LAN device, and the strictness of the identity authentication of the second LAN device exceeds the strictness of the identity authentication of the first LAN device; the first LAN device and the second LAN device are respectively a LAN device under the optical network unit and a LAN device under the second optical network unit, and the second optical network unit is connected to the same optical line terminal as the optical network unit.
4. A data reading and writing method, characterized in that: Applied to optical line terminals, including: Receiving a second data read / write instruction sent by a second optical network unit, the second optical network unit being connected to the optical line terminal; determining a read / write position indicated by the second data read / write instruction; Sending the second data read / write instruction to a first optical network unit where the read / write position is located, the first optical network unit being connected to the optical line terminal; Receiving a second data read-write result generated by the first optical network unit performing data reading and writing according to the second data read-write instruction; Sending the second data reading and writing result to the second optical network unit; The optical network unit includes: a main control chip and a network attached storage NAS and a communication module respectively connected to the main control chip for communication, wherein the NAS includes a data access module and a memory module; The communication module is configured to receive data read and write instructions from an external device under the control of the main control chip, and send data read and write results corresponding to the data read and write instructions to the external device; the NAS is configured to read and write data according to the data read and write instructions under the control of the main control chip, wherein the memory module is configured to store data from the external device; the data access module is configured to read and write data in the memory module according to the data read and write instructions under the control of the main control chip; The communication module includes a local area network interface and a fiber optic interface, and the external device includes a local area network device connected to the local area network interface via a local area network and an optical line terminal connected to the fiber optic interface via an optical fiber.
5. A communication device, characterized in that: It includes a processor and a memory connected to the processor for communication, wherein the memory stores at least one of a first data reading and writing program and a second data reading and writing program, wherein the first data reading and writing program can be executed by the processor to implement the data reading and writing method as described in any one of claims 1 to 3; and the second data reading and writing program can be executed by the processor to implement the data reading and writing method as described in claim 4.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one of a first data reading and writing program and a second data reading and writing program, wherein the first data reading and writing program can be executed by the processor to implement the data reading and writing method as described in any one of claims 1 to 3; the second data reading and writing program can be executed by the processor to implement the data reading and writing method as described in claim 4.
Citation Information
Patent Citations
Distributed network storage control method, device and distribution system
CN101447910A
ONU, OLT and information transmission method
CN104243092A
Optical network unit management method and optical network unit
CN104467951A
Method for acquiring target file and related device
CN106507224A
Data acquisition method and related equipment
CN111294112A
