201138366 六、發明說明: 【發明所屬之技術領域】 [0001] 本發明涉及一種網路通訊’尤其涉及一種網路裝置動態 分配系統資源的方法。 【先前技術】 [0002] 近年來隨著網際網路(Internet )快速發展,使用網際 網路協定(Internet Protocol ’ IP)位址的主機大量 增加,因此網路位址轉換(Network Address Translation , NAT ) 提供了 一種足 以解決 IP位址短缺 問題且 被普遍接受的方法9 [0003] 在NAT的管理模式下,同一條寬頻網路線路上可同時接入 複數用戶,即為複數用戶提供上網服務。不過,隨著網 路技術不斷的提升之下,早期的主從式架構(Client-201138366 VI. Description of the Invention: [Technical Field] The present invention relates to a network communication, and more particularly to a method for dynamically allocating system resources by a network device. [Prior Art] [0002] In recent years, with the rapid development of the Internet (Internet), the number of hosts using the Internet Protocol 'IP' address has increased significantly, so Network Address Translation (NAT) Providing a method that is sufficient to solve the shortage of IP addresses and is generally accepted. [0003] In the management mode of NAT, multiple users can be simultaneously accessed on the same broadband network line, that is, Internet services are provided for multiple users. However, with the continuous improvement of network technology, the early master-slave architecture (Client-
Server)樓傳輸方法已漸漸被點對點(Peer to Peer ,P2P)傳輸技術所取代’網路連線數量的需求量也大大 的增加了。 [0004] 但是,現在出現了系統資源被單一用戶的P2P連接大量佔 用’造成其他用户不能正常連接網路的情形。舉例而言 ,參閱圖1,用戶I為使用P2P軟體的用戶,其佔用了大量 的系統資源,用戶11佔用了部分系統資源,當用戶I或11 有新連線請求時,由於系統資源被用完了,新連線請求 被退回,舉例而言,出現用戶I用P2P看電影時導致用戶I 或用戶II的新連線請求被退回而不能正常上網的情形。 【發明内容】 [0005] 有鑒於此,有必要提供一種網路裝置’可動態分配系統 099112105 表單編號A0101 第4頁/共25頁 0992021459-0 201138366 資源’避免系統資源被單—用戶大量佔用 戶不能正常連接網路。 而造成其他用 [0006] 此外 故供—種網路裝置動態分配系統資源的方 法’可動態分配系統資源,避免系統資源被單—用= 量佔用而造成其他用戶不能正常連接網路。 [0007] 〇 〇 本發明實财式巾提供_路裝置用於給概用戶提供 上網服務並動態分配系統資源,其包括接收模組、判斷 模組、優先賴組、釋放模組及建立模組1收模組接 收第-用戶的連線請求封包。判斷模組判斷網路褒置的 連線資源是否使用完畢’以及在網路裝置的連線^源使 用完畢時判斷第-用戶與第二用戶的連線資源使用量的 差值是否小於臨界值。其中第二用戶為連線資源使用量 最大的用戶》優先級模組在差值小於臨界值時確定第一 用戶的現有連線資源的優先級,並判斷第一用戶的現有 連線資源中是否包含低優先級的連線資源β釋玫模組在 第一用戶的現有連線資源中包含低優先級的連線資源時 釋放第一用戶的璁有連線資源中的牴優先級的連線資源 。建立模組利用釋放的連線資源並根據連線請求封包為 第一用戶建立連線。 [0008] 本發明實施方式中提供的網路裝置動態分配系統資源的 方法包括以下步驟:接收第一用戶的連線請求封包;判 斷連線資源是否已經使用完畢;若已經使用完畢,則判 斷第一用戶與第二用戶的連線資源使用量的差值是否小 於臨界值,其中第二用戶為連線資源使用量最大的用戶 :若差值小於臨界值’則破定第一用戶的現有連線資源 099112105 表單编號Α0101 第5頁/共25頁 0992021459-0 201138366 ㈣先級;·第-用戶是否有低優先級的連線資源; 若第-用戶有低優先級連線資源,卿放第—用戶的低 優先級的連線資源;以及利用該釋放的連線資㈣㈣ 連線請求封包為該第一用戶建立連線。 [0009] [0010] [0011] 藉由以下對具體實施方式詳細的描述並結合附圖,將可 輕易的瞭解上述内容及此項發明之技術效果。 【實施方式】 請參閲圖2,所示為本發明網路裝置1〇〇一實施方式的應 用環境圖。在本實施方式中,網路裝置副—端與處於區 域網端的複數用戶I、II、ΠΙ、...N連接,另一端與網際 網路300連接,用於為複數用戶I、^、ΠΙ、…N提供上 網服務,並為複數用戶I ' U ' UI、…_態分配系統資 源。網路裝置1〇〇總共可提供1024個連線資源。在本實施 方式中,用戶I、II、ΙΠ、·_.Ν可以為區域網中的個人電 腦、筆记本電腦、個人數位助理(pj)A )等可以上網的通 訊裝置。 請參閲圖3,所示為本發明網路裝置1 〇〇一實施方式的模 組圖。在本實施方式中,網路裝置1〇〇包括接收模組1〇2 、判斷模組104、優先級模組1〇6、釋放模組108、建立 模組110及處理器116。處理器116用於執行接收模組1〇2 、判斷模组104、優先級模組1〇6、釋放模組108及建立 模組11 0。 接收模組102接收第一用戶發送的連線請求封包。其中, 第一用戶為圖1中複數用戶j、Π、III、...N其中之一。 099112105 表單編號A0101 第6頁/共25頁 0992021459-0 [0012] 201138366 [0013] 斷模組1()4在該接收模組1()2接收到第一用戶發送的連 線請求封包時判斷網路裝置1〇〇的連線資源是否使用完畢 [0014]在本實轭方式中,判斷模組1 〇4還用於在網路裝置1 〇〇的 連線Η源使用完畢時判斷第一用戶與第二用戶的連線資 源使用量的差值是否小於臨界值。在本實施方式中,第 二用戶為圖1中複數用戶卜U、Ιπ、...N中連線資源使 用量最大的用戶。在本實施方式中,臨界值為5〇。 ❹The Server) transmission method has gradually been replaced by Peer to Peer (P2P) transmission technology. The demand for the number of network connections has also increased significantly. [0004] However, there has been a situation in which system resources are heavily occupied by a single user's P2P connection, causing other users to fail to connect to the network normally. For example, referring to FIG. 1, user I is a user who uses P2P software, which occupies a large amount of system resources, and user 11 occupies part of system resources. When user I or 11 has a new connection request, system resources are used. After that, the new connection request is returned. For example, when the user 1 uses P2P to watch a movie, the user 1 or the user II's new connection request is returned and cannot be accessed normally. SUMMARY OF THE INVENTION [0005] In view of this, it is necessary to provide a network device 'dynamic allocation system 099112105 Form No. A0101 Page 4 / Total 25 Page 0992021459-0 201138366 Resources 'avoid system resource sheets - users can not account for a large number of users Connect to the network normally. The other method used to dynamically allocate system resources to the network device can dynamically allocate system resources to prevent system resources from being used by the single-use amount, causing other users to fail to connect to the network. [0007] The present invention provides a virtual device for providing an Internet service to a user and dynamically allocating system resources, including a receiving module, a determining module, a priority group, a releasing module, and a building module. The receiving module receives the first-user connection request packet. The judging module judges whether the connection resource of the network device is used up or not, and determines whether the difference between the connection resource usage of the first user and the second user is less than a critical value when the connection of the network device is completed. . The second user is the user with the largest usage of the connection resource. The priority module determines the priority of the existing connection resource of the first user when the difference is less than the threshold, and determines whether the existing connection resource of the first user is The low-priority connection resource beta release module releases the connection priority of the first user's existing connection resources when the first user's existing connection resources include low priority connection resources. Resources. The setup module utilizes the released connection resources and establishes a connection for the first user based on the connection request packet. The method for dynamically allocating system resources by the network device provided by the embodiment of the present invention includes the following steps: receiving a connection request packet of the first user, determining whether the connection resource has been used, and determining whether the connection resource has been used; Whether the difference between the usage resource usage of the user and the second user is less than a critical value, wherein the second user is the user with the largest connection resource usage: if the difference is less than the critical value, the existing connection of the first user is broken. Line resource 099112105 Form number Α0101 Page 5 / Total 25 page 0992021459-0 201138366 (4) First level; · The first user has low priority connection resources; If the first user has low priority connection resources, Qing put a first-user low-priority connection resource; and a connection request (4) (4) connection request packet for the first user to establish a connection. [0011] The above and the technical effects of the invention will be readily understood by the following detailed description of the embodiments and the accompanying drawings. [Embodiment] Please refer to Fig. 2, which shows an application environment diagram of a network device 1 according to an embodiment of the present invention. In this embodiment, the network device sub-end is connected to the plurality of users I, II, ΠΙ, . . . at the regional network end, and the other end is connected to the Internet 300 for use by the plurality of users I, ^, ΠΙ , ... N provides Internet services, and allocates system resources for multiple users I ' U ' UI, ... _ state. The network device 1 can provide a total of 1024 connection resources. In the present embodiment, the users I, II, ΙΠ, _. Ν may be personal communication devices such as personal computers, notebook computers, personal digital assistants (pj) A) in the local area network. Referring to Figure 3, there is shown a block diagram of an embodiment of a network device 1 of the present invention. In the present embodiment, the network device 1 includes a receiving module 1〇2, a determining module 104, a priority module 1〇6, a releasing module 108, an establishing module 110, and a processor 116. The processor 116 is configured to execute the receiving module 1〇2, the determining module 104, the priority module 1〇6, the releasing module 108, and the establishing module 110. The receiving module 102 receives the connection request packet sent by the first user. The first user is one of the plurality of users j, Π, III, . . . N in FIG. 099112105 Form No. A0101 Page 6 / Total 25 Page 0992021459-0 [0012] 201138366 [0013] The disconnect module 1 () 4 is determined when the receiving module 1 () 2 receives the connection request packet sent by the first user Whether the connection resource of the network device 1 is used or not [0014] In the conjugate mode, the determination module 1 〇4 is further used to determine the first when the connection source of the network device 1 is used. Whether the difference between the usage resource usage of the user and the second user is less than a critical value. In the present embodiment, the second user is the user who maximizes the usage of the connection resources in the plurality of users U, Ιπ, ... N in FIG. In the present embodiment, the critical value is 5 〇. ❹
_] i先簡組丨〇6在第_用戶與第二用戶的連線資源使用量 的差值小於臨界值_定第—好的财連線f源的優 先級在本實施方式中,當速線資源符合以下4個條件之 一時可破定該連線資源為高優先級:⑴連線是由網際 網路300來建立;⑴連線由區域網内部的用戶卜η、 HI ' ·,·Ν建立的且符合埠轉發(p〇rt f〇rwarding)規 則的連線;(3)連線由區域網内部的用戶丨、π、πι、 ...Ν建立的目的璋號··;⑷連線由區域網内部 的用戶I、II、III、...Ν建立,且目的璋號符合圖4所示 。優先級模組106將不符合上述4個條件的連線資源確定 為低優先級》 [〇_在本發明其他實财式巾,第—用戶與第二心可以是 同-用戶。若第-用戶與第二用戶為同一用戶,則優先 級模組106直接判斷第一用戶的連線資源中是否有低優先 級的連線資源。 [0017]在本實施方式中,優先級模組1〇6還在第—用戶與第二用 099112105 表單編號Α0Ι01 第7頁/共25頁 0992021459-0 201138366 [0018] [0019] [0020] [0021] 099112105 戶的連線資源使用量的差值小於臨界值時判斷第一用戶 的現有連線資源中是否有低優先級,若有低優先級,則 釋放模組108釋放第一用戶的低優先級的連線資源。 在本實施方式中,優先級模組106還用於在第—用戶與第 一用戶的連線資源使用量的差值不小於臨界值時確定第 一用戶的現有連線資源的優先級,並判斷第二用戶的現 有連線資源中是否有低優先級的連線資源。在本實施例 中,第二用戶的現有連線資源的優先級的確定方法與第 一用戶的現有連線資源的優先級的確定方法相同,因此 不再贅述。 建立模組UG利用釋放模組刚釋放的連線資源並根據連 線請求封包為第-用戶建立連線β在本實施方式中建 立模組11G還為第-用戶建立連線項目,其中連線項目包 括第一用戶的區域網的網際網路協定位址與公共的網際 網路協定位址之間的對照關舞。 在本實施方式中,建立模組11〇還在第一用戶與第二用戶 的連線資源使用量的差值小於臨界值且第一用戶的現有 連線資源中沒有低優先級的連線資源時拒絕第一用戶的 連線請求。 在本實施方式中,建立模組11()在第二好的現有連線資 源中沒有低優纽的連線資源時拒絕第_用戶的連線請 求。 ’、他實施方式中’建立模組還用於在網路裝置刚 的連線Μ沒有❹完畢_収有❹完畢的連線資 第8頁/共25頁 表單編號Α0101 [0022] 201138366 [0023] [0024]Ο [0025] Ο 源為第一用戶建立連線及連線項目。 網路裝置100還包括轉送模組112與連線對照寄存器114 。在本實施方式中,轉送模組112將第一用戶的區域網的 網際網路協定位址轉換為公共的網際網路協定位址,並 根據公共的網際網路協定位址將第一用戶的連線請求封 包轉送至網際網路300。 連線對照寄存器114儲存第一用戶新建立的連線項目。在 本實施方式中,第一用戶的連線項目包括第一用戶的區 域網的IP位址與公共的(Public) IP位址之間的對照關 係。 本發明實施方式中的網路裝置100藉由判斷模組104、優 先級模組106及釋放模組108來判斷複數用戶中連線資源 使用量最大的第二用戶使用的連線資源量與第一用戶使 用的連線資源量的差值是否小於臨界值來決定釋放哪一 個用戶的低優先級連線資源,並利用釋放的低優先級連 線資源為第一用戶的新連線請求建立連線,從而有效的 解決了在單一用戶佔用大量連線資源時第一用戶也能建 立連線。 [0026] 參閱圖5,所示為本發明網路裝置100動態分配系統資源 一實施方式的示意圖。在本實施方式中,PI、P2分別表 示連線資源的高優先級與低優先級。在本實施方式中, 用戶I與用戶II先向網路裝置100發送連線請求,網路裝 置100將可用的系統資源分配給用戶I與用戶11,正常的 為用戶I與用戶II轉送連線封包至網際網路300。其中, 099112105 表單編號A0101 第9頁/共25頁 0992021459-0 201138366 用戶II為使用點對點(peer to Peer,P2P)軟體的用 戶’其佔用了大量的系統資源。 [0027] [0028] [0029] [0030] 然後’用戶I向網路裝置1〇〇發送新連線請求,由於用戶 11佔用了大量的系統資源,且用戶I佔用了部分的系統資 源,網路裝置1 〇 〇沒有可用的系統資源分配給用戶I的新 連線請求。 此時,由於用戶II是佔用的連線資源量最大的用戶,所 以網路裝置100先判斷用戶j與用戶π的連線資源使用量 的差值疋否小於臨界值《若差值小於臨界值,則網路裝 置100確定出用戶I所有連線資源的優先級,並釋放用戶J 的低優先級的連線資源。然後網路裝置100利用釋放的低 優先級資源為用戶I的新連線請求建立連線。 相反地,若用戶I與用戶Π的連線資源使用量的差值不小 於臨界值,則網路裝置100確定出用戶II所有連線資源的 優先級,並釋放用戶II的低優先級的連線資源。然後網 路裝置100利用釋放的低優先級資源為自戶丨的新連線請 求建立連線。 請參閱圖6,所示本發明網路裝置100動態分配系統資源 另一實施方式的示意圖。在本實施方式中,P1、Ρ2分別 表示連線資源的高優先級與低優先級。在本實施方式中 ,用戶I與用戶II先向網路裝置100發送連線請求,網路 裝置100將可用的系統資源分配給用戶I與用戶π,正常 的為用戶I與用戶π轉送連線封包至網際網路。用戶I 為使用點對點(Peer to peer,Ρ2Ρ)軟體的用戶其 099112105 表單編號Α0101 第10頁/共25頁 0992021459-0 201138366 佔用了大量的系統資源。由此可知,當用戶】有新連線喑 求時,網路裝置100判斷連線資源使用量最大的用戶與請 求連線的用戶均為用戶!,因此網路裝置100確定出用戶I 所有連線資源的優先級,並釋放用戶丨的低優先級的連線 資源。然後網路裝置! 00利用釋放的低優先級資源為用戶 I的新連線請求建立連線。 [0031] 請參閱圖7,所示為本發明網路裝置100動態分配系統資 源的方法一實施方式的流程圖。在本實施方式中,該方 Q 法藉由圖3所示網路裝置100與模組來實現。 [0032] 在步驟S600,接收模組102接收第一用戶發送的連線請求 封包。在本實施方式中,第一用戶為圖!中複數用戶I、 II、III、*··Ν其中之一。 [0033] 在步驟S602,判斷模組1〇4判斷連線資源是否使用完畢。 [0034] 若連線資源使用完畢,則在步驟S604,判斷模組104判斷 第一用戶與第二用戶的連線資源使用量的差值是否小於_] i first group 丨〇 6 in the first _ user and the second user's connection resource usage difference is less than the critical value _ fixed first - good financial line f source priority in this embodiment, when When the speed line resource meets one of the following four conditions, the connection resource can be broken to a high priority: (1) the connection is established by the Internet 300; (1) the connection is made by the user inside the area network, η, HI ', · The connection established and conforming to the rules of p埠rt f〇rwarding; (3) the connection nickname established by the user 丨, π, πι, ... within the area network. (4) The connection is established by the users I, II, III, ... in the area network, and the destination nickname conforms to Figure 4. The priority module 106 determines the connection resources that do not meet the above four conditions as low priority. [〇_ In the other embodiments of the present invention, the first user and the second heart may be the same-user. If the first user and the second user are the same user, the priority module 106 directly determines whether there is a low priority connection resource in the connection resource of the first user. [0017] In the present embodiment, the priority module 1〇6 is still in the first user and the second is 099112105. Form number Α0Ι01 7th page/total 25 page 0992021459-0 201138366 [0018] [0020] [0020] 0021] If the difference between the usage resource usage of the user is less than the threshold, it is determined whether there is a low priority among the existing connection resources of the first user, and if there is a low priority, the release module 108 releases the low of the first user. Priority connection resources. In this embodiment, the priority module 106 is further configured to determine the priority of the existing connection resource of the first user when the difference between the usage resource usage of the first user and the first user is not less than a threshold value, and Determine whether there is a low priority connection resource in the existing connection resource of the second user. In this embodiment, the method for determining the priority of the existing connection resources of the second user is the same as the method for determining the priority of the existing connection resources of the first user, and therefore will not be described again. The module UG is used to establish the connection line for the first user according to the connection resource just released by the release module and the connection request according to the connection request packet. In this embodiment, the module 11G is also established to establish a connection item for the first user, wherein the connection is established. The project includes a comparison between the Internet Protocol Address of the first user's regional network and the public Internet Protocol address. In this embodiment, the establishing module 11 is further configured to have a difference between the connection resource usage amount of the first user and the second user is less than a critical value, and the first user's existing connection resources have no low priority connection resources. The first user's connection request is rejected. In the present embodiment, the setup module 11() rejects the connection request of the first user when there is no connection resource of the low-quality link in the second good existing connection resource. 'In his implementation mode, the 'Building Module' is also used to connect to the network device. The connection is not completed. The connection is completed. Page 8 of 25 Form No. 1010101 [0022] 201138366 [0023] [0024] [0025] The source establishes a connection and connection item for the first user. The network device 100 also includes a forwarding module 112 and a connection check register 114. In this embodiment, the forwarding module 112 converts the Internet Protocol address of the first user's regional network into a public internet protocol address, and the first user is based on the public internet protocol address. The connection request packet is forwarded to the Internet 300. The connection check register 114 stores the newly established connection item of the first user. In this embodiment, the connection item of the first user includes a comparison relationship between the IP address of the area network of the first user and a public IP address. The network device 100 in the embodiment of the present invention determines the amount of connection resources used by the second user with the largest amount of connected resources among the plurality of users by the determination module 104, the priority module 106, and the release module 108. Whether the difference between the amount of connection resources used by a user is less than a threshold value determines which user's low priority connection resources are released, and uses the released low priority connection resources to establish a connection for the first user's new connection request. The line effectively solves the problem that the first user can also establish a connection when a single user occupies a large amount of connection resources. Referring to FIG. 5, a schematic diagram of an embodiment of dynamically allocating system resources of the network device 100 of the present invention is shown. In the present embodiment, PI and P2 respectively indicate a high priority and a low priority of the connection resource. In this embodiment, the user 1 and the user II first send a connection request to the network device 100, and the network device 100 allocates available system resources to the user 1 and the user 11, and normally transfers the connection between the user I and the user II. Packet to the Internet 300. Among them, 099112105 Form No. A0101 Page 9/Total 25 Page 0992021459-0 201138366 User II is a user who uses peer-to-peer (P2P) software, which occupies a large amount of system resources. [0030] [0030] Then User 1 sends a new connection request to the network device 1,, because the user 11 occupies a large amount of system resources, and the user 1 occupies part of the system resources, the network Road device 1 〇〇 No available system resources are allocated to user I's new connection request. At this time, since the user II is the user with the largest amount of connection resources, the network device 100 first determines whether the difference between the connection resource usage of the user j and the user π is less than a critical value. Then, the network device 100 determines the priority of all the connection resources of the user I, and releases the low priority connection resources of the user J. The network device 100 then uses the released low priority resources to establish a connection for User I's new connection request. Conversely, if the difference between the usage of the connection resources of the user I and the user is not less than the threshold, the network device 100 determines the priority of all the connection resources of the user II, and releases the low priority of the user II. Line resources. The network device 100 then uses the released low priority resources to establish a connection for the new connection request of the home. Referring to FIG. 6, a schematic diagram of another embodiment of dynamically allocating system resources of the network device 100 of the present invention is shown. In the present embodiment, P1 and Ρ2 respectively indicate a high priority and a low priority of the connection resources. In this embodiment, the user 1 and the user II first send a connection request to the network device 100, and the network device 100 allocates available system resources to the user I and the user π, and normally connects the user I and the user π to the connection. Packet to the internet. User I is a user who uses peer-to-peer (Peer to peer, Ρ2Ρ) software. 099112105 Form number Α0101 Page 10 of 25 0992021459-0 201138366 A lot of system resources are occupied. Therefore, when the user has a new connection request, the network device 100 determines that the user with the largest connection resource usage and the user who requests the connection are users! Therefore, the network device 100 determines the priority of all the connection resources of the user I, and releases the user's low priority connection resources. Then the network device! 00 uses the released low priority resource to establish a connection for User I's new connection request. Referring to FIG. 7, a flowchart of an embodiment of a method for dynamically allocating system resources by the network device 100 of the present invention is shown. In the present embodiment, the square Q method is implemented by the network device 100 and the module shown in FIG. [0032] In step S600, the receiving module 102 receives the connection request packet sent by the first user. In this embodiment, the first user is a map! One of the plural users I, II, III, *··. [0033] In step S602, the determining module 1〇4 determines whether the connection resource is used up. [0034] If the connection resource usage is completed, then in step S604, the determination module 104 determines whether the difference between the usage resource usage of the first user and the second user is less than
Q 臨界值。在本實施方式中,第二用戶為圖1中複數用戶I 、11、111、…Ν連線資源使用量最大的用戶。在本實施 方式中,臨界值為50。 [0035] 若第一用戶與第二用戶的連線資源使用量的差值小於臨 界值,則在步驟S606,優先級模組106確定第一用戶的現 有連線資源的優先級。 [0036] 在步驟S608,優先級模組106判斷第一用戶的現有連線資 源中是否有低優先級連線資源。 099112105 表單編號Α0101 第11頁/共25頁 0992021459-0 201138366 [0037] 若第一用戶的現有連線資源中有低優先級的連線資源, 則在步驟S610,釋放模組108釋放第一用戶的低優先級的 連線資源。 [0038] 在步驟S61 2,建立模組110利用釋放的連線資源為第一用 戶建立連線。 [0039] 在步驟S614,轉送模組112將第一用戶的區域網的IP位 址轉換為公共的IP位址,並將第一用戶的連線請求封包 轉送至網際網路300。 [0040] 若連線資源沒有使用完畢時,則在步驟S61 6,建立模組 110利用沒有使用完畢的連線資源為第一用戶建立連線及 連線項目。在本實施方式中,第一用戶的連線項目包括 第一用戶的區域網的IP位址與公共的(Public) IP位址 之間的對照關係。 [0041] 然後在步驟S614,轉送模組11 2將第一用戶的區域網的 IP位址轉換為公共的IP位址,並將第一用戶的連線請求 封包轉送至網際網路300。 [0042] 若差值不小於臨界值,則在步驟S618,優先級模組106確 定第二用戶的連線資源的優先級。 [0043] 在步驟S620,優先級模組106判斷連線資源使用量最大的 第二用戶的連線資源中是否有低優先級的連線資源。 [0044] 若有低優先級的連線資源,則返回步驟S622,釋放模組 108釋放第二用戶的低優先級的連線資源。 [0045] 若沒有低優先級的連線資源,則在步驟S624,建立模組 099112105 表單編號A0101 第12頁/共25頁 0992021459-0 201138366 110拒絕第一用戶的連線請求。 [0046] [0047] [0048] Ο [0049] ❹ [0050] [0051] [0052] [0053] 然後在步驟S61 2,轉送模組11 2將第一用戶的區域網的 IP位址轉換為公共的IP位址,並將該用戶的連線請求封 包轉送至網際網路300。 若沒有低優先級的連線資源,則在步驟S624,建立模組 110拒絕第一用戶的連線請求。 本發明實施方式中的網路裝置1 0 0及其動態分配系統資源 的方法藉由判斷模組104、優先級模組106及釋放模組 1 08來判斷複數用戶中連線資源使用量最大的第二用戶使 用的連線資源量與第一用戶使用的連線資源量的差值是 否小於臨界值來決定釋放哪一個用戶的低優先級連線資 源,並利用釋放的低優先級連線資源為第一用戶的新連 線請求建立連線,從而有效的解決了在單一用戶佔用大 量連線資源時第一用戶也能建立新的連線。 綜上所述,本發明符合發明專利要件,爰依法提出專利 申請。惟,以上所述者僅為本發明之較佳實施例,舉凡 熟悉本案技藝之人士,在爰依本案發明精神所作之等效 修飾或變化,皆應包含於以下之申請專利範圍内。 【圖式簡單說明】 圖1是系統資源被單一用戶大量佔用的示意圖。 圖2所示為本發明網路裝置一實施方式的應用環境圖。 圖3是本發明網路裝置一實施方式的模組圖。 圖4是應用程式與埠號的對應關係圖。 099112105 表單編號A0101 第13頁/共25頁 0992021459-0 201138366 [0054] 圖5是本發明網路裝置動態分配系統資源一實施方式的示 意圖。 [0055] 圖6是本發明網路裝置動態分配系統資源另一實施方式的 示意圖。 [0056] 圖7是本發明網路裝置動態分配系統資源的方法一實施方 式的流程圖。 【主要元件符號說明】 [0057] 網路裝置:100 [0058] 網際網路:300 [0059] 接收模組:102 [0060] 判斷模組:104 [0061] 優先級模組:106 [0062] 釋放模組:108 [0063] 建立模組:110 [0064] 轉送模組:112 [0065] 連線對照寄存器:114 [0066] 處理器:116 099112105 表單編號A0101 第14頁/共25頁 0992021459-0Q threshold. In the present embodiment, the second user is the user who has the largest amount of connection resources among the plurality of users I, 11, 111, ... in FIG. In the present embodiment, the critical value is 50. [0035] If the difference between the connection resource usage amount of the first user and the second user is less than the threshold value, then in step S606, the priority module 106 determines the priority of the existing connection resource of the first user. [0036] In step S608, the priority module 106 determines whether there is a low priority connection resource in the existing connection resources of the first user. 099112105 Form No. 1010101 Page 11/Total 25 Page 0992021459-0 201138366 [0037] If there is a low priority connection resource in the existing connection resource of the first user, the release module 108 releases the first user in step S610. Low priority connection resources. [0038] In step S61 2, the setup module 110 uses the released connection resources to establish a connection for the first user. [0039] In step S614, the forwarding module 112 converts the IP address of the area network of the first user into a public IP address, and forwards the connection request packet of the first user to the Internet 300. [0040] If the connection resource is not used, the setup module 110 establishes a connection and connection item for the first user by using the unused connection resource in step S61. In this embodiment, the connection item of the first user includes a comparison relationship between the IP address of the area network of the first user and a public IP address. [0041] Then, in step S614, the forwarding module 11 2 converts the IP address of the first user's area network into a public IP address, and forwards the first user's connection request packet to the Internet 300. [0042] If the difference is not less than the threshold, then in step S618, the priority module 106 determines the priority of the connection resource of the second user. [0043] In step S620, the priority module 106 determines whether there is a low priority connection resource among the connection resources of the second user whose connection resource usage is the largest. [0044] If there is a low priority connection resource, the process returns to step S622, and the release module 108 releases the low priority connection resource of the second user. [0045] If there is no low priority connection resource, then in step S624, the module 099112105 is formed. Form number A0101 page 12/25 page 0992021459-0 201138366 110 rejects the connection request of the first user. [0048] [0054] [0053] Then in step S61 2, the forwarding module 11 2 converts the IP address of the first user's area network into The public IP address and the user's connection request packet are forwarded to the Internet 300. If there is no low priority connection resource, then in step S624, the setup module 110 rejects the connection request of the first user. The network device 1000 and the method for dynamically allocating system resources in the embodiment of the present invention determine the maximum usage of the connected resources among the plurality of users by the determining module 104, the priority module 106, and the releasing module 108. Whether the difference between the amount of connection resources used by the second user and the amount of connection resources used by the first user is less than a threshold value determines which user's low priority connection resources are released, and utilizes the released low priority connection resources. Establishing a connection for the first user's new connection request effectively solves the problem that the first user can also establish a new connection when a single user occupies a large amount of connection resources. In summary, the present invention complies with the requirements of the invention patent and submits a patent application according to law. The above description is only the preferred embodiment of the present invention, and equivalent modifications or variations made by those skilled in the art will be included in the following claims. [Simple description of the diagram] Figure 1 is a schematic diagram of system resources being heavily occupied by a single user. FIG. 2 is a diagram showing an application environment of an embodiment of a network device according to the present invention. 3 is a block diagram of an embodiment of a network device of the present invention. Figure 4 is a diagram showing the correspondence between an application and an apostrophe. 099112105 Form No. A0101 Page 13 of 25 0992021459-0 201138366 [0054] FIG. 5 is a schematic diagram of an embodiment of a network device dynamic allocation system resource according to the present invention. 6 is a schematic diagram of another embodiment of a network device dynamic allocation system resource according to the present invention. 7 is a flow chart of an embodiment of a method for dynamically allocating system resources by a network device according to the present invention. [Main component symbol description] [0057] Network device: 100 [0058] Internet: 300 [0059] Receive module: 102 [0060] Judgment module: 104 [0061] Priority module: 106 [0062] Release Module: 108 [0063] Setup Module: 110 [0064] Transfer Module: 112 [0065] Connection Control Register: 114 [0066] Processor: 116 099112105 Form Number A0101 Page 14 of 25 0992021459- 0