Server load balancing method, including setting the detection cycle and unit time period; in each detection period, the statistics server obtains in each unit time the detection period data upload request number, and in turn the statistical data upload request number with a preset value, when the data upload request number exceeds a predetermined value. Then, enter the data upload time adjustment procedure. The data upload time adjustment method comprises the following steps: according to the number of connections to a server device, a number of equipment is divided into several groups; in order to set several upload time, the number of upload time corresponding to the number of teams, and each time allocated to each upload group, and each time will upload the starting time bit transmitted to the corresponding group of equipment, the equipment according to the received time point data upload. The above method avoids the serious load and improves the utilization of the server. The invention also provides a server with load balancing method and an intelligent home control system.
【技术实现步骤摘要】
服务器的负载均衡方法、服务器、和智能家居控制系统
本专利技术涉及一种负载均衡方法,尤其涉及一种服务器的负载均衡方法。本专利技术还涉及一种可执行上述负载均衡方法的服务器和智能家居控制系统。
技术介绍
现有服务器在同时接收数个设备的定期上传数据时,如各设备在每5分钟上传一次数据时,可参见图1,会导致服务器在特定上传时间集中接收到大量的数据上传请求,出现数据接收高峰期而致使服务器负载严重甚至瘫痪,但在其他时间段内服务器的利用率较低。现有服务器均衡上述负载的方法为设置数量较多的服务器和一个负载均衡器,该负载均衡器能够将各设备的上传数据请求分配于各个服务器,但是这种方式势必会导致成本提高,并且如上文所说在除上传时间外的其他时间段内,各个服务器的利用率较低。而且负载均衡器的介入一定会增加数据上传的延迟。
技术实现思路
本专利技术的目的是提供一种服务器的负载均衡方法。其可以使与服务器连接的各个设备在不同的时间段上传数据,避免出现数据上传的高峰期而导致服务器负载严重甚至瘫痪,且可充分提高服务器的利用率。本专利技术的另一个目的是提供一种服务器,其可避免服务器负载严重甚至瘫痪,且可充分提高服务器的利用率。本专利技术的再一个目的是提供一种可采用上述服务器的智能家居控制系统。本专利技术提供了一种服务器的负载均衡方法,服务器能够获取数个设备的上传数据,负载均衡方法包括:设定一个检测周期和一个单位时间段;在每个检测周期内,统计服务器在该检测周期的每个单位时间段内获取的数据上传请求数量,并依次将该统计的数据上传请求数量与一个预设值比较,当一个数据上传请求数量超过预设值,则进入数据上传时间调 ...
【技术保护点】
服务器的负载均衡方法,所述服务器能够获取数个设备的上传数据,所述负载均衡方法包括:设定一个检测周期和一个单位时间段;在每个所述检测周期内,统计所述服务器在该检测周期的每个单位时间段内获取的数据上传请求数量,并依次将该统计的所述数据上传请求数量与一个预设值比较,当一个所述数据上传请求数量超过所述预设值,则进入数据上传时间调整步骤;所述数据上传时间调整步骤包括:根据连接于所述服务器的所述设备的数量,将数个所述设备分成数个小组;依次设定数个上传时间段,所述上传时间段的数量对应于所述小组数量,并将各所述上传时间段分别分配至各所述小组,且将各个所述上传时间段起始的时间点传送给相应小组的所述设备,使各所述设备根据接收到的所述时间点上传数据。
【技术特征摘要】
1.服务器的负载均衡方法,所述服务器能够获取数个设备的上传数据,所述负载均衡方法包括:设定一个检测周期和一个单位时间段;在每个所述检测周期内,统计所述服务器在该检测周期的每个单位时间段内获取的数据上传请求数量,并依次将该统计的所述数据上传请求数量与一个预设值比较,当一个所述数据上传请求数量超过所述预设值,则进入数据上传时间调整步骤;所述数据上传时间调整步骤包括:根据连接于所述服务器的所述设备的数量,将数个所述设备分成数个小组;依次设定数个上传时间段,所述上传时间段的数量对应于所述小组数量,并将各所述上传时间段分别分配至各所述小组,且将各个所述上传时间段起始的时间点传送给相应小组的所述设备,使各所述设备根据接收到的所述时间点上传数据。2.如权利要求1所述的负载均衡方法,其中在所述数据上传时间调整步骤中,可依次设定数个时长相等的所述上传时间段。3.如权利要求2所述的负载均衡方法,其中在所述数据上传时间调整步骤中,按照所述小组的数量将下一个检测周期均分成数个所述上传时间段,并将各所述上传时间段分配给各所述小组。4.如权利要求1所述的负载均衡方法,其中在所述数据上传时间调整步骤中,根据连接于所述服...
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。