CN106603437A - Port distribution method and apparatus - Google Patents
Port distribution method and apparatus Download PDFInfo
- Publication number
- CN106603437A CN106603437A CN201611170560.7A CN201611170560A CN106603437A CN 106603437 A CN106603437 A CN 106603437A CN 201611170560 A CN201611170560 A CN 201611170560A CN 106603437 A CN106603437 A CN 106603437A
- Authority
- CN
- China
- Prior art keywords
- port
- service
- released
- reference value
- priority
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000012913 prioritisation Methods 0.000 claims description 6
- 238000004891 communication Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/80—Actions related to the user profile or the type of traffic
- H04L47/805—QOS or priority aware
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/10—Flow control; Congestion control
- H04L47/24—Traffic characterised by specific attributes, e.g. priority or QoS
- H04L47/2425—Traffic characterised by specific attributes, e.g. priority or QoS for supporting services specification, e.g. SLA
- H04L47/2433—Allocation of priorities to traffic types
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L47/00—Traffic control in data switching networks
- H04L47/70—Admission control; Resource allocation
- H04L47/82—Miscellaneous aspects
- H04L47/826—Involving periods of time
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及互联网通信技术领域,尤其涉及一种端口分配的方法及设备。The invention relates to the technical field of Internet communication, in particular to a port allocation method and equipment.
背景技术Background technique
随着互联网通信技术的不断发展,网上的用户数量也呈爆炸式地增长。随着日益增长的网络用户,当前IPv4的公网地址相当紧张。因此,在运营商出口时都会进行NAT转换,从而给每个用户分配一个地址的一段端口号。由于同一个地址可能会分配给不同的用户使用,因此区分不同用户的方式就是根据分配的端口号来辨别。With the continuous development of Internet communication technology, the number of users on the Internet is also increasing explosively. With the increasing number of network users, the current IPv4 public network address is quite tight. Therefore, NAT conversion will be performed when the operator exits, so as to assign a port number of an address to each user. Since the same address may be assigned to different users, the way to distinguish different users is to distinguish based on the assigned port number.
然而,当前用户上网时可能会同时开启多个连接互联网的应用程序,比如HTTP浏览网页、视频业务、BT下载、FTP下载等。运营商往往根据用户开启应用程序的先后顺序来分配端口。由于端口资源是有限的,那么后面启动的应用程序则可能由于没有分配到端口而不能连接公网。However, when a current user surfs the Internet, multiple applications connected to the Internet may be opened at the same time, such as HTTP web browsing, video services, BT downloads, FTP downloads, and the like. Operators often allocate ports according to the order in which users start applications. Since the port resources are limited, the applications started later may not be able to connect to the public network because they are not allocated to the port.
比如用户在同时进行HTTP浏览网页业务、视频业务以及BT下载业务时,BT下载业务为了自身下载上传更快,会启动多个链接一起下载,从而占用较多的端口,这样就导致用户其他比较重要的应用反而不能使用。For example, when a user is performing HTTP web page browsing, video services, and BT download services at the same time, the BT download service will start multiple links to download together to download and upload faster, thus occupying more ports, which will lead to other more important users. The application cannot be used instead.
发明内容Contents of the invention
本发明的目的在于提供一种端口分配的方法及设备,能够避免一个业务占用过多的端口,从而能够保证用户的重要应用能够实时进行。The purpose of the present invention is to provide a method and device for port allocation, which can prevent a service from occupying too many ports, thereby ensuring that important applications of users can be performed in real time.
为实现上述目的,本发明提供了一种端口分配的方法,所述方法包括:预先对用户的预设数量的业务划分优先级;接收新建会话请求,所述新建会话请求中包括待新建的目标业务;记录当前各个端口中执行的业务对应的最近流量时间戳;若当前不存在空闲的端口,根据划分的优先级以及记录的最近流量时间戳,确定待释放的端口;将确定的待释放的端口中的业务断开连接,以释放占用的端口,并在释放的端口中执行所述目标业务。In order to achieve the above object, the present invention provides a port allocation method, the method comprising: prioritizing a preset number of user services; receiving a new session request, the new session request includes the target to be created Business; record the latest traffic time stamp corresponding to the business currently executed in each port; if there is no idle port currently, determine the port to be released according to the divided priority and the latest recorded traffic time stamp; determine the port to be released The service in the port is disconnected, so as to release the occupied port, and execute the target service in the released port.
进一步地,预先对用户的预设数量的业务划分优先级具体包括:根据用户预先设置的业务偏好,为各个业务分配对应的优先级并在PPPoE登陆报文中记录各个业务对应的优先级。Further, prioritizing the preset number of services of the user specifically includes: according to the user's preset service preferences, assigning corresponding priorities to each service and recording the corresponding priorities of each service in the PPPoE login message.
进一步地,预先对用户的预设数量的业务划分优先级具体包括:根据用户在宽带远程接入服务器中对业务进行分类的结果,生成各个业务对应的优先级阈值,并将各个业务以及各个业务对应的优先级阈值存储于数据关系表中。Further, prioritizing the preset number of services of the user specifically includes: according to the result of the user classifying the services in the broadband remote access server, generating a priority threshold corresponding to each service, and classifying each service and each service The corresponding priority thresholds are stored in the data relationship table.
进一步地,根据划分的优先级以及记录的最近流量时间戳,确定待释放的端口具体包括:将当前占用的端口中优先级最低的端口确定为待释放的端口;或者将当前占用的端口中最近流量时间戳最早的端口确定为待释放的端口。Further, according to the divided priority and the latest recorded traffic time stamp, determining the port to be released specifically includes: determining the port with the lowest priority among the currently occupied ports as the port to be released; or determining the port with the lowest priority among the currently occupied ports The port with the earliest traffic timestamp is determined to be the port to be released.
进一步地,根据划分的优先级以及记录的最近流量时间戳,确定待释放的端口具体包括:根据划分的优先级以及记录的最近流量时间戳,生成所述优先级和所述最近流量时间戳分别对应的第一参考值和第二参考值;根据所述第一参考值和所述第二参考值,按照下述公式生成各个端口对应的加权平均值:Further, according to the divided priority and the latest recorded traffic timestamp, determining the port to be released specifically includes: according to the divided priority and the recorded latest traffic timestamp, generating the priority and the latest traffic timestamp respectively Corresponding first reference value and second reference value; according to the first reference value and the second reference value, the weighted average value corresponding to each port is generated according to the following formula:
S=a·P+b·TS=a·P+b·T
其中,S表示所述加权平均值,a表示所述第一参考值对应的加权系数,P表示所述第一参考值,b表示所述第二参考值对应的加权系数,T表示所述第二参考值;将生成的加权平均值最小的端口确定为待释放的端口。Wherein, S represents the weighted average value, a represents the weight coefficient corresponding to the first reference value, P represents the first reference value, b represents the weight coefficient corresponding to the second reference value, and T represents the weight coefficient corresponding to the first reference value. Two reference values; determine the port with the smallest weighted average generated as the port to be released.
为实现上述目的,本发明还提供一种端口分配的设备,所述设备包括:优先级划分单元,用于预先对用户的预设数量的业务划分优先级;会话请求接收单元,用于接收新建会话请求,所述新建会话请求中包括待新建的目标业务;时间戳记录单元,用于记录当前各个端口中执行的业务对应的最近流量时间戳;待释放端口确定单元,用于若当前不存在空闲的端口,根据划分的优先级以及记录的最近流量时间戳,确定待释放的端口;目标业务执行单元,用于将确定的待释放的端口中的业务断开连接,以释放占用的端口,并在释放的端口中执行所述目标业务。In order to achieve the above object, the present invention also provides a device for port allocation, which includes: a prioritization unit for prioritizing a preset number of user services; a session request receiving unit for receiving newly created Session request, the new session request includes the target business to be newly created; the timestamp recording unit is used to record the latest traffic timestamp corresponding to the business performed in each port at present; the port to be released determination unit is used for if there is no current The idle port determines the port to be released according to the divided priority and the latest recorded traffic time stamp; the target service execution unit is used to disconnect the service in the determined port to be released to release the occupied port, And execute the target service in the released port.
进一步地,所述优先级划分单元具体包括:第一划分模块,用于根据用户预先设置的业务偏好,为各个业务分配对应的优先级并在PPPoE登陆报文中记录各个业务对应的优先级;或者第二划分模块,用于根据用户在宽带远程接入服务器中对业务进行分类的结果,生成各个业务对应的优先级阈值,并将各个业务以及各个业务对应的优先级阈值存储于数据关系表中。Further, the prioritization unit specifically includes: a first division module, configured to assign a corresponding priority to each service and record the priority corresponding to each service in the PPPoE login message according to the service preference preset by the user; Or the second division module is used to generate priority thresholds corresponding to each service according to the result of the user classifying the services in the broadband remote access server, and store each service and the priority thresholds corresponding to each service in the data relationship table middle.
进一步地,所述待释放端口确定单元具体包括:第一确定模块,用于将当前占用的端口中优先级最低的端口确定为待释放的端口;或者第二确定模块,用于将当前占用的端口中最近流量时间戳最早的端口确定为待释放的端口。Further, the unit to determine the port to be released specifically includes: a first determination module, configured to determine the port with the lowest priority among currently occupied ports as the port to be released; or a second determination module, configured to determine the currently occupied port Among the ports, the port with the earliest time stamp of the latest traffic is determined to be the port to be released.
进一步地,所述待释放端口确定单元具体包括:参考值生成模块,用于根据划分的优先级以及记录的最近流量时间戳,生成所述优先级和所述最近流量时间戳分别对应的第一参考值和第二参考值;加权平均值确定模块,用于根据所述第一参考值和所述第二参考值,按照下述公式生成各个端口对应的加权平均值:Further, the unit to determine the port to be released specifically includes: a reference value generation module, configured to generate the first priority corresponding to the priority and the latest traffic time stamp respectively according to the divided priority and the recorded latest traffic time stamp. A reference value and a second reference value; a weighted average determination module, configured to generate a weighted average corresponding to each port according to the following formula according to the first reference value and the second reference value:
S=a·P+b·TS=a·P+b·T
其中,S表示所述加权平均值,a表示所述第一参考值对应的加权系数,P表示所述第一参考值,b表示所述第二参考值对应的加权系数,T表示所述第二参考值;端口确定模块,用于将生成的加权平均值最小的端口确定为待释放端口的业务。Wherein, S represents the weighted average value, a represents the weight coefficient corresponding to the first reference value, P represents the first reference value, b represents the weight coefficient corresponding to the second reference value, and T represents the weight coefficient corresponding to the first reference value. Two reference values; a port determination module, configured to determine the port with the smallest weighted average generated as the service of the port to be released.
本发明提供的一种端口分配的方法及设备,可以为不同的业务分配不同的优先级,并且记录各个业务在执行过程中对应的最近流量时间戳。其中,优先级可以表明业务的重要程度,优先级越高,重要程度也越高。最近流量时间戳则可以表明业务在最后产生流程时对应的时间点,最近流量时间戳越早,则表明业务处于空闲的时间越久。这样,根据各个业务对应的优先级和最近流量时间戳,从而能够确定哪些业务可以占用端口,而哪些业务应该断开连接,从而能够避免一个业务占用过多的端口,进而能够保证用户的重要应用能够实时进行。The method and device for port assignment provided by the present invention can assign different priorities to different services, and record the latest flow time stamp corresponding to each service during execution. Among them, the priority can indicate the importance of the business, and the higher the priority, the higher the importance. The latest traffic timestamp can indicate the corresponding time point when the business last generated the process. The earlier the recent traffic timestamp, the longer the business has been idle. In this way, according to the priority of each service and the latest traffic time stamp, it can be determined which services can occupy ports and which services should be disconnected, so as to avoid a service from occupying too many ports and ensure the important applications of users can be done in real time.
附图说明Description of drawings
图1为本发明提供的一种端口分配的方法流程图;Fig. 1 is a flow chart of a method for port allocation provided by the present invention;
图2为本发明提供的一种端口分配的设备的功能模块图。Fig. 2 is a functional block diagram of a port allocation device provided by the present invention.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施方式中的附图,对本申请实施方式中的技术方案进行清楚、完整地描述,显然,所描述的实施方式仅仅是本申请一部分实施方式,而不是全部的实施方式。基于本申请中的实施方式,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施方式,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described The implementations are only some of the implementations of the present application, not all of them. Based on the implementation manners in this application, all other implementation manners obtained by persons of ordinary skill in the art without creative efforts shall fall within the scope of protection of this application.
图1为本发明提供的一种端口分配的方法流程图。如图1所示,所述方法可以包括以下步骤。Fig. 1 is a flow chart of a port allocation method provided by the present invention. As shown in Fig. 1, the method may include the following steps.
步骤S1:预先对用户的预设数量的业务划分优先级。Step S1: Prioritizing a preset number of services of the user in advance.
在本实施方式中,可以根据用户自身的业务偏好,为各个业务分配对应的优先级,优先级高的业务可以优先享有分配端口的权力。具体地,可以在用户上线时,在PPPoE登陆报文中记录各个业务对应的优先级。In this embodiment, each service can be assigned a corresponding priority according to the user's own service preference, and services with higher priority can enjoy the right to allocate ports first. Specifically, when the user goes online, the priority corresponding to each service may be recorded in the PPPoE login message.
此外,在本实施方式中,还可以根据用户在宽带远程接入服务器BRAS中对业务进行分类的结果,生成各个业务对应的优先级阈值,并将各个业务以及各个业务对应的优先级阈值存储于数据关系表中。具体地,所述优先级阈值的大小可以根据优先级的高低来确定,优先级越高的业务,其对应的优先级阈值也越高。表1为不同用户的业务优先级阈值对应的数据关系表。In addition, in this embodiment, the priority thresholds corresponding to each service may also be generated according to the results of the user's classification of services in the broadband remote access server BRAS, and each service and the priority thresholds corresponding to each service may be stored in the data relationship table. Specifically, the size of the priority threshold may be determined according to the priority, and a service with a higher priority has a higher corresponding priority threshold. Table 1 is a data relationship table corresponding to service priority thresholds of different users.
表1不同用户的业务优先级阈值对应的数据关系表Table 1 Data relationship table corresponding to service priority thresholds of different users
从表1中可以看出,用户A将网页业务的优先级设置为最高,其对应的优先级阈值为100,而BT下载业务的优先级被设备为最低,其对应的优先级阈值为10。It can be seen from Table 1 that user A sets the priority of the webpage service to the highest, and its corresponding priority threshold is 100, while the priority of the BT download service is set to the lowest by the device, and its corresponding priority threshold is 10.
步骤S2:接收新建会话请求,所述新建会话请求中包括待新建的目标业务;Step S2: receiving a new session request, the new session request includes the target business to be created;
步骤S3:记录当前各个端口中执行的业务对应的最近流量时间戳。Step S3: Record the latest traffic time stamps corresponding to the services currently executed on each port.
在本实施方式中,在用户开始上网时,在需要启动业务时,可以创建一条会话请求。新建的会话请求中可以包括待新建的目标业务。当端口充足的情况下,可以按照会话请求的创建时间,依次分配端口。在业务在端口中执行时,可以记录当前各个端口中执行的业务对应的最近流量时间戳。所述最近流量时间戳可以表明业务在最后产生流程时对应的时间点,最近流量时间戳越早,则表明业务处于空闲的时间越久。表2为不同业务对应的最近流量时间戳示意表。In this embodiment, when a user needs to start a service when starting to surf the Internet, a session request can be created. The newly created session request may include the target service to be created. When the ports are sufficient, the ports can be allocated sequentially according to the creation time of the session request. When the service is executed on the port, the latest traffic time stamp corresponding to the service currently executed on each port can be recorded. The latest traffic time stamp may indicate the corresponding time point when the service last generates a flow, and the earlier the latest traffic time stamp, the longer the service is idle. Table 2 is a schematic table of recent traffic timestamps corresponding to different services.
表2不同业务对应的最近流量时间戳示意表Table 2 Schematic representation of recent traffic timestamps corresponding to different services
从表2中可以看出,端口102对应的BT下载业务在3点时便停止运行,当前端口102尽管被占用着,但实际上并没有执行对应的业务。It can be seen from Table 2 that the BT download service corresponding to the port 102 stops running at 3 o'clock, and although the current port 102 is occupied, the corresponding service is not actually executed.
步骤S4:若当前不存在空闲的端口,根据划分的优先级以及记录的最近流量时间戳,确定待释放的端口。Step S4: If there is no idle port currently, determine the port to be released according to the divided priority and the latest recorded traffic time stamp.
在本实施方式中,当所有的端口均被占用,当前不存在空闲端口时,则需要根据各个业务对应的优先级以及最近流量时间戳,来确定该释放端口的业务。具体地,在本实施方式中,可以将当前执行的业务中优先级最低的业务确定为待释放端口的业务或者将当前执行的业务中最近流量时间戳最早的业务确定为待释放端口的业务。其中,优先级最低的业务对应的重要程度也越低,用户在使用该业务的可能性也越小,因此可以将优先级最低的业务确定为待释放端口的业务。此外,最近流量时间戳最早的业务则表明停止执行时间最久的业务,由于该业务已经长时间处于未执行状态,从而可以将该业务对应的端口确定为待释放的端口。In this embodiment, when all ports are occupied and there is no idle port currently, it is necessary to determine the service of the released port according to the priority corresponding to each service and the latest traffic time stamp. Specifically, in this embodiment, the service with the lowest priority among the currently executed services may be determined as the service of the port to be released, or the service with the earliest latest traffic time stamp among the currently executed services may be determined as the service of the port to be released. Among them, the lower the importance corresponding to the service with the lowest priority is, the less likely the user is to use the service. Therefore, the service with the lowest priority can be determined as the service of the port to be released. In addition, the service with the earliest time stamp of the latest traffic indicates that the service with the longest execution time has been stopped. Since the service has not been executed for a long time, the port corresponding to the service can be determined as the port to be released.
在本实施方式中,还可以采用加权平均的方法,综合考虑优先级和最近流量时间戳,以精确地确定出待释放的端口。具体地,首先可以根据划分的优先级以及记录的最近流量时间戳,生成所述优先级和所述最近流量时间戳分别对应的第一参考值和第二参考值。其中,所述第一参考值可以是如表1中所示的优先级阈值,优先级越高,其对应的第一参考值则越大。所述第二参考值可以是根据最近流量时间戳距离当前时刻的时间间隔来确定的,时间间隔越大,所述第二参考值则越小。这样,便可以将优先级和最近流量时间戳进行量化。接着,可以根据所述第一参考值和所述第二参考值,按照下述公式生成各个端口对应的加权平均值:In this implementation manner, a weighted average method may also be used to accurately determine the port to be released by comprehensively considering the priority and the latest traffic time stamp. Specifically, first, according to the divided priority and the recorded latest traffic timestamp, a first reference value and a second reference value respectively corresponding to the priority and the latest traffic timestamp may be generated. Wherein, the first reference value may be a priority threshold as shown in Table 1, and the higher the priority, the greater the corresponding first reference value. The second reference value may be determined according to the time interval between the latest traffic timestamp and the current moment, and the larger the time interval, the smaller the second reference value. In this way, priority and recent traffic timestamps can be quantified. Next, according to the first reference value and the second reference value, the weighted average value corresponding to each port can be generated according to the following formula:
S=a·P+b·TS=a·P+b·T
其中,S表示所述加权平均值,a表示所述第一参考值对应的加权系数,P表示所述第一参考值,b表示所述第二参考值对应的加权系数,T表示所述第二参考值。Wherein, S represents the weighted average value, a represents the weight coefficient corresponding to the first reference value, P represents the first reference value, b represents the weight coefficient corresponding to the second reference value, and T represents the weight coefficient corresponding to the first reference value. Two reference values.
在本实施方式中,上式中的两个加权系数可以是预先设置的常量,这样,通过上式便可以确定各个端口对应的加权平均值,从而可以将生成的加权平均值最小的端口确定为待释放端口的业务。In this embodiment, the two weighting coefficients in the above formula can be preset constants, so that the weighted average value corresponding to each port can be determined through the above formula, so that the port with the smallest weighted average value generated can be determined as The service of the port to be released.
步骤S5:将确定的待释放的端口中的业务断开连接,以释放占用的端口,并在释放的端口中执行所述目标业务。Step S5: Disconnect the service in the determined port to be released, so as to release the occupied port, and execute the target service in the released port.
在本实施方式中,在确定了待释放的端口之后,便可以将确定的待释放的端口中的业务断开连接,并在释放的端口中执行所述目标业务。这样便可以保证用户比较偏爱的业务能够在端口被占满的情况下依然能够执行。In this embodiment, after the port to be released is determined, the service in the determined port to be released may be disconnected, and the target service is executed on the released port. In this way, it can be ensured that the services preferred by users can still be executed even when the ports are fully occupied.
本申请还提供一种端口分配的设备。请参阅图2,所述设备可以包括:The present application also provides a port allocation device. Referring to Figure 2, the equipment can include:
优先级划分单元100,用于预先对用户的预设数量的业务划分优先级;A prioritization unit 100, configured to prioritize a preset number of user services in advance;
会话请求接收单元200,用于接收新建会话请求,所述新建会话请求中包括待新建的目标业务;The session request receiving unit 200 is configured to receive a new session request, and the new session request includes a target service to be created;
时间戳记录单元300,用于记录当前各个端口中执行的业务对应的最近流量时间戳;A timestamp recording unit 300, configured to record the latest traffic timestamp corresponding to the services currently executed in each port;
待释放端口确定单元400,用于若当前不存在空闲的端口,根据划分的优先级以及记录的最近流量时间戳,确定待释放的端口;The port to be released determination unit 400 is used to determine the port to be released according to the divided priority and the latest recorded traffic timestamp if there is no idle port at present;
目标业务执行单元500,用于将确定的待释放的端口中的业务断开连接,以释放占用的端口,并在释放的端口中执行所述目标业务。The target service executing unit 500 is configured to disconnect the service in the determined port to be released, so as to release the occupied port, and execute the target service in the released port.
在本申请一个优选实施方式中,所述优先级划分单元100具体包括:In a preferred embodiment of the present application, the prioritization unit 100 specifically includes:
第一划分模块,用于根据用户预先设置的业务偏好,为各个业务分配对应的优先级并在PPPoE登陆报文中记录各个业务对应的优先级;The first division module is used to assign corresponding priorities to each service and record the corresponding priorities of each service in the PPPoE login message according to the service preferences preset by the user;
或者or
第二划分模块,用于根据用户在宽带远程接入服务器中对业务进行分类的结果,生成各个业务对应的优先级阈值,并将各个业务以及各个业务对应的优先级阈值存储于数据关系表中。The second division module is used to generate priority thresholds corresponding to each service according to the results of classifying services by users in the broadband remote access server, and store each service and the priority thresholds corresponding to each service in the data relationship table .
在本申请一个优选实施方式中,所述待释放端口确定单元400具体包括:In a preferred embodiment of the present application, the port to be released determination unit 400 specifically includes:
第一确定模块,用于将当前占用的端口中优先级最低的端口确定为待释放的端口;或者A first determining module, configured to determine a port with the lowest priority among currently occupied ports as a port to be released; or
第二确定模块,用于将当前占用的端口中最近流量时间戳最早的端口确定为待释放的端口。The second determination module is configured to determine the port with the earliest time stamp of the latest traffic among the currently occupied ports as the port to be released.
在本申请一个优选实施方式中,所述待释放端口确定单元400具体包括:In a preferred embodiment of the present application, the port to be released determining unit 400 specifically includes:
参考值生成模块,用于根据划分的优先级以及记录的最近流量时间戳,生成所述优先级和所述最近流量时间戳分别对应的第一参考值和第二参考值;A reference value generating module, configured to generate a first reference value and a second reference value respectively corresponding to the priority and the latest traffic timestamp according to the divided priority and the recorded latest traffic timestamp;
加权平均值确定模块,用于根据所述第一参考值和所述第二参考值,按照下述公式生成各个端口对应的加权平均值:A weighted average determination module, configured to generate a weighted average corresponding to each port according to the following formula according to the first reference value and the second reference value:
S=a·P+b·TS=a·P+b·T
其中,S表示所述加权平均值,a表示所述第一参考值对应的加权系数,P表示所述第一参考值,b表示所述第二参考值对应的加权系数,T表示所述第二参考值;Wherein, S represents the weighted average value, a represents the weight coefficient corresponding to the first reference value, P represents the first reference value, b represents the weight coefficient corresponding to the second reference value, and T represents the weight coefficient corresponding to the first reference value. Two reference values;
端口确定模块,用于将生成的加权平均值最小的端口确定为待释放端口的业务。The port determination module is configured to determine the port with the smallest weighted average generated as the service of the port to be released.
需要说明的是,上述各个功能模块的具体实现方式与步骤S1至S5中的描述一致,这里便不再赘述。It should be noted that, the specific implementation manners of the above functional modules are consistent with the descriptions in steps S1 to S5, and will not be repeated here.
由上可见,本发明提供的一种端口分配的方法及设备,可以为不同的业务分配不同的优先级,并且记录各个业务在执行过程中对应的最近流量时间戳。其中,优先级可以表明业务的重要程度,优先级越高,重要程度也越高。最近流量时间戳则可以表明业务在最后产生流程时对应的时间点,最近流量时间戳越早,则表明业务处于空闲的时间越久。这样,根据各个业务对应的优先级和最近流量时间戳,从而能够确定哪些业务可以占用端口,而哪些业务应该断开连接,从而能够避免一个业务占用过多的端口,进而能够保证用户的重要应用能够实时进行。It can be seen from the above that the method and device for port assignment provided by the present invention can assign different priorities to different services, and record the latest traffic time stamp corresponding to each service during execution. Among them, the priority can indicate the importance of the business, and the higher the priority, the higher the importance. The latest traffic timestamp can indicate the corresponding time point when the business last generated the process. The earlier the recent traffic timestamp, the longer the business has been idle. In this way, according to the priority of each service and the latest traffic time stamp, it can be determined which services can occupy ports and which services should be disconnected, so as to avoid a service from occupying too many ports and ensure the important applications of users can be done in real time.
上面对本申请的各种实施方式的描述以描述的目的提供给本领域技术人员。其不旨在是穷举的、或者不旨在将本发明限制于单个公开的实施方式。如上所述,本申请的各种替代和变化对于上述技术所属领域技术人员而言将是显而易见的。因此,虽然已经具体讨论了一些另选的实施方式,但是其它实施方式将是显而易见的,或者本领域技术人员相对容易得出。本申请旨在包括在此已经讨论过的本发明的所有替代、修改、和变化,以及落在上述申请的精神和范围内的其它实施方式。The foregoing description of various embodiments of the present application is provided for those skilled in the art for purposes of illustration. It is not intended to be exhaustive or to limit the invention to a single disclosed embodiment. As described above, various alterations and modifications of the present application will be apparent to those skilled in the art to which the above technologies pertain. Thus, while a few alternative implementations have been discussed in detail, other implementations will be apparent, or relatively readily arrived at, by those skilled in the art. This application is intended to cover all alternatives, modifications, and variations of the invention that have been discussed herein, as well as other embodiments that fall within the spirit and scope of the above application.
本说明书中的各个实施方式均采用递进的方式描述,各个实施方式之间相同相似的部分互相参见即可,每个实施方式重点说明的都是与其他实施方式的不同之处。Each implementation in this specification is described in a progressive manner, the same and similar parts of each implementation can be referred to each other, and each implementation focuses on the differences from other implementations.
虽然通过实施方式描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。Although the present application has been described by means of embodiments, those of ordinary skill in the art know that there are many variations and changes in the present application without departing from the spirit of the application, and it is intended that the appended claims cover these variations and changes without departing from the spirit of the application.
Claims (9)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611170560.7A CN106603437A (en) | 2016-12-16 | 2016-12-16 | Port distribution method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611170560.7A CN106603437A (en) | 2016-12-16 | 2016-12-16 | Port distribution method and apparatus |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN106603437A true CN106603437A (en) | 2017-04-26 |
Family
ID=58599793
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201611170560.7A Pending CN106603437A (en) | 2016-12-16 | 2016-12-16 | Port distribution method and apparatus |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN106603437A (en) |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2007123381A1 (en) * | 2006-04-26 | 2007-11-01 | Lg Electronics Inc. | Method for managing data transfer services on a network |
| CN101184024A (en) * | 2006-11-14 | 2008-05-21 | 中兴通讯股份有限公司 | Priority Scheduling Device |
| CN101364948A (en) * | 2008-09-08 | 2009-02-11 | 中兴通讯股份有限公司 | A Method of Dynamically Allocating Buffer |
| CN102413199A (en) * | 2011-10-20 | 2012-04-11 | 江苏省邮电规划设计院有限责任公司 | System and method for creating and reporting address mapping relations by broadband remote access server |
| CN102801562A (en) * | 2012-08-10 | 2012-11-28 | 福建星网锐捷网络有限公司 | Transmission link switching method and device and network equipment |
| CN102882992A (en) * | 2012-10-12 | 2013-01-16 | 江苏省邮电规划设计院有限责任公司 | Method for releasing port of carrier-grade network address translation equipment |
| CN103701941A (en) * | 2012-09-28 | 2014-04-02 | 中国电信股份有限公司 | Method for allocating ports of address translation equipment and address translation equipment |
| CN104834566A (en) * | 2015-03-31 | 2015-08-12 | 华为技术有限公司 | Method and related apparatus for adjusting switch port of forwarding and processing thread |
-
2016
- 2016-12-16 CN CN201611170560.7A patent/CN106603437A/en active Pending
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2007123381A1 (en) * | 2006-04-26 | 2007-11-01 | Lg Electronics Inc. | Method for managing data transfer services on a network |
| CN101184024A (en) * | 2006-11-14 | 2008-05-21 | 中兴通讯股份有限公司 | Priority Scheduling Device |
| CN101364948A (en) * | 2008-09-08 | 2009-02-11 | 中兴通讯股份有限公司 | A Method of Dynamically Allocating Buffer |
| CN102413199A (en) * | 2011-10-20 | 2012-04-11 | 江苏省邮电规划设计院有限责任公司 | System and method for creating and reporting address mapping relations by broadband remote access server |
| CN102801562A (en) * | 2012-08-10 | 2012-11-28 | 福建星网锐捷网络有限公司 | Transmission link switching method and device and network equipment |
| CN103701941A (en) * | 2012-09-28 | 2014-04-02 | 中国电信股份有限公司 | Method for allocating ports of address translation equipment and address translation equipment |
| CN102882992A (en) * | 2012-10-12 | 2013-01-16 | 江苏省邮电规划设计院有限责任公司 | Method for releasing port of carrier-grade network address translation equipment |
| CN104834566A (en) * | 2015-03-31 | 2015-08-12 | 华为技术有限公司 | Method and related apparatus for adjusting switch port of forwarding and processing thread |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103986715B (en) | A kind of method and device of control of network flow quantity | |
| CN112637299B (en) | Cloud resource allocation method, device, equipment, medium and product | |
| CN106506391B (en) | A kind of network traffic distribution method and router | |
| CN104125269B (en) | Method for limiting speed and device | |
| CN104579887A (en) | Cloud gateway, cloud gateway creation and configuration system and method | |
| CN103731887A (en) | Network bandwidth adjusting method, mobile terminal and server | |
| CN103888539B (en) | Bootstrap technique, device and the P2P caching systems of P2P cachings | |
| CN104113492A (en) | Router based user access bandwidth adjusting method, device and system | |
| WO2017206576A1 (en) | Gateway service processing method and apparatus | |
| EP3089410A1 (en) | Node distribution method and control center | |
| CN109218216A (en) | Chain polymerization traffic distribution method, device, equipment and storage medium | |
| US20150295832A1 (en) | Multi-carrier load-balancing | |
| WO2017092275A1 (en) | Router bandwidth management method and device, and router | |
| CN104469406A (en) | Method and device for processing network resources | |
| CN104320354A (en) | Data processing method and device | |
| CN116633852B (en) | Data transmission method, system and electronic equipment | |
| CN103095836B (en) | The method of adjustment of internet, applications service quality and device, system | |
| CN106792923B (en) | Method and device for configuring QoS strategy | |
| CN106412043A (en) | CDN flow guide method and device | |
| CN105681266B (en) | A kind of communication cluster method and device of mediaphone MMTel | |
| CN105939404B (en) | The acquisition methods and device of NAT resource | |
| WO2015192572A1 (en) | Method, apparatus and system for configuring quality of service (qos) parameters | |
| CN106603437A (en) | Port distribution method and apparatus | |
| CN119011487A (en) | NAT data stream processing method, device and computer equipment | |
| CN102523313B (en) | Identification method of data bypass and apparatus thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170426 |
|
| RJ01 | Rejection of invention patent application after publication |