Network device and data uploading method thereof
By using page queues and controllers in network devices, the problem of network units calculating the amount of uploaded data in a short time is solved, and more efficient data transmission is achieved. Multiple calculations are made through page queue upload programs and remaining queue upload programs The data size of each packet solves the problem of low transmission efficiency and significantly improves the computing speed.
Patent Information
- Application Number
- CN202311357164.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-18
- Filing Date
- 2023-10-19
- Publication Date
- 2024-11-12
AI Technical Summary
In single-point-to-multipoint communication transmission, after receiving the amount of data allowed to be uploaded and the time slot information in a short time, it is difficult for the network unit to quickly calculate data that meets the amount of data allowed to be uploaded, resulting in low data transmission efficiency.
By using page queues and controllers in network devices, the page queue upload program, the remaining queue upload program and the packet upload program are executed, and the data size of multiple packets is calculated based on the authorization size, page number and remainder parameters, and the data is uploaded gradually. The number of packet-by-packet calculations is reduced and the calculation efficiency is improved.
It significantly reduces the time when the calculation conforms to the allowed uploading of data, improves data transmission efficiency, is 75 times faster than traditional technology, and completes data upload without affecting data integrity.
Smart Images

Figure CN118945122A_ABST
Abstract
Description
Technical Field
[0001] This case is about a communication data transmission technology, in particular, a network device and a data uploading method thereof. Background Art
[0002] Generally, communication transmission is divided into upstream transmission and downstream transmission. In point-to-multipoint communication transmission (e.g., Passive Optics Network (PON)), downstream transmission is the continuous transmission of data from the line terminal to multiple network units. Upstream transmission is the transmission of data from multiple network units to the line terminal. Among them, the passive optical network is a fiber optic communication network composed of an optical line terminal (OLT), an optical network unit (ONU), and an optical distribution network (ODN).
[0003] Generally, during downlink transmission, the line terminal will send the allowed upload data amount and the allocated time slot to each network unit. Each network unit can only upload data of the allowed upload data amount in the time slot allocated by the line terminal. Traditionally, each network unit calculates data that meets the allowed upload data amount based on its stored packets one by one during the period between the time point when it receives the information such as the allowed upload data amount and the allocated time slot from the line terminal and the start time point of the allocated time slot, and uploads the data that meets the allowed upload data amount in the allocated time slot. However, as the period between the time point when the network unit receives the information such as the allowed upload data amount and the allocated time slot from the line terminal and the start time point of the allocated time slot becomes shorter and shorter, the network unit may not be able to calculate the data that meets the allowed upload data amount within this period of time based on the data stored in it. As a result, there is a huge gap between the size of the data uploaded in the allocated time slot and the size of the allowed upload data amount, which leads to a waste of efficiency. Therefore, how the network unit can quickly calculate the data that meets the allowed upload data volume during this period to increase the efficiency of the entire data transmission technology is a problem that needs to be overcome. Summary of the invention
[0004] In one embodiment, a data upload method is applicable to a network device, the network device includes a page queue, and the data upload method includes: receiving authorization information, the authorization information includes an authorization size; executing an upload program to obtain an upload queue, the upload program includes: executing a page queue upload program based on the page queue and the authorization size to obtain a first authorized remaining size and a subsequent page number; executing a remaining queue upload program based on the first authorized remaining size, the subsequent page number and the remainder parameter to obtain a subsequent packet number and a second authorized remaining size; and executing a packet upload program based on the subsequent packet number and the second authorized remaining size; and uploading the packet data stored in the upload queue through the network device.
[0005] In one embodiment, a data upload method is applicable to a network device, the network device includes a page queue, and the data upload method includes: receiving authorization information, the authorization information includes an authorization size; executing an upload program to obtain an upload queue, the upload program includes: executing a page queue upload program based on the page queue and the authorization size to obtain a first authorized remaining size and a subsequent page number; executing a remaining queue upload program based on the first authorized remaining size, the subsequent page number and the remainder parameter to obtain a subsequent packet number and a second authorized remaining size; and executing a packet upload program based on the subsequent packet number and the second authorized remaining size; and uploading the packet data stored in the upload queue through the network device. The page queue upload procedure includes: obtaining a starting page number according to a page queue, wherein the page queue has a plurality of page records in sequence, the starting page number corresponds to one of the plurality of page records, each page record includes a page size and an auxiliary queue, wherein the auxiliary queue has a plurality of packets in sequence corresponding to the page record, and the page size is the sum of the data sizes of the plurality of packets corresponding to the page record; storing the data of the packets corresponding to the page record corresponding to the starting page number and each subsequent page record in the upload queue page by page, and summing up the page sizes of the page record corresponding to the starting page number and each subsequent page record to calculate a first summed result, and after calculating the first summed result page by page, determining whether the first summed result satisfies a first stop condition, wherein the first stop condition is that the authorized size minus the first summed result is less than the page size; when the first stop condition is satisfied, using the first summed result as a first upload size, and subtracting the first upload size from the authorized size to obtain a first authorized remaining size; and obtaining a subsequent page number according to a page record subsequent to the last page record in the first summed result. The remaining queue upload procedure includes: deducting the remainder obtained by dividing the first authorized remaining size by the remainder parameter to obtain the second upload size; storing the data of the partial packets corresponding to the page record corresponding to the continuous page number in the upload queue according to the continuous page number and the second upload size, wherein the sum of the data sizes of the partial packets corresponding to the page record corresponding to the continuous page number stored in the upload queue is equal to the second upload size; obtaining a starting packet number according to the auxiliary queue of the page record corresponding to the continuous page number, the starting packet number corresponding to one of a plurality of packets, each packet respectively including the data size of a different packet; obtaining a subsequent packet number according to the starting packet number and the second upload size, the subsequent packet number corresponding to one of the plurality of packets; and deducting the second upload size from the first authorized remaining size to obtain the second authorized remaining size. The packet upload procedure includes: storing the data of the packet corresponding to the connection packet number and its subsequent packets one by one in the upload queue and summing up the data size of the packet corresponding to the connection packet number and its subsequent packets to calculate a second summed result, and after calculating the second summed results one by one, determining whether the second summed result satisfies a second stop condition, wherein the second stop condition is that the second authorized remaining size minus the second summed result is less than the data size.
[0006] In one embodiment, a network device includes a controller. The controller includes a page queue. The controller is used to execute a data upload method, the data upload method includes: receiving authorization information, the authorization information includes an authorization size; executing an upload program to obtain an upload queue, the upload program includes: executing a page queue upload program according to the page queue and the authorization size to obtain a first authorization remaining size and a continuation page number; executing a remaining queue upload program according to the first authorization remaining size, the continuation page number and a remainder parameter to obtain a continuation packet number and a second authorization remaining size; and executing a packet upload program according to the continuation packet number and the second authorization remaining size; and uploading the packet data stored in the upload queue.
[0007] In one embodiment, a network device includes a controller. The controller includes a page queue. The controller is used to execute a data upload method, the data upload method includes: receiving authorization information, the authorization information includes an authorization size; executing an upload program to obtain an upload queue, the upload program includes: executing a page queue upload program according to the page queue and the authorization size to obtain a first authorization remaining size and a continuation page number; executing a remaining queue upload program according to the first authorization remaining size, the continuation page number and a remainder parameter to obtain a continuation packet number and a second authorization remaining size; and executing a packet upload program according to the continuation packet number and the second authorization remaining size; and uploading the packet data stored in the upload queue. The page queue upload procedure includes: obtaining a starting page number according to a page queue, wherein the page queue has a plurality of page records in sequence, the starting page number corresponds to one of the plurality of page records, each page record includes a page size and an auxiliary queue, wherein the auxiliary queue has a plurality of packets in sequence corresponding to the page record, and the page size is the sum of the data sizes of the plurality of packets corresponding to the page record; storing the data of the packets corresponding to the page record corresponding to the starting page number and each subsequent page record in the upload queue page by page, and summing up the page sizes of the page record corresponding to the starting page number and each subsequent page record to calculate a first summed result, and after calculating the first summed result page by page, determining whether the first summed result satisfies a first stop condition, wherein the first stop condition is that the authorized size minus the first summed result is less than the page size; when the first stop condition is satisfied, using the first summed result as a first upload size, and subtracting the first upload size from the authorized size to obtain a first authorized remaining size; and obtaining a subsequent page number according to a page record subsequent to the last page record in the first summed result. The remaining queue upload procedure includes: deducting the remainder obtained by dividing the first authorized remaining size by the remainder parameter to obtain the second upload size; storing the data of the partial packets corresponding to the page record corresponding to the continuous page number in the upload queue according to the continuous page number and the second upload size, wherein the sum of the data sizes of the partial packets corresponding to the page record corresponding to the continuous page number stored in the upload queue is equal to the second upload size; obtaining a starting packet number according to the auxiliary queue of the page record corresponding to the continuous page number, the starting packet number corresponding to one of a plurality of packets, each packet respectively including the data size of a different packet; obtaining a subsequent packet number according to the starting packet number and the second upload size, the subsequent packet number corresponding to one of the plurality of packets; and deducting the second upload size from the first authorized remaining size to obtain the second authorized remaining size. The packet upload procedure includes: storing the data of the packet corresponding to the connection packet number and its subsequent packets one by one in the upload queue and summing up the data size of the packet corresponding to the connection packet number and its subsequent packets to calculate a second summed result, and after calculating the second summed results one by one, determining whether the second summed result satisfies a second stop condition, wherein the second stop condition is that the second authorized remaining size minus the second summed result is less than the data size. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] Figure 1 It is an application diagram of an embodiment of a network device.
[0009] Figure 2 The present invention is a flow chart of an embodiment of a data uploading method.
[0010] Figure 3 A schematic diagram of an embodiment of a page queue.
[0011] Figure 4 A schematic diagram of an embodiment of an auxiliary queue.
[0012] Figure 5 A flowchart of an embodiment of an upload procedure.
[0013] Figure 6 A flow chart of an embodiment of a page queue upload procedure.
[0014] Figure 7 A flowchart of an embodiment of the remaining queue upload procedure.
[0015] Figure 8 A schematic diagram of an embodiment of a packet upload procedure. DETAILED DESCRIPTION
[0016] This case is applied to a point-to-multipoint communication transmission architecture. For the convenience of explanation, a passive optical fiber network is used as an example to illustrate the characteristics of the present invention, but it is not a limitation of this case. Among them, a passive optical fiber network is a fiber optic communication network composed of an optical line terminal, an optical network unit, and an optical distribution network. Figure 1 FIG. 1 is an application diagram of an embodiment of the network device 10. Figure 1 .At Figure 1In the embodiment, three network devices 10 are used for illustration, but the number of network devices 10 is not limited thereto. For the convenience of explanation, the three network devices 10 are respectively referred to as network device 10A, network device 10B and network device 10C. The optical line terminal 20 is coupled to the main optical fiber 31, and the network devices 10A~10C are respectively coupled to the corresponding sub-optical fibers 33A~33C and the corresponding user terminal equipment 40A~40C. Among them, the main optical fiber 31 and the sub-optical fibers 33A~33C can be the aforementioned optical distribution network, and the network devices 10A~10C can be the aforementioned optical network unit. In some embodiments, the main optical fiber 31 and the multiple sub-optical fibers 33A~33C can be but are not limited to a one-to-many optical coupler (Optical Coupler), an optical splitter (Optical Splitter), or an optical combiner (Optical Combiner). The optical line terminal 20 is coupled to the network devices 10A-10C via the main optical fiber 31 and the sub-optical fibers 33A-33C to achieve single-point (optical line terminal 20) to multi-point (network devices 10A-10C) communication transmission. The optical line terminal 20 is used to allocate authorization information M and uplink transmission time slots to the network devices 10A-10C during downlink transmission. In some embodiments, the user terminal devices 40A-40C can be, but are not limited to, desktop computers, notebook computers, servers, etc.
[0017] For the convenience of explanation, Figure 1 Only a detailed circuit block diagram of the network device 10C is shown. Figure 2 This is a flow chart of an embodiment of a data uploading method. Figure 1 and Figure 2 The network devices 10A to 10C include a controller 11 .
[0018] The controller 11 includes a page queue 50 and is used to receive authorization information M (step S01). The authorization information M includes an authorization size S. The authorization size S is the amount of data that the optical line terminal 20 allows the network devices 10A-10C to transmit in the time slot of the uplink transmission. After receiving the authorization information M, the controller 11 executes the upload program P0 to obtain an upload queue UQ (step S02). After obtaining the upload queue UQ, the controller 11 uploads the packet data stored in the upload queue UQ (step S03).
[0019] Figure 3 FIG. 5 is a schematic diagram of an embodiment of a page queue 50. Figure 3 The page queue 50 includes a page queue header 51 and a plurality of sequential page records 52. The page queue header 51 includes a starting page number 511. Each page record 52 includes a page size 521, an auxiliary queue 522, and a page number 523. Figure 4 is a schematic diagram of an embodiment of the auxiliary queue 522. Figure 3 and Figure 4 . The auxiliary queue 522 includes an auxiliary queue head 525 and a plurality of sequential packets 526 corresponding to the page record 52. The auxiliary queue head 525 includes a starting packet number 5251. Each packet 526 includes a data size 5261 and a packet number 5262 of each packet 526. Each page record 52 can be distinguished by a page number 523. For example, a page record 52 with a page number 523 of "0" is the first page record, a page record 52 with a page number 523 of "1" is the second page record, and so on. Each packet 526 can be distinguished by a packet number 5262. For example, a packet 526 with a packet number 523 of "0" is the first packet, a packet 526 with a packet number 523 of "1" is the second packet, and so on. In some embodiments, the order of the plurality of packets 526 and the order of the plurality of page records 52 may be arranged according to the order in which the controller 11 receives packets from the corresponding user terminal devices 40A-40C.
[0020] The page size 521 is the sum of the data sizes 5261 of the multiple packets 526 corresponding to the page record 52. For example, if the first page record (page record 52 with page number 523 being "0") corresponds to the first packet to the 100th packet, the page size 521 of the first page record is the sum of the data sizes 5261 of the first packet to the 100th packet. If the second page record (page record 52 with page number 523 being "0") corresponds to the 101st packet to the 200th packet, the page size 521 of the second page record is the sum of the data sizes 5261 of the 101st packet to the 200th packet. In some embodiments, the number of the multiple packets 526 corresponding to the page record 52 can be set according to user requirements. In some embodiments, the data sizes 5261 of each packet 526 are the same and the number of the multiple packets 526 corresponding to each page record 52 is the same. In other words, in some embodiments, the page size 521 of each page record 52 is the same.
[0021] Figure 5 This is a flow chart of an embodiment of the upload procedure P0. Figures 1 to 5 . After receiving the authorization information M, the controller 11 executes the page queue upload program P1 according to the page queue 50 and the authorization size S to obtain the first authorized remaining size R1 and the subsequent page number N1 (step S11). Then, the controller 11 executes the remaining queue upload program P2 according to the first authorized remaining size R1, the subsequent page number N1 and the remainder parameter R to obtain the subsequent packet number N2 and the second authorized remaining size R2 (step S12). After the controller 11 executes the remaining queue upload program P2, the controller 11 executes the packet upload program P3 according to the subsequent packet number N2 and the second authorized remaining size R2 (step S13).
[0022] Figure 6 This is a flow chart of an embodiment of the page queue upload procedure P1. Figures 1 to 6 First, the controller 11 obtains the starting page number 511 according to the page queue 50, and the starting page number 511 corresponds to one of the plurality of page records 52 (step S21). Specifically, the starting page number 511 corresponds to the first page record 52 to be uploaded. For example, assuming that the starting page number 511 is "0", the first page record to be uploaded is the page record 52 with the page number 523 being "0".
[0023] Next, the controller 11 stores the data of the packets corresponding to the page record 52 of the starting page number 511 and the subsequent page records 52 to the upload queue UQ page by page, and sums the page sizes 521 of the page record 52 of the starting page number 511 and the subsequent page records 52 to calculate the first summed result Sum1, and after calculating the first summed result Sum1 page by page each time, determines whether the first summed result Sum1 satisfies the first stop condition S1 (step S22). The first stop condition S1 is that the authorization size S minus the first summed result Sum1 is less than the page size 521.
[0024] When the first stop condition S1 is satisfied, the controller 11 uses the first sum result Sum1 as the first upload size U1, and deducts the first upload size U1 from the authorized size S to obtain the first authorized remaining size R1 (step S23). Next, the controller 11 obtains the subsequent page number N1 according to the page record 52 following the last page record 52 in the first sum result Sum1 (step S24).
[0025] For example, assuming that the data size 5261 of each packet 526 is 80B (Bytes) and the number of packets 526 corresponding to each page record 52 is 100, that is, the page size 521 of each page record 52 is 8000B, if the authorization size S provided by the optical line terminal 20 is 78070B and the starting page number 511 is "0", the controller 11 stores the data of the 100 packets 526 corresponding to the page record 52 with the page number 523 being "0" and the subsequent page records 52 to the upload queue UQ page by page and sums the page record 52 with the page number 523 being "0" and the subsequent page records 52 with a page size 521 of 8000B to calculate the first summed result Sum1 (the first first summed result Sum1 is 8000B, the second first summed result Sum1 is 16000B, the third first summed result Sum1 is 24000B, and so on). After calculating the first summed result Sum1 page by page each time, the controller 11 determines whether the first summed result Sum1 satisfies 78070B (authorized size S) minus the first summed result Sum1 is less than 8000B (page size 521). When the first summed result Sum1 is 72000B (the ninth first summed result Sum1), 78070B (authorized size S) minus the first summed result Sum1 is 6070B, and 6070B is less than 8000B (page size 521). At this time, the controller 11 uses 72000B (the first summed result Sum1) as the first upload size U1, and deducts 72000B (the first upload size U1) from 78070B (authorized size S) to obtain the first authorized remaining size R1, and the first authorized remaining size R1 at this time is 6070B. Next, the controller 11 obtains the subsequent page number N1 according to the page record 52 that follows the last page record 52 in the first summed result Sum1. At this time, since 72000B is the ninth first summation result Sum1, the last page record 52 in the first summation result Sum1 is the page record 52 with page number 523 being "8", and the page record 52 following the last page record 52 in the first summation result Sum1 is the page record 52 with page number 523 being "9". In other words, the following page number N1 is "9".
[0026] Figure 7 This is a flow chart of an embodiment of the remaining queue upload procedure P2. Figures 1 to 7 First, the controller 11 deducts the remainder obtained by dividing the first authorized remaining size R1 by the remainder parameter R from the first authorized remaining size R1 to obtain the second upload size U2 (step S31). In some embodiments, the value of the remainder parameter R can be set according to user requirements. In some embodiments, the value of the remainder parameter R is a multiple of the data size 5261 of each packet 526.
[0027] Then, the controller 11 stores the data of the partial packet 526 corresponding to the page record 52 corresponding to the continuous page number N1 to the upload queue UQ according to the continuous page number N1 and the second upload size U2, wherein the sum of the data sizes of the partial packets 526 corresponding to the page record 52 corresponding to the continuous page number N1 stored in the upload queue UQ is equal to the second upload size U2 (step S32). Next, the controller 11 obtains the starting packet number 5251 according to the auxiliary queue 522 of the page record 52 corresponding to the continuous page number N1, and the starting packet number 5251 corresponds to one of the multiple packets 526 (step S33). Specifically, the starting packet number 5251 corresponds to the first packet 526 to be uploaded in the auxiliary queue 522. For example, assuming that the starting packet number 5251 is "0", the first packet 526 to be uploaded in the auxiliary queue 522 is the packet 526 with the packet number 5262 being "0".
[0028] Next, the controller 11 obtains the subsequent packet number N2 according to the initial packet number 5251 and the second upload size U2, and the subsequent packet number N2 corresponds to one of the plurality of packets 526 (step S34). Finally, the controller 11 deducts the second upload size U2 from the first authorized remaining size R1 to obtain the second authorized remaining size R2 (step S35).
[0029] For example, continuing the above example, assuming that the continuation page number N1 is "9" and the first authorized remaining size R1 is 6070B, if the user sets the remainder parameter R to 720B at this time, the controller 11 first deducts 310B (the remainder obtained by dividing the first authorized remaining size R1 by the remainder parameter R) from 6070B (the first authorized remaining size R1) to obtain the second upload size U2, and the second upload size U2 at this time is 5760B. Then, the controller 11 stores the data of the partial packet 526 corresponding to the page record 52 with the page number 523 being "9" to the upload queue UQ according to the continuation page number N1 and the second upload size U2, wherein the total data size of the partial packet 526 corresponding to the page record 52 corresponding to the continuation page number N1 stored in the upload queue UQ is equal to 5760B (the second upload size U2). Next, the controller 11 obtains the starting packet number 5251 according to the auxiliary queue 522 of the page record 52 whose page number 523 is "9". The starting packet number 5251 at this time is "0". Then, the controller 11 obtains the subsequent packet number N2 according to the starting packet number 5251 and the second upload size U2. Since 5760B (the second upload size U2) is 72 times of 80B (the data size 5261 of each packet 526), the subsequent packet number N2 should correspond to the 73rd packet 526. In other words, the subsequent packet number N2 at this time is "72". Finally, the controller 11 deducts 5760B (the second upload size U2) from 6070B (the first authorized remaining size R1) to obtain the second authorized remaining size R2. The second authorized remaining size R2 at this time is 310B.
[0030] Figure 8 FIG. 1 is a schematic diagram of an embodiment of the packet upload procedure P3. Figures 1 to 8 After the controller 11 executes the remaining queue upload program P2, the controller 11 stores the data of the packet 526 corresponding to the connection packet number N2 and each subsequent packet 526 to the upload queue UQ one by one and sums up the data size 5261 of the packet 526 corresponding to the connection packet number N2 and each subsequent packet 526 to calculate the second summed result Sum2. After calculating the second summed result Sum2 one by one, it is determined whether the second summed result Sum2 satisfies the second stop condition S2, wherein the second stop condition S2 is that the second authorized remaining size S2 minus the second summed result Sum2 is less than the data size 5261 (step S41).
[0031] For instance, continuing with the aforementioned example, assuming that the data size 5261 of each packet 526 is 80B, the subsequent page number N1 is “9”, the subsequent packet number N2 is “72” and the second authorized remaining size S2 is 310B, the controller 11 will store the data of the packet 526 with the packet number 5262 “72” and its subsequent packets 526 in the auxiliary queue 522 of the page record 52 with the page number 523 being “9” one by one to the upload queue UQ and sum up the data size 5261 of the packet 526 with the packet number 5262 “72” and its subsequent packets 526 in the auxiliary queue 522 of the page record 52 with the page number 523 being “9” to calculate the second summed result Sum2 (the second summed result Sum2 of the first time is 80B, the second summed result Sum2 of the second time is 160B, the third second summed result Sum2 is 240B, and so on). After calculating the second summed result Sum2 one by one each time, the controller 11 determines whether the second summed result Sum2 satisfies 310B (second authorized remaining size S2) minus the second summed result Sum2 is less than 80B (data size 5261). When the second summed result Sum2 is 240B (the third second summed result Sum2), 310B (second authorized remaining size S2) minus the second summed result Sum2 is 70B, and 70B is less than 80B (data size 5261). At this time, the packet data stored in the upload queue UQ is all the packet data that the controller 11 can upload in the time slot that can be allocated by the optical line terminal 20 for uplink transmission.
[0032] In the time slot for uplink transmission allocated by the optical line terminal 20 , the controller 11 uploads the packet data stored in the upload queue UQ to the optical line terminal 20 .
[0033] When executing the page queue upload procedure P1, the controller 11 first calculates the first upload size U1 in units of page size 521 (that is, in units of packet groups), and the first upload size U1 is the sum of the data sizes 5261 of multiple packets 526. Then, when executing the remainder queue upload procedure P2, the controller 11 calculates the second upload size U2 according to the first authorized remainder size R1 and the remainder parameter R, and the second upload size U2 is also the sum of the data sizes 5261 of multiple packets 526. Until the controller 11 executes the packet upload procedure P3, the controller 11 calculates the data size 5261 of the packet 526 packet by packet. Compared to the prior art, which calculates the data that meets the allowed upload data size packet by packet, the network device 10 proposed in this case does not calculate packet by packet during the execution of the page queue upload program P1 and the remaining queue upload program P2, but calculates the first upload size U1 and the second upload size U2 by the sum of the data sizes 5261 of multiple packets 526. It is not until the packet upload program P3 is executed that the network device 10 calculates the data size 5261 of the packet 526 packet by packet. Since the number of packet-by-packet calculations is greatly reduced, the network device 10 proposed in this case can calculate the data that meets the allowed upload data size more quickly than the prior art.
[0034] For example, continuing with the above example, assuming that the data size 5261 of each packet 526 is 80B and the authorization size S provided by the optical line terminal 20 is 78070B, if the time required for a single calculation is 12 nanoseconds (ns), if it is the prior art, since 78070B can upload a maximum of 975 packets, the time required to calculate the data that meets the allowed upload data amount is 11.7 microseconds (μs) (12ns*975=11.7μs). For the network device 10 proposed in the present case, assuming that the number of the multiple packets 526 corresponding to each page record 52 is 100, that is, the page size 521 of each page record 52 is 8000B and the remainder parameter R is set to 720B, the time taken to calculate the first upload size U1 is 108ns (12ns*9=108ns), the time taken to calculate the second upload size U2 is 12ns (12ns*1=12ns), and the time taken to calculate each packet when executing the packet upload program P3 is 36ns (12ns*3=36ns). Therefore, the time taken to calculate the data that meets the allowed upload data amount is 156ns (108ns+12ns+36ns=156ns). For the above example, the network device 10 proposed in the present case calculates the time taken to meet the allowed upload data amount 75 times faster than the prior art.
[0035] Since when the authorization size S is larger than all the packet data stored in the network device 10, it indicates that in the time slot allocated by the optical line terminal 20 for uplink transmission, the network device 10 can upload all the packet data stored in it to the optical line terminal 20, without having to calculate the data that meets the allowed upload data amount by executing the upload procedure P0. Therefore, in some embodiments, the controller 11 is further used to determine whether the authorization size S is greater than or equal to the sum of the page sizes 521 of all the multiple page records 52 in the page queue 50 after receiving the authorization information M. When the authorization size S is greater than or equal to the sum of the page sizes 521 of all the multiple page records 52 in the page queue 50, the controller 11 uploads the data of the packets 526 corresponding to all the multiple page records 52 in the page queue 50 without executing the upload procedure P0. When the authorization size S is smaller than the sum of the page sizes 521 of all the multiple page records 52 in the page queue 50, the controller 11 executes the upload procedure P0.
[0036] For example, assuming that the authorization size S provided by the optical line terminal 20 is 78070B, the data size 5261 of each packet 526 is 80B, and the number of the multiple packets 526 corresponding to each page record 52 is 100, that is, the page size 521 of each page record 52 is 8000B, if there are only 8 page records 52 in the page queue 50 at this time, at this time, because 78070B (the authorization size S) is greater than 64000B (the sum of the page sizes 521 of all the multiple page records 52 in the page queue 50), the controller 11 uploads the data of the packets 526 corresponding to the 8 page records 52 in the page queue 50, and does not execute the upload procedure P0.
[0037] When the first authorized remaining size R1 is equal to zero or less than the data size 5261, it means that the authorized size S at this time can no longer bear more upload volume. Therefore, in some embodiments, when the first authorized remaining size R1 is equal to zero or less than the data size 5261, the controller 11 uploads the packet data stored in the upload queue UQ.
[0038] When the second authorization remaining size R2 is equal to zero or less than the data size 5261, it means that the authorization size S at this time can no longer bear more upload volume. Therefore, in some embodiments, when the second authorization remaining size R2 is equal to zero or less than the data size 5261, the controller 11 uploads the packet data stored in the upload queue UQ.
[0039] In some embodiments, when the first authorized remaining size R1 is less than the remainder parameter R, the controller 11 sets the second upload size to zero. The controller 11 setting the second upload size to zero means that the controller 11 will not store any data in the upload queue UQ when executing the remaining queue upload procedure P2. In other words, the remaining packets 526 stored in the upload queue UQ will be stored in the upload queue UQ packet by packet when the controller 11 executes the packet upload procedure P3.
[0040] In some embodiments, when the first stop condition S1 is satisfied, the controller 11 further updates the start page number 511 according to the page record 52 following the last page record 52 in the first summation result Sum1 .
[0041] For example, continuing the above example, assuming that when the first stop condition S1 is satisfied, the first summed result Sum1 is the ninth first summed result Sum1, the last page record 52 in the first summed result Sum1 is the page record 52 with the page number 523 being "8", and the page record 52 following the last page record 52 in the first summed result Sum1 is the page record 52 with the page number 523 being "9". At this time, the controller 11 updates the starting page number 511 to "9".
[0042] See also Figure 3 In some embodiments, each page record 52 further includes a page full flag 524. When the first stop condition S1 is satisfied and the first authorized remaining size R1 is greater than the data size 5261, the controller 11 further sets the page full flag 524 of the page record 52 following the last page record 52 in the first summed result Sum1 to a not full value.
[0043] For example, continuing the above example, assuming that when the first stop condition S1 is satisfied, the first summed result Sum1 is the ninth first summed result Sum1, the last page record 52 in the first summed result Sum1 is the page record 52 with the page number 523 being "8", and the page record 52 following the last page record 52 in the first summed result Sum1 is the page record 52 with the page number 523 being "9". At this time, if the first authorized remaining size R1 is greater than the data size 5261, the controller 11 sets the page full flag 524 of the page record 52 with the page number 523 being "9" to a value that is not full.
[0044] In some embodiments, when the second stop condition S2 is satisfied, the controller 11 further updates the start packet number 5251 according to the packet 526 following the last packet 526 in the second summation result Sum2.
[0045] For example, continuing the above example, assuming that when the first stop condition S2 is satisfied, the second summed result Sum2 is the third second summed result Sum2, the last packet 526 in the second summed result Sum2 is the packet 526 with the packet number 5262 being "2", and the packet 526 following the last packet 526 in the second summed result Sum2 is the packet 526 with the packet number 5262 being "3". At this time, the controller 11 updates the starting packet number 5251 to "3".
[0046] In some embodiments, when the page full flag 524 of the page record 52 corresponding to the starting page number 511 is an incomplete value, the controller 11 further stores the data of the packet 526 corresponding to the starting packet number 5251 of the page record 52 corresponding to the starting page number 511 and its subsequent packets 526 to the upload queue UQ one by one, and sums up the data size 5261 of the packet 526 corresponding to the starting packet number 5251 of the page record 52 corresponding to the starting page number 511 and its subsequent packets 526 to calculate a third sum result Sum3, and updates the starting page number 511 according to the page record 52 of the page record 52 corresponding to the starting page number 511. Next, the controller 11 further stores the data of the page record 52 corresponding to the starting page number 511 and the packets 526 corresponding to each of the subsequent page records 52 into the upload queue UQ page by page, and sums up the page sizes 521 of the page record 52 corresponding to the starting page number 511 and each of the subsequent page records 52 to calculate the first summed result Sum1, and after calculating the first summed result Sum1 page by page each time, determines whether the first summed result Sum1 satisfies the third stop condition S3. The third stop condition S3 is that the authorized size S deducts the first summed result Sum1 and the third summed result Sum3 is less than the page size 521. When the third stop condition S3 is satisfied, the controller 11 further adds the first summed result Sum1 to the third summed result Sum3 as the first upload size U1 and subtracts the first upload size U1 from the authorized size S to obtain the first authorized remaining size R1.
[0047] For example, continuing the above example, assuming that the page record 52 corresponding to the starting page number 511 is the page record 52 with the page number 523 being "9", and its page full flag 524 is also a non-full value and its starting packet number 5251 is "3", the controller 11 stores the data of the packet 526 with the packet number 5262 being "3" and the subsequent packets 526 in the page record 52 with the page number 523 being "9" one by one to the upload queue UQ, and sums up the data size 5261 of the packet 526 with the packet number 5262 being "3" and the subsequent packets 526 to calculate the third summation result Sum3, and updates the starting page number 511 according to the page record 52 of the page record 52 with the page number 523 being "9". At this time, the starting page number 511 is "10". Next, the controller 11 further stores the data of the packets 526 corresponding to the page record 52 with the page number 523 of "10" and the subsequent page records 52 to the upload queue UQ page by page, and sums up the page sizes 521 of the page record 52 with the page number 523 of "10" and the subsequent page records 52 to calculate the first summed result Sum1, and after calculating the first summed result Sum1 page by page each time, determines whether the first summed result Sum1 satisfies the third stop condition S3. The third stop condition S3 is that the authorized size S deducts the first summed result Sum1 and the third summed result Sum3 is less than the page size 521. When the third stop condition S3 is satisfied, the controller 11 further adds the first summed result Sum1 to the third summed result Sum3 as the first upload size U1 and subtracts the first upload size U1 from the authorized size S to obtain the first authorized remaining size R1.
[0048] In some embodiments, when the third stop condition S3 is satisfied, the controller 11 further updates the start page number 511 according to the page record 52 following the last page record 52 in the first summation result Sum1 .
[0049] In some embodiments, in the network device as described in claim 28, when the third stop condition S3 is met and the first authorized remaining size R1 is greater than the data size 5261, the controller 11 further sets the page full flag 524 of the page record 52 following the last page record 52 in the first summation result Sum1 to a not full value.
[0050] In some embodiments, the controller 11 deducts the remainder obtained by dividing the first authorization remaining size R1 by the data size 5261 from the first authorization remaining size R1 to obtain the second upload size U2. Then, the controller 11 stores the data of the partial packet 526 corresponding to the page record 52 corresponding to the continuation page number N1 to the upload queue UQ according to the continuation page number N1 and the second upload size U2. Among them, the sum of the data sizes of the partial packets 526 corresponding to the page record 52 corresponding to the continuation page number N1 stored in the upload queue UQ is equal to the second upload size U2. Then, the controller 11 sets the second authorization remaining size R2 to zero. And because when the second authorization remaining size R2 is equal to zero or less than the data size 5261, it means that the authorization size S at this time can no longer bear more upload volume. Therefore, the controller 11 uploads the packet data stored in the upload queue UQ after setting the second authorization remaining size R2 to zero.
[0051] For example, continuing the above example, assuming that the continuation page number N1 is "9", the first authorized remaining size R1 is 6070B, and the data size 5261 is 80B, the controller 11 first deducts 70B (the remainder obtained by dividing the first authorized remaining size R1 by the data size 5261) from 6070B (the first authorized remaining size R1) to obtain the second upload size U2, and the second upload size U2 at this time is 6000B. Then, the controller 11 stores the data of the partial packet 526 corresponding to the page record 52 with the page number 523 being "9" to the upload queue UQ according to the continuation page number N1 and the second upload size U2, wherein the sum of the data sizes of the partial packets 526 corresponding to the page record 52 corresponding to the continuation page number N1 stored in the upload queue UQ is equal to 6000B (the second upload size U2). Then, the controller 11 uploads the packet data stored in the upload queue UQ. At this time, the network device 10 calculates that the time required to upload data that meets the allowed upload data amount is only 120 ns (108 ns+12 ns=120 ns).
[0052] In some embodiments, the controller 11 may be a central processing unit, a microprocessor, an application-specific integrated circuit, an embedded system, or a system-on-chip, etc. The type of the controller 11 is not limited herein.
[0053] In some embodiments, the network device 10A-10C further includes a first input / output port 12 and a second input / output port 13. The first input / output port 12 is coupled to the optical line terminal 20 via the corresponding sub-optical fibers 33A-33C and the main optical fiber 31. The second input / output port 13 is coupled to the corresponding user terminal equipment 40A-40C. The first input / output port 12 is used for transmission with the optical line terminal 20. For example, during downlink transmission, the first input / output port 12 receives authorization information and the allocated time slot from the optical line terminal 20, and in the time slot of uplink transmission, the first input / output port 12 outputs data (i.e., packets) that meet or are smaller than the authorization size to the optical line terminal 20. The second input / output port 13 is used for transmission with the corresponding user terminal equipment 40A-40C. For example, the second input / output port 13 receives packets from the corresponding user terminal equipment 40A-40C.
[0054] In some embodiments, the network devices 10A-10C further include a buffer 14. The buffer 14 is used to store data of the packets 526 corresponding to the plurality of page records 52. The buffer 14 can be a volatile storage medium, a non-volatile storage medium, or a combination thereof. The volatile storage medium is, for example, a random access memory. The non-volatile storage medium is, for example, a read-only memory. The type of the buffer 14 is not limited here.
[0055] In summary, in some embodiments, the network device 10 does not calculate packet by packet during the execution of the page queue upload procedure P1 and the remaining queue upload procedure P2, but calculates the first upload size U1 and the second upload size U2 using the sum of the data sizes 5261 of the plurality of packets 526. It is not until the packet upload procedure P3 is executed that the network device 10 calculates the data size 5261 of the packet 526 packet by packet. Since the number of packet by packet calculations is greatly reduced, the network device 10 proposed in the present case can calculate data that meets the allowed upload data amount more quickly than the prior art.
[0056] Although the technical content of this case has been disclosed as above in the preferred embodiment, it is not used to limit this case. Any slight changes and modifications made by anyone familiar with this art without departing from the spirit of this case should be included in the scope of this case. Therefore, the scope of protection of this case shall be based on the scope defined by the attached patent application.
[0057]
Explanation of symbols
[0058] 10. 10A-10C: Network devices
[0059] 11: Controller
[0060] 12: First input / output port
[0061] 13: Second input / output port
[0062] 14: Cache
[0063] 20: Optical Line Terminal
[0064] 31: Main optical fiber
[0065] 33A-33C: Sub-fiber
[0066] 40A-40C: User terminal equipment
[0067] S01-S03: Steps
[0068] 50: Page queue
[0069] 51: Page queue head
[0070] 511: Starting page number
[0071] 52: Page record
[0072] 521: Page size
[0073] 522: Auxiliary queue
[0074] 523: Page number
[0075] 524: Page full flag
[0076] 525: auxiliary queue head
[0077] 526: Packet
[0078] 5251: Starting packet number
[0079] 5261:Data size
[0080] 5262:Packet number
[0081] P0: Upload program
[0082] S11-S13: Steps
[0083] P1: Page queue upload program
[0084] S21-S24: Steps
[0085] P2: Remaining queue upload program
[0086] S31-S35: Steps
[0087] P3: Packet upload program
[0088] S41: Steps
Claims
1. A data uploading method, applicable to a network device, wherein the network device comprises a page queue, and the data uploading method comprises: receiving an authorization message, the authorization message including an authorization size; An upload procedure is executed to obtain an upload queue, the upload procedure comprising: Executing a page queue upload procedure according to the page queue and the authorized size to obtain a first authorized remaining size and a subsequent page number; Executing a remaining queue upload procedure according to the first authorized remaining size, the continuation page number and a remainder parameter to obtain a continuation packet number and a second authorized remaining size; and Execute a packet uploading procedure according to the subsequent packet number and the second authorized remaining size; and The packet data stored in the upload queue is uploaded through the network device.
2. The data uploading method as claimed in claim 1, wherein the page queue uploading procedure comprises: Obtaining a starting page number according to the page queue, wherein the page queue has a plurality of page records in sequence, the starting page number corresponds to one of the page records, each of the page records includes a page size and an auxiliary queue, wherein the auxiliary queue has a plurality of packets in sequence corresponding to the page record, and the page size is the sum of data sizes of the packets corresponding to the page record; storing the data of the packets corresponding to the page record corresponding to the starting page number and the subsequent page records to the upload queue page by page, and summing up the page sizes of the page record corresponding to the starting page number and the subsequent page records to calculate a first summed result, and after calculating the first summed result page by page each time, determining whether the first summed result satisfies a first stop condition, wherein the first stop condition is that the authorized size minus the first summed result is less than the page size; When the first stop condition is met, the first summed result is used as a first upload size, and the first upload size is deducted from the authorized size to obtain a first authorized remaining size; and The subsequent page number is obtained according to the page record following the last page record in the first summation result.
3. The data uploading method as claimed in claim 2, wherein the remaining queue uploading procedure comprises: Deducting a remainder obtained by dividing the first authorized remaining size by the remainder parameter from the first authorized remaining size to obtain a second upload size; According to the continuation page number and the second upload size, the data of the partial packet corresponding to the page record corresponding to the continuation page number is stored in the upload queue, wherein, The sum of the data sizes of the partial packets corresponding to the page record corresponding to the successive page number stored in the upload queue is equal to the second upload size; According to the auxiliary queue of the page record corresponding to the continuation page number, a start packet number is obtained, the start packet number corresponds to one of the packets, each of which includes the data size of each packet; Obtaining the subsequent packet number according to the initial packet number and the second upload size, the subsequent packet number corresponding to one of the packets; and The second upload size is deducted from the first authorized remaining size to obtain the second authorized remaining size.
4. The data uploading method as claimed in claim 3, wherein the packet uploading procedure comprises: The data of the packet corresponding to the connection packet number and each of its subsequent packets are stored one by one in the upload queue, and the data sizes of the packet corresponding to the connection packet number and each of its subsequent packets are summed up to calculate a second summed result, and after calculating the second summed results one by one, it is determined whether the second summed result satisfies a second stop condition, wherein the second stop condition is that the second authorized remaining size minus the second summed result is less than the data size.
5. The data uploading method according to claim 4, further comprising: After receiving the authorization information, determining whether the authorization size is greater than or equal to the sum of the page sizes of all the page records in the page queue; and When the authorized size is greater than or equal to the sum of the page sizes of all the page records in the page queue, data of packets corresponding to all the page records in the page queue are uploaded through the network device.
6. A network device coupled to an optical line terminal and a user terminal device, comprising: A first input / output port coupled to the optical line terminal; A controller includes a page queue, the page queue has a plurality of sequential page records, each of the page records includes a page size, and an auxiliary queue, wherein the auxiliary queue has a plurality of sequential packets corresponding to the page record, the page size is the sum of the data sizes of the packets corresponding to the page record, the controller is used to execute a data upload method, the data upload method includes: receiving an authorization message from the optical line terminal through the first input / output port, the authorization message including an authorization size; An upload procedure is executed to obtain an upload queue, the upload procedure comprising: Executing a page queue upload procedure according to the page queue and the authorized size to obtain a first authorized remaining size and a subsequent page number; Executing a remaining queue upload procedure according to the first authorized remaining size, the continuation page number and a remainder parameter to obtain a continuation packet number and a second authorized remaining size; and Execute a packet uploading procedure according to the continuous packet number and the second authorized remaining size; and Uploading the packet data stored in the upload queue to the optical line terminal through the first input / output port; A buffer, coupled to the controller, for storing the data of the packets corresponding to the page records; and A second input / output port is coupled to the user terminal device and is used for receiving data of the packets corresponding to the page records from the user terminal device.
7. The network device as claimed in claim 6, wherein the page queue uploading procedure comprises: Obtain a starting page number according to the page queue, the starting page number corresponding to one of the page records; storing data of the packets corresponding to the page record corresponding to the starting page number and the subsequent page records to the upload queue page by page, and summing up the page sizes of the page record corresponding to the starting page number and the subsequent page records to calculate a first summed result, and after calculating the first summed result page by page each time, determining whether the first summed result satisfies a first stop condition, wherein the first stop condition is that the authorized size minus the first summed result is less than the page size; When the first stop condition is met, taking the first summed result as a first upload size, and deducting the first upload size from the authorized size to obtain a first authorized remaining size; and The subsequent page number is obtained according to the page record following the last page record in the first summation result.
8. The network device as claimed in claim 7, wherein the remaining queue uploading procedure comprises: Deducting a remainder obtained by dividing the first authorized remaining size by the remainder parameter from the first authorized remaining size to obtain a second upload size; According to the continuation page number and the second upload size, the data of the partial packet corresponding to the page record corresponding to the continuation page number is stored in the upload queue, wherein, The sum of the data sizes of the partial packets corresponding to the page record corresponding to the successive page number stored in the upload queue is equal to the second upload size; According to the auxiliary queue of the page record corresponding to the continuation page number, a start packet number is obtained, the start packet number corresponds to one of the packets, each of which includes the data size of each packet; Obtaining the subsequent packet number according to the initial packet number and the second upload size, the subsequent packet number corresponding to one of the packets; and The second upload size is deducted from the first authorized remaining size to obtain the second authorized remaining size.
9. The network device as claimed in claim 8, wherein the packet uploading procedure comprises: The data of the packet corresponding to the connection packet number and each of its subsequent packets are stored one by one in the upload queue, and the data sizes of the packet corresponding to the connection packet number and each of its subsequent packets are summed up to calculate a second summed result, and after calculating the second summed results one by one, it is determined whether the second summed result satisfies a second stop condition, wherein the second stop condition is that the second authorized remaining size minus the second summed result is less than the data size.
10. The network device as claimed in claim 9, wherein the data uploading method further comprises: After receiving the authorization information, determining whether the authorization size is greater than or equal to the sum of the page sizes of all the page records in the page queue; and When the authorized size is greater than or equal to the sum of the page sizes of all the page records in the page queue, data of packets corresponding to all the page records in the page queue are uploaded.
