Resource scheduling method, system, device and storage medium
By monitoring and migrating IoT gateway instances, and combining bandwidth prediction models for resource allocation, the problem of low bandwidth resource utilization of IoT gateways is solved, and more efficient resource utilization and traffic response capabilities are achieved.
Patent Information
- Application Number
- CN202210351157.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-02
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2042-04-02
AI Technical Summary
IoT gateways have low bandwidth resource utilization in multi-tenant scenarios, resulting in waste of resources and increased costs, and are difficult to cope with traffic emergencies.
By monitoring the historical bandwidth usage information of IoT gateways, unbalanced instances are identified and migrated to other gateways, and resource allocation is performed based on the bandwidth prediction model to achieve dynamic scheduling and balanced utilization of bandwidth resources.
It improves the balance of usage of IoT gateway bandwidth resources, saves bandwidth resources, reduces the packet loss rate caused by traffic bursts, and optimizes resource utilization.
Smart Images

Figure CN114697226B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a resource scheduling method, system, device and storage medium. Background Art
[0002] With the development of IoT technology, more and more fields are using IoT technology to realize data cloud storage and big data analysis, such as industrial IoT, agricultural IoT, home IoT, etc.
[0003] At present, many tenants' IoT terminals access the virtual private cloud (VPC) in the cloud through IoT directional cards. In order to enable IoT terminals to access the virtual private cloud in the cloud through IoT directional cards, it is necessary to set up an IoT gateway in the cloud, which can be specifically an IoT virtual gateway. The IoT gateway is configured with a binding relationship between the IoT card and the VPC that the IoT card needs to access; the IoT terminal sends the traffic packet to the IoT gateway through the operator network based on the IoT card, and the IoT gateway forwards the traffic packet to the target VPC according to the pre-configured binding relationship, thereby enabling the IoT terminal to access the cloud service in the VPC through the private network. Among them, the IoT terminal can establish a connection with the IoT gateway through the dedicated APN (Access Point Name) provided by the operator network, and subsequently transmit the traffic packet based on the connection. In other words, the IoT gateway realizes the connection between the IoT terminal and the VPC through the dedicated APN.
[0004] Currently, the IoT gateway is a shared gateway that needs to provide network access or forwarding services for multiple tenants. In order to avoid interference between multiple tenants, exclusive processing resources, such as bandwidth resources, are allocated to each of the multiple tenants. Summary of the invention
[0005] In view of the above problems, the present application is proposed to provide a data processing method, system, device and storage medium that solve the above problems or at least partially solve the above problems.
[0006] Therefore, in one embodiment of the present application, a resource scheduling method is provided, which includes:
[0007] Determine whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to the historical bandwidth usage information of the first Internet of Things gateway;
[0008] When the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state, determining a target instance from multiple instances run by the first Internet of Things gateway; wherein the target instance is an instance that causes the bandwidth resources of the first Internet of Things gateway to be not in a balanced usage state;
[0009] Determining whether the second Internet of Things gateway is suitable for receiving the target instance according to the historical bandwidth usage information of the second Internet of Things gateway and the historical bandwidth usage information of the target instance;
[0010] When it is determined that the second Internet of Things gateway is suitable for receiving the target instance, the target instance is migrated to the second Internet of Things gateway.
[0011] In another embodiment of the present application, a resource scheduling method is provided, which further includes:
[0012] Inputting the currently used bandwidth of the first instance run by the first IoT gateway into the trained bandwidth prediction model, so that the bandwidth prediction model predicts the predicted used bandwidth of the first instance in a future preset time period;
[0013] Determining an estimated limited bandwidth of the first instance in the future preset time period according to the predicted used bandwidth of the first instance in the future preset time period;
[0014] According to the estimated limited bandwidth of the first instance in the future preset time period, a resource allocation instruction is sent to the first Internet of Things gateway, so that the first Internet of Things gateway allocates bandwidth resources for the first instance.
[0015] In another embodiment of the present application, a resource scheduling system is provided, which includes: a gateway controller and a plurality of Internet of Things gateways; the plurality of Internet of Things gateways include a first Internet of Things gateway and a second Internet of Things gateway;
[0016] Wherein, the gateway controller is used to:
[0017] Determine whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to the historical bandwidth usage information of the first Internet of Things gateway;
[0018] When the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state, determining a target instance from multiple instances run by the first Internet of Things gateway; wherein the target instance is an instance that causes the bandwidth resources of the first Internet of Things gateway to be not in a balanced usage state;
[0019] Determining whether the second Internet of Things gateway is suitable for receiving the target instance according to the historical bandwidth usage information of the second Internet of Things gateway and the historical bandwidth usage information of the target instance;
[0020] When it is determined that the second Internet of Things gateway is suitable for receiving the target instance, the target instance is migrated to the second Internet of Things gateway.
[0021] In another embodiment of the present application, an electronic device is provided. The electronic device includes: a memory and a processor, wherein:
[0022] The memory is used to store programs;
[0023] The processor is coupled to the memory and is used to execute the program stored in the memory to implement any of the resource scheduling methods described above.
[0024] In another embodiment of the present application, a computer-readable storage medium storing a computer program is provided. When the computer program is executed by a computer, the resource scheduling method described in any one of the above can be implemented.
[0025] In the technical solution provided by the embodiment of the present application, when the bandwidth resources of the Internet of Things gateway are not in a balanced usage state, the target instance that causes imbalance among the multiple instances on the Internet of Things gateway will be migrated to other Internet of Things gateways that are suitable for receiving the target instance. In other words, the instance migration solution provided by the embodiment of the present application helps to improve the balanced use of bandwidth resources of the Internet of Things gateway. In this way, the bandwidth resources of certain Internet of Things gateways with high resource usage balance and low resource utilization can be reduced in the future to save bandwidth resources and improve resource utilization, and also avoid the negative impact of reduction on traffic bursts.
[0026] In the technical solution provided by the embodiment of the present application, the bandwidth prediction model is trained based on the historical bandwidth usage record information of multiple instances, and the bandwidth prediction model predicts the predicted bandwidth usage in the future preset time period based on the bandwidth data collected in real time. In this way, the change of traffic can be perceived in real time, which is convenient for dynamic allocation of bandwidth resources and can reduce the packet loss rate caused by traffic bursts. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0028] Figure 1 A schematic diagram of a resource scheduling system provided in an embodiment of the present application;
[0029] Figure 2 A schematic diagram of a resource scheduling method according to an embodiment of the present application;
[0030] Figure 3 A schematic diagram of a resource scheduling method according to an embodiment of the present application;
[0031] Figure 4 A signaling diagram provided for an embodiment of the present application;
[0032] Figure 5 An example diagram provided for an embodiment of the present application;
[0033] Figure 6 A structural block diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below according to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0035] In addition, some of the processes described in the specification, claims and the above-mentioned figures of the present application include multiple operations that appear in a specific order, and these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.
[0036] Take the example of an IoT terminal connecting to the cloud through an IoT directional card. The network bandwidth required at ordinary times (which can be called ordinary bandwidth) is relatively small, but when the version is upgraded or on holidays or event days, the network bandwidth required (which can be called peak bandwidth) is relatively large, which is much higher than the bandwidth required at ordinary times. In order to cope with the sudden situation of network traffic of the IoT, the peak bandwidth needs to be set as the limited bandwidth (Note: limited bandwidth refers to the maximum bandwidth allowed). In addition, the bandwidth used by most IoT gateways in different time periods varies greatly. For example, in certain time periods of a day, the bandwidth used by the IoT gateway is relatively large, for example, the bandwidth used accounts for 80% of the total bandwidth of the IoT gateway, and the bandwidth used by the IoT gateway in other time periods is relatively small, for example, the bandwidth used only accounts for 20% of the total bandwidth of the IoT gateway. In other words, most of the bandwidth resources of the IoT gateway are idle in certain time periods. It can be seen that in the face of the exclusive isolation service scenario of multiple tenants, shared gateway products have problems such as low overall network bandwidth resource utilization and high long-term resource costs.
[0037] In the process of studying the technical solutions provided by the embodiments of the present application, the applicant discovered that: generally, multiple instances are run on an IoT gateway, and one instance corresponds to one tenant. Network traffic bursts of different tenants do not occur at the same time. In this way, by migrating instances on multiple IoT gateways, the utilization of bandwidth resources of IoT gateways in different time periods can be relatively close, that is, the bandwidth resources of IoT gateways can be used in a balanced manner. In this way, the bandwidth resources of some IoT gateways with low resource utilization can be reduced in the future to save bandwidth resources, and to cope with traffic bursts of most instances. The solution for instance migration will be described in detail in the following embodiments.
[0038] Before introducing the resource scheduling method provided in the embodiment of the present application, the system architecture involved in the embodiment of the present application is introduced.
[0039] Figure 1 FIG. 1 is a schematic diagram of a resource scheduling system provided by an embodiment of the present application. Figure 1 As shown, the resource scheduling system includes a gateway controller 10 and a plurality of Internet of Things gateways 20. The plurality of Internet of Things gateways 20 may include a first Internet of Things gateway 20a and a second Internet of Things gateway 20b.
[0040] The gateway controller 10 is used to: determine whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state based on the historical bandwidth usage information of the first Internet of Things gateway; when the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state, determine a target instance from multiple instances run by the first Internet of Things gateway; wherein the target instance is an instance that makes the bandwidth resources of the first Internet of Things gateway not in a balanced usage state; determine whether the second Internet of Things gateway is suitable for receiving the target instance based on the historical bandwidth usage information of the second Internet of Things gateway and the historical bandwidth usage information of the target instance; and when it is determined that the second Internet of Things gateway is suitable for receiving the target instance, migrate the target instance to the second Internet of Things gateway.
[0041] The gateway controller 10 may be specifically composed of a cloud server or a cloud cluster. Each of the IoT gateways may be specifically composed of a cloud server or a cloud cluster. The cloud cluster includes a plurality of cloud servers. The number of cloud servers in the cloud cluster may be set according to actual needs, and the embodiment of the present application does not specifically limit this.
[0042] In one example, if Figure 1 As shown, the above system may further include: an Internet of Things terminal 30 , an operator network 40 and a cloud network 50 .
[0043] The specific implementation of each part of the above system and the interaction process between them will be described in detail in the following embodiments.
[0044] Figure 2 FIG. 1 is a flow chart of a resource scheduling method provided by an embodiment of the present application. The execution subject of the method may be a gateway controller in the resource control system. Figure 2 As shown, the method includes:
[0045] 101. Determine whether bandwidth resources of a first Internet of Things gateway are in a balanced usage state according to historical bandwidth usage information of the first Internet of Things gateway.
[0046] 102. When the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state, determine a target instance from multiple instances running by the first Internet of Things gateway.
[0047] The target instance is an instance that causes the bandwidth resources of the first Internet of Things gateway to be not in a balanced usage state.
[0048] 103. Determine whether the second Internet of Things gateway is suitable for receiving the target instance according to the historical bandwidth usage information of the second Internet of Things gateway and the historical bandwidth usage information of the target instance.
[0049] 104. When it is determined that the second Internet of Things gateway is suitable for receiving the target instance, migrate the target instance to the second Internet of Things gateway.
[0050] In the above 101, the historical bandwidth usage information of the first Internet of Things gateway can be determined based on the historical bandwidth usage record information of each instance in the multiple instances run by the first Internet of Things gateway. In actual applications, the Internet of Things gateway in the resource scheduling system can report the current bandwidth usage of each instance running on it to the gateway controller once every preset time interval (for example, 1 minute); the gateway controller records the current bandwidth usage of each instance reported by the Internet of Things gateway to form the historical bandwidth usage record information corresponding to each instance. Since in the embodiment of the present application, the instance may be migrated, the multiple bandwidth usages recorded in the historical bandwidth usage record information of an instance are reported by one or more Internet of Things gateways. Generally speaking, the older the record information is, the less reference significance it has. Therefore, the historical bandwidth usage record information of each instance can be the historical bandwidth usage record information in a recent time period, for example: the historical bandwidth usage record information in the recent three months or one month.
[0051] In one example, the historical bandwidth usage information of the first IoT gateway may include historical bandwidth usage record information of each instance among multiple instances run by the first IoT gateway.
[0052] In another example, the historical bandwidth usage record information of each of the multiple instances run by the first Internet of Things gateway can be counted to obtain the historical bandwidth usage information of the first Internet of Things gateway. Specifically, the historical bandwidth usage information of the first Internet of Things gateway may include: the historical bandwidth usage of each of the multiple instances run by the first Internet of Things gateway in multiple time periods, the historical bandwidth usage of the first Internet of Things gateway in multiple time periods, and the historical bandwidth usage rate of the first Internet of Things gateway in multiple time periods, etc. Among them, the multiple time periods can be obtained by dividing a cycle. Among them, the duration of a cycle and the granularity of the division can be set according to actual needs, and the embodiment of the present application does not specifically limit this. For example: a cycle can be a month, a week, a day, and so on. Taking one day as a cycle as an example, a day can be divided by hours, so that 24 time periods can be obtained; taking one week as a cycle as an example, a week can be divided by day, so that 7 time periods can be obtained.
[0053] According to the historical bandwidth usage record information of each instance, the historical bandwidth usage of each instance in each of the multiple time periods is determined, wherein the historical bandwidth usage may be the historical peak bandwidth usage. According to the historical bandwidth usage of each instance in each of the multiple instances run by the first IoT gateway, the historical bandwidth usage of the first IoT gateway in multiple time periods may be determined. Specifically, the sum of the historical bandwidth usage of the multiple instances in the first time period is used as the historical bandwidth usage of the first IoT gateway in the first time period. According to the historical bandwidth usage of the first IoT gateway in multiple time periods and the total bandwidth of the first IoT gateway, the historical bandwidth usage rate of the first IoT gateway in multiple time periods may be determined. Specifically, the ratio of the historical bandwidth usage of the first IoT gateway in the first time period to the total bandwidth of the first IoT gateway is used as the historical bandwidth usage rate of the first IoT gateway in the first time period. The first time period refers to any one of the multiple time periods.
[0054] According to the historical bandwidth usage information of the first IoT gateway, determine whether the bandwidth resources of the first IoT gateway are in a balanced usage state. The balanced usage state can be set according to actual needs, and the embodiment of the present application does not specifically limit this. For example: the balanced usage state means that the difference in bandwidth usage rate remains within a preset range, and the preset range can be less than or equal to 50%.
[0055] In the above 102, the instance is created for a tenant (ie, a user), and each instance is used to provide a gateway service for at least one IoT terminal device of the corresponding tenant, wherein the gateway service may include: a forwarding service, wherein the forwarding service involves network address translation.
[0056] In actual applications, after the first IoT gateway receives the tenant's instance creation request, it creates a corresponding instance on the first IoT gateway based on the IoT card IP (Internet Protocol) address carried in the instance creation request and the VPC address to which the instance is to be bound, and establishes a binding relationship between the instance, the IoT card IP address, and the VPC address. In this way, after the first IoT gateway receives the traffic packet, it can determine the target instance based on the IoT card IP address carried in the traffic packet and the above binding relationship; based on the target VPC address carried in the traffic packet and the above binding relationship, it can determine whether the target VPC address is the VPC address bound to the target instance; if so, the traffic packet is allocated to the target instance so that the target instance forwards the traffic packet to the target VPC; if not, the traffic packet is ignored.
[0057] In a feasible solution, a first instance can be determined from multiple instances by traversal; based on the historical bandwidth usage information of the remaining instances except the first instance in the multiple instances, it is determined whether the bandwidth resources of the first Internet of Things gateway can be in a balanced usage state after the first instance is deleted; if so, the first instance is used as the above-mentioned target instance; otherwise, the traversal is continued until the above-mentioned target instance is determined.
[0058] When the bandwidth resources of the first Internet of Things gateway are in a balanced usage state, it is determined that there is no need to perform instance migration for the first Internet of Things gateway.
[0059] In the above 103, the method for determining the historical bandwidth usage information of the second Internet of Things gateway is similar to the method for determining the historical bandwidth usage information of the first Internet of Things gateway. Please refer to the corresponding content above and will not be described in detail here.
[0060] In one example, the historical bandwidth usage information of the second IoT gateway may include the historical bandwidth usage record information of each of the multiple other instances run by the second IoT gateway. In another example, the historical bandwidth usage record information of each of the multiple other instances run by the second IoT gateway may be counted to obtain the historical bandwidth usage information of the second IoT gateway. Specifically, the historical bandwidth usage information of the second IoT gateway may include: the historical bandwidth usage of each of the multiple other instances run by the second IoT gateway in multiple time periods, the historical bandwidth usage of the second IoT gateway in multiple time periods, the historical bandwidth usage rate of the first IoT gateway in multiple time periods, and the like.
[0061] Whether the second IoT gateway is suitable for receiving the target instance may be considered in combination with one or more of the following methods:
[0062] Method 1: According to the historical bandwidth usage information of the second IoT gateway and the historical bandwidth usage information of the target instance, it can be determined whether the second IoT gateway has idle bandwidth resources to receive the target instance.
[0063] Method 2: According to the historical bandwidth usage information of the second IoT gateway and the historical bandwidth usage information of the target instance, it can be determined whether the second IoT gateway can be in a balanced usage state after receiving the target instance.
[0064] The process of determining whether the second Internet of Things gateway can be in a balanced usage state after receiving the target instance can refer to the process of determining whether the first Internet of Things gateway is in a balanced usage state, which will not be described in detail here.
[0065] In one example, if the second IoT gateway has idle bandwidth resources to receive the target instance, it can be determined that the second IoT gateway is suitable for receiving the target instance. In this way, the balanced use of the first IoT gateway can be improved without adding bandwidth resources.
[0066] In another example, if the second IoT gateway is in a balanced usage state after receiving the target instance, it can be determined that the second IoT gateway is suitable for receiving the target instance. In this way, not only can the second IoT gateway reach a balanced usage state, but the balanced usage of the first IoT gateway can also be improved. However, it should be noted that in this example, in some cases, it may be necessary to expand the bandwidth resources of the second IoT gateway so that the second IoT gateway can successfully receive and operate the target instance normally.
[0067] In another example, if the second IoT gateway has idle bandwidth resources to receive the target instance and the second IoT gateway can be in a balanced usage state after receiving the target instance, then the second IoT gateway is determined to be suitable for receiving the target instance. In this way, without adding bandwidth resources, not only can the second IoT gateway achieve a balanced usage state, but also the balanced usage degree of the first IoT gateway can be improved.
[0068] In the above 104, when it is determined that the second Internet of Things gateway is suitable for receiving the target instance, the target instance is migrated to the second Internet of Things gateway.
[0069] When it is determined that the second Internet of Things gateway is not suitable for receiving the target instance, it is determined not to migrate the target instance to the second Internet of Things gateway.
[0070] In actual application, the resource scheduling system may include multiple IoT gateways, including the first IoT gateway. By traversing, determine the second IoT gateway from the multiple IoT gateways except the first IoT gateway; and execute the above step 103; when it is determined that the second IoT gateway is suitable for receiving the target instance, migrate the target instance to the second IoT gateway; when it is determined that the second IoT gateway is not suitable for receiving the target instance, continue to traverse to determine a new second IoT gateway from the multiple IoT gateways except the first IoT gateway, and continue to execute the above step 103 until it is determined that the new second IoT gateway is suitable for receiving the target instance. Migrate the target instance to the new second IoT gateway.
[0071] In the technical solution provided by the embodiment of the present application, when the bandwidth resources of the Internet of Things gateway are not in a balanced usage state, the target instance that causes imbalance among the multiple instances on the Internet of Things gateway will be migrated to other Internet of Things gateways that are suitable for receiving the target instance. In other words, the instance migration solution provided by the embodiment of the present application helps to improve the balanced use of bandwidth resources of the Internet of Things gateway. In this way, the bandwidth resources of certain Internet of Things gateways with high resource usage balance and low resource utilization can be reduced in the future to save bandwidth resources and improve resource utilization, and also avoid the negative impact of reduction on traffic bursts.
[0072] It should be noted that after migrating the above-mentioned target instance to the second IoT gateway, if the first IoT gateway has not yet reached a balanced usage state, the above-mentioned resource scheduling scheme can continue to be executed for the first IoT gateway until the second IoT gateway suitable for receiving the new target instance cannot be found, or until the first IoT gateway can reach a balanced usage state, or until the maximum number of cycles is reached. The maximum number of cycles can be set according to actual needs, and the embodiment of the present application does not specifically limit this. For the first IoT gateway, after the cycle ends, the same resource scheduling scheme can continue to be executed for other IoT gateways in the resource scheduling system. Specifically, a new first IoT gateway can be determined from at least one unprocessed IoT gateway that is not yet in a balanced usage state in the resource scheduling system, and the above-mentioned steps are executed for the new first IoT gateway. Since instance migration will affect the network access experience to a certain extent, the above-mentioned resource scheduling scheme can be limited to execution during a time period with less network access, for example: execution from 2 am to 3 am. Once the time is up, the above-mentioned resource scheduling scheme is stopped.
[0073] In an achievable solution, the historical bandwidth usage information of the first IoT gateway includes: the historical bandwidth usage of the first IoT gateway in multiple time periods, that is, the historical bandwidth usage of the first IoT gateway in each of the multiple time periods. In the above 101, "determining whether the bandwidth resources of the first IoT gateway are in a balanced usage state according to the historical bandwidth usage information of the first IoT gateway" can be implemented by the following steps:
[0074] 1011. Determine a historical bandwidth usage rate of the first Internet of Things gateway in the multiple time periods according to the historical bandwidth usage of the first Internet of Things gateway in the multiple time periods and the total bandwidth of the first Internet of Things gateway.
[0075] 1012. Determine whether bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to the historical bandwidth usage rates of the first Internet of Things gateway in the multiple time periods.
[0076] In the above 1011, the above multiple time periods include a first time period, and the first time period refers to any one of the multiple time periods. The ratio of the historical bandwidth used by the first IoT gateway in the first time period to the total bandwidth of the first IoT gateway is used as the historical bandwidth usage rate of the first IoT gateway in the first time period.
[0077] For example: multiple instances include instance A and instance B, and the historical bandwidth usage of instance A and instance B in the first time period is a1 and b1, wherein a1 and b1 are summed to obtain a1+b1, which is used as the historical bandwidth usage of the first IoT gateway in the first time period; the total bandwidth of the first IoT gateway is c; (a1+b1) / c is used as the historical bandwidth usage rate of the first IoT gateway in the first time period.
[0078] In the above 1012, it is determined whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to the distribution of the bandwidth usage rate of the first Internet of Things gateway in each of the multiple time periods.
[0079] In a specific example, the above 1012 "determining whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to the historical bandwidth usage rate of the first Internet of Things gateway in the multiple time periods" can be implemented by the following steps:
[0080] S11. Determine a time period pair according to the multiple time periods; the time period pair includes a first time period and a second time period.
[0081] S12: Determine a difference in historical bandwidth usage corresponding to the time periods according to the historical bandwidth usage of the first Internet of Things gateway in the first time period and the historical bandwidth usage in the second time period.
[0082] S13: If the difference in the historical bandwidth usage rate corresponding to the time period is greater than or equal to a first preset difference threshold, it is determined that the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state.
[0083] In the above S11, any two time periods among the multiple time periods may be combined into a time period pair.
[0084] In the above S12, the difference between the historical bandwidth usage rate of the first Internet of Things gateway in the first time period and the historical bandwidth usage rate in the second time period is used as the historical bandwidth usage rate difference corresponding to the time period pair.
[0085] In the above S13, the size of the above first preset difference threshold can be set according to actual needs, and the embodiment of the present application does not specifically limit this. For example, the first preset difference threshold can be 50%.
[0086] In one feasible solution, there are multiple time period pairs. In the above 102, "when the bandwidth resources of the first IoT gateway are not in a balanced usage state, determining a target instance from multiple instances running by the first IoT gateway" can be implemented by the following steps:
[0087] 1021. Determine a target time period pair from the multiple time period pairs according to differences in historical bandwidth usage rates corresponding to the multiple time period pairs.
[0088] The difference in historical bandwidth usage rates corresponding to the target time period pair is greater than or equal to the first preset difference threshold; and the target time period pair includes a first target time period and a second target time period.
[0089] 1022. Determine the target instance from the multiple instances according to a historical bandwidth usage of each instance in the multiple instances in the first target time period and a historical bandwidth usage in the second target time period.
[0090] In the above 1021, the time period pair with the largest difference in historical bandwidth usage rate may be determined as the target time period pair.
[0091] In the above 1022, based on the historical bandwidth usage of each instance in the multiple instances in the first target time period and the historical bandwidth usage in the second target time period, the historical bandwidth usage difference of each instance between the first target time period and the second target time period is determined; based on the historical bandwidth usage difference of each instance between the first target time period and the second target time period, a target instance is determined from the multiple instances.
[0092] The multiple instances include a first instance, and the first instance refers to any one of the multiple instances. The difference between the historical bandwidth usage of the first instance in the first target time period and the historical bandwidth usage of the first instance in the second target time period is used as the historical bandwidth usage difference of the first instance between the first target time period and the second target time period.
[0093] In one example, the ratio of the difference in historical bandwidth usage of each instance between the first target time period and the second target time period to the total bandwidth of the first IoT gateway can be calculated, and any one of the at least one instance whose ratio is greater than a preset value is used as the target instance. The preset value can be set according to actual needs.
[0094] In another example, the instance with the largest difference in historical bandwidth usage is determined as the target instance.
[0095] Among them, the instance with the largest difference in historical bandwidth usage contributes most to the fact that the bandwidth resources of the first IoT gateway are not in a balanced usage state.
[0096] Furthermore, the historical bandwidth usage information of the second IoT gateway includes: the historical bandwidth usage of the second IoT gateway in multiple time periods; the historical bandwidth usage information of the target instance includes: the historical bandwidth usage of the target instance in the multiple time periods. In the above 103, "determining whether the second IoT gateway is suitable for receiving the target instance based on the historical bandwidth usage information of the second IoT gateway and the historical bandwidth usage information of the target instance" can be implemented by the following steps:
[0097] 1031. Determine an estimated bandwidth usage rate of the second Internet of Things gateway in the multiple time periods after receiving the target instance based on the historical bandwidth usage of the second Internet of Things gateway in the multiple time periods, the historical bandwidth usage of the target instance in the multiple time periods, and the total bandwidth of the second Internet of Things gateway.
[0098] 1032. Determine whether the second Internet of Things gateway is suitable for receiving the target instance according to the estimated bandwidth usage of the second Internet of Things gateway in the multiple time periods after receiving the target instance.
[0099] In the above 1031, the multiple time periods include the first time period, and the first time period is any one of the multiple time periods. The sum of the historical bandwidth used by the second IoT gateway in the first time period and the historical bandwidth used by the target instance in the first time period is used as the estimated bandwidth used by the second IoT gateway in the first time period after receiving the target instance; the ratio of the estimated bandwidth used by the second IoT gateway in the first time period after receiving the target instance to the total bandwidth of the second IoT gateway is used as the estimated bandwidth usage rate of the second IoT gateway in the first time period after receiving the target instance.
[0100] In one feasible solution, the above 1032, “determining whether the second IoT gateway is suitable for receiving the target instance according to the estimated bandwidth usage rate of the second IoT gateway in the multiple time periods after receiving the target instance”, can be implemented by the following steps:
[0101] S21. Determine a maximum estimated bandwidth usage rate from the estimated bandwidth usage rates of the second IoT gateway in the multiple time periods after receiving the target instance.
[0102] S22. If the maximum estimated bandwidth usage is less than or equal to the preset bandwidth usage, determine whether the bandwidth resources of the second Internet of Things gateway can be in a balanced usage state after receiving the target instance based on the estimated bandwidth usage of the second Internet of Things gateway in the multiple time periods after receiving the target instance.
[0103] S23: If the bandwidth resources of the second Internet of Things gateway can be in a balanced usage state after receiving the target instance, it is determined that the second Internet of Things gateway is suitable for receiving the target instance.
[0104] In the above S22, the size of the preset bandwidth usage can be set according to actual needs, and the preset bandwidth usage can be less than or equal to 100%. If the maximum estimated bandwidth usage is less than or equal to the preset bandwidth usage, it means that the second IoT gateway has enough free resources to receive the target instance.
[0105] The specific implementation process of the above-mentioned "determining whether the bandwidth resources of the second Internet of Things gateway can be in a balanced usage state after receiving the target instance according to the estimated bandwidth usage rate of the second Internet of Things gateway in the multiple time periods after receiving the target instance" can refer to the specific implementation process of determining whether the first Internet of Things gateway is in a balanced usage state in the above-mentioned embodiments, which will not be described in detail here.
[0106] In this embodiment, after receiving the target instance, the second IoT gateway is in a balanced usage state, and there is no need to expand the resources of the second IoT gateway to meet the network traffic forwarding requirements of all instances on it, thereby improving the resource utilization of the second IoT gateway. In addition, after migrating out the target instance, the first IoT gateway may be in a balanced usage state, and after migrating out the target instance that causes unbalanced usage, its overall bandwidth usage will remain below the preset bandwidth usage threshold (e.g., 50%). Therefore, the first IoT gateway can be appropriately scaled down, which not only does not affect the operation of each instance, but also saves resources and improves resource utilization.
[0107] After the instance migration process is completed for the resource scheduling system, it can be determined whether it is necessary to perform capacity reduction processing on each IoT gateway based on the historical bandwidth usage information of multiple instances currently running on each IoT gateway. Specifically, based on the historical bandwidth usage of each instance in multiple time periods among the multiple instances currently running on each IoT gateway, the historical bandwidth usage of each IoT gateway in multiple time periods is re-determined; based on the re-determined historical bandwidth usage of each IoT gateway in multiple time periods and the total bandwidth of each IoT gateway, the historical bandwidth usage rate of each IoT gateway in multiple time periods is re-determined; based on the re-determined maximum historical bandwidth usage rate of each IoT gateway, it is determined whether it is necessary to perform capacity expansion and contraction processing on each IoT gateway. For example: when the maximum historical bandwidth usage rate is less than 50%, capacity reduction processing can be performed; when the maximum historical bandwidth usage rate is greater than 1, capacity expansion processing is required. A capacity reduction instruction can be sent to the corresponding IoT gateway; after receiving the capacity reduction instruction, the IoT gateway performs capacity reduction processing on the bandwidth resources of the first IoT gateway.
[0108] It should be noted that, taking the IoT gateway including a cloud cluster as an example, the expansion or reduction processing is to add or delete cloud servers on the cloud cluster. Among them, the product of the historical bandwidth used by each instance in each time period and the first preset restriction coefficient greater than 1 (for example, 1.1) can be used as the restricted bandwidth of each instance in each time period. The restricted bandwidth of each instance in the first time period of the multiple instances currently running the first IoT gateway is summed to obtain the total restricted bandwidth of the first IoT gateway in the first time period. If the ratio of the maximum total restricted bandwidth of the first IoT gateway in the total restricted bandwidth of multiple time periods to the total bandwidth of the first IoT gateway is less than or equal to the first preset ratio threshold (for example, 50%), the reduction processing is determined; if the ratio of the maximum total restricted bandwidth to the total bandwidth of the first IoT gateway is greater than or equal to the second preset ratio threshold (for example, 1), the expansion processing is determined. Whether it is expansion or reduction processing, the product of the maximum total restricted bandwidth and the second preset restriction coefficient greater than 1 (for example, 1.1) can be used as the target total bandwidth.
[0109] The sizes of the first preset restriction coefficient, the second preset restriction coefficient, the first preset ratio threshold value and the second preset ratio threshold value can be set according to actual needs, and the embodiments of the present application do not specifically limit this. Note: The restricted bandwidth involved in the embodiments of the present application can also be referred to as a bandwidth quota, which can be understood as the maximum bandwidth that can be used.
[0110] In addition, the limited bandwidth of each instance in each time period can be sent to the IoT gateway where each instance is located, so that the IoT gateway allocates corresponding bandwidth resources to each instance in each time period. In one example, the historical bandwidth can specifically be the historical peak bandwidth.
[0111] In this way, when a traffic burst occurs again in the future, each IoT gateway will be able to respond normally without packet loss or other phenomena.
[0112] The resource allocation scheme in the above embodiment can cope with the traffic burst that has occurred before. When the traffic burst exceeds the limited bandwidth or the total bandwidth again, packet loss and the like will still occur. In order to solve this problem, the above method may also include:
[0113] 105. Input the currently used bandwidth of the first instance into a trained bandwidth prediction model, so that the bandwidth prediction model predicts the predicted used bandwidth of the first instance in a future preset time period.
[0114] The bandwidth prediction model is trained based on historical bandwidth usage record information of multiple instances.
[0115] 106. Determine an estimated restricted bandwidth of the first instance in the future preset time period according to the predicted used bandwidth of the first instance in the future preset time period.
[0116] 107. Send a resource allocation instruction to the first Internet of Things gateway according to the estimated limited bandwidth of the first instance in the future preset time period, so that the first Internet of Things gateway allocates bandwidth resources for the first instance.
[0117] In the above 105, the multiple instances include a first instance, and the first instance refers to any one of the multiple instances. The bandwidth prediction model may be a bandwidth prediction model based on a machine learning algorithm, wherein the machine learning algorithm may include: GBRT (Gradient Boosted Regression Trees). The historical bandwidth usage records of the above instances may specifically be the last six months, the last three months, and the last month. The historical bandwidth usage record information of the above instances includes: the historical bandwidth usage of each instance at each time point in history. Among them, the interval between any two adjacent time points is a preset time interval, for example: 1min. The bandwidth prediction model can be trained according to the historical bandwidth usage record information of each instance in the multiple instances. Among them, the internal structure and training process in the bandwidth prediction model can specifically refer to the corresponding content in the prior art. It should be noted that in addition to being trained based on the historical bandwidth usage record information of the above multiple instances, the bandwidth prediction model can also be trained based on the historical bandwidth usage records of other instances on other IoT gateways.
[0118] The currently used bandwidth of each of the above instances may specifically be the used bandwidth of each instance within a current preset time period (eg, 1 minute).
[0119] The currently used bandwidth of each instance in the multiple instances may be input into a trained bandwidth prediction model, so that the bandwidth prediction model can predict the predicted used bandwidth of each instance in a future preset time period (eg, the next 5 minutes).
[0120] In the above 106 , the product of the predicted bandwidth used by the first instance in the future preset time period and the first preset restriction system (eg, 1.1) may be used as the estimated restricted bandwidth of the first instance in the future preset time period.
[0121] In the above 107, the resource allocation instruction may carry an estimated limited bandwidth of the first instance in a future preset time period. The first Internet of Things gateway allocates bandwidth resources for the first instance according to the estimated limited bandwidth.
[0122] Optionally, the above method may further include:
[0123] 108. When the predicted bandwidth usage of the first instance in the future preset time period is greater than the current actual limited bandwidth of the first instance, or when the ratio of the predicted bandwidth usage to the current actual limited bandwidth is less than or equal to a fifth preset ratio threshold (for example: 70%), the above steps 106 and 107 are triggered to execute.
[0124] When the predicted bandwidth usage of the first instance in the future preset time period is greater than the current actual limited bandwidth of the first instance, it means that the bandwidth resources currently allocated to the first instance are insufficient and bandwidth resources need to be increased; when the ratio of the predicted bandwidth usage to the current actual limited bandwidth is less than or equal to the fifth preset ratio threshold (for example: 70%), it means that the bandwidth resources currently allocated to the first instance are large and surplus and bandwidth resources need to be reduced.
[0125] When the predicted bandwidth usage of the first instance in the future preset time period is less than or equal to the current actual restricted bandwidth of the first instance, and the ratio of the predicted bandwidth usage to the current actual restricted bandwidth is greater than the fifth preset ratio threshold, the current actual restricted bandwidth of the first instance continues to be used as the estimated restricted bandwidth of the first instance in the future preset time period. When the predicted bandwidth usage of the first instance in the future preset time period is less than or equal to the current actual restricted bandwidth of the first instance, and the ratio of the predicted bandwidth usage to the current actual restricted bandwidth is greater than the fifth preset ratio threshold, it means that the bandwidth resources currently allocated to the first instance are relatively appropriate, and therefore, there is no need to reallocate bandwidth resources for the first instance.
[0126] In actual applications, for other instances in the multiple instances except the first instance, the above steps 105, 106, 107, and 108 can also be used to implement dynamic bandwidth adjustment. In actual applications, for multiple instances, only one resource allocation instruction needs to be sent to the first IoT gateway to complete the dynamic bandwidth adjustment of multiple instances.
[0127] Optionally, the above method may further include:
[0128] 109. Determine whether it is necessary to scale up or down the bandwidth resources of the first Internet of Things gateway according to the estimated limited bandwidth of each instance in the future preset time period and the total bandwidth of the first Internet of Things gateway.
[0129] According to the sum of the estimated restricted bandwidths of each instance in the multiple instances in the future preset time period, the estimated total restricted bandwidth of the first Internet of Things gateway in the future preset time period is used as the estimated total restricted bandwidth; according to the estimated total restricted bandwidth and the total bandwidth of the first Internet of Things gateway, it is determined whether it is necessary to perform expansion and contraction processing on the bandwidth resources of the first Internet of Things gateway. Specifically, if the ratio of the estimated total restricted bandwidth to the total bandwidth of the first Internet of Things gateway is less than or equal to the third preset ratio threshold (for example, 50%), the capacity reduction processing is determined; if the ratio of the estimated total restricted bandwidth to the total bandwidth of the first Internet of Things gateway is greater than the fourth preset ratio threshold (for example, 1), the capacity expansion processing is determined. If the ratio of the estimated total restricted bandwidth to the total bandwidth of the first Internet of Things gateway is greater than the third preset ratio threshold and less than or equal to the fourth preset ratio threshold, it is determined not to perform expansion and contraction processing.
[0130] Whether it is expansion or reduction, the target total bandwidth can be determined according to the estimated total restricted bandwidth. Specifically, the product of the estimated total restricted bandwidth and the second preset restriction coefficient can be used as the target total bandwidth. The expansion and reduction instructions are generated according to the target total bandwidth; the expansion and reduction instructions are sent to the first IoT gateway, so that the first IoT gateway performs the expansion and reduction processing according to the instructions.
[0131] In the technical solution provided by the embodiment of the present application, the bandwidth prediction model is trained based on the historical bandwidth usage record information of each instance, and the bandwidth prediction model predicts the predicted bandwidth usage in the future preset time period based on the bandwidth data collected in real time. In this way, the change of traffic can be perceived in real time, which is convenient for dynamic expansion and contraction of bandwidth resources and can reduce the packet loss rate caused by traffic bursts.
[0132] The first IoT gateway can allocate bandwidth resources after executing the expansion and contraction process. The first IoT gateway can allocate corresponding bandwidth resources to each instance according to the estimated limited bandwidth of each instance in the future preset time period. The bandwidth resources allocated to each instance can only serve the instance later, and cannot serve other instances, thereby realizing resource isolation between instances. The above-mentioned bandwidth resources may include CPU resources and memory resources.
[0133] Furthermore, the above method may also include:
[0134] 110. Receive a bandwidth adjustment requirement set by a user for the first instance.
[0135] 111. Determine a target bandwidth usage of the first instance in a future time period to be adjusted according to the bandwidth adjustment requirement.
[0136] 112. If the future preset time period intersects with the future time period to be adjusted, determine an estimated restricted bandwidth of the first instance in the future preset time period according to the target bandwidth used by the first instance in the time period to be adjusted.
[0137] The product of the target bandwidth used by the first instance in the time period to be adjusted and the first preset restriction coefficient may be used as the estimated restricted bandwidth of the first instance in the future preset time period.
[0138] 113. If the future preset time period does not intersect with the future time period to be adjusted, triggering the step of determining the limited bandwidth of the first instance in the future preset time period based on the predicted bandwidth usage of the first instance in the future preset time period.
[0139] The product of the predicted bandwidth used by the first instance in the future preset time period and the first preset restriction coefficient may be used as the restricted bandwidth of the first instance in the future preset time period.
[0140] The bandwidth adjustment requirement may include an indicated time period and an indicated bandwidth usage. The indicated time period may be used as the future time period to be adjusted, or the starting point of the indicated time period minus a preset starting point threshold (e.g., 3 minutes) may be used as the future time period to be adjusted. In this way, the starting point of the future time period to be adjusted will be earlier than the starting point of the indicated time period. The indicated bandwidth usage is used as the target bandwidth usage.
[0141] For example, the indicated time period is from 10:00 to 11:00 on March 3, 2022, and the indicated bandwidth usage is 1000MB / s. Then, the time period to be adjusted in the future is from 9:57 to 11:00 on March 3, 2022, and the target bandwidth usage is 1000MB / s.
[0142] In the above 111, for example: the future preset time period is from 9:55 to 10:00 on March 3, 2022, and the future time period to be adjusted is from 9:57 to 11:00 on March 3, 2022. The future preset time period and the future time period to be adjusted intersect.
[0143] For another example: the future preset time period is from 9:50 to 9:55 on March 3, 2022, and the future time period to be adjusted is from 9:57 to 11 on March 3, 2022. The future preset time period and the future time period to be adjusted do not intersect.
[0144] Figure 5 The example shows the limited bandwidth configured for each instance on an IoT gateway in different time periods.
[0145] In this embodiment, bandwidth demand uploaded by users (ie, tenants) is received to schedule bandwidth resources, which is more in line with the actual usage of users.
[0146] Figure 3 FIG. 1 is a flow chart of a resource scheduling method provided by another embodiment of the present application. The execution subject of the method may be a gateway controller in the resource scheduling system. Figure 3 As shown, the method may include:
[0147] 201. Input the currently used bandwidth of the first instance run by the first Internet of Things gateway into a trained bandwidth prediction model, so that the bandwidth prediction model predicts the predicted used bandwidth of the first instance in a future preset time period.
[0148] 202. Determine an estimated restricted bandwidth of the first instance in the future preset time period according to the predicted used bandwidth of the first instance in the future preset time period.
[0149] 203. Send a resource allocation instruction to the first Internet of Things gateway according to the estimated limited bandwidth of the first instance in the future preset time period, so that the first Internet of Things gateway allocates bandwidth resources for the first instance.
[0150] In the technical solution provided by the embodiment of the present application, the bandwidth prediction model is trained based on the historical bandwidth usage record information of each instance, and the bandwidth prediction model predicts the predicted bandwidth usage in the future preset time period based on the bandwidth data collected in real time. In this way, the change of traffic can be perceived in real time, which is convenient for dynamic allocation of bandwidth resources and can reduce the packet loss rate caused by traffic bursts.
[0151] Furthermore, it may also include:
[0152] 204. Determine whether it is necessary to scale up or down the bandwidth resources of the first Internet of Things gateway according to the estimated limited bandwidth of each instance in the multiple instances run by the first Internet of Things gateway in the future preset time period and the total bandwidth of the first Internet of Things gateway.
[0153] The multiple instances include the first instance. Bandwidth resource allocation can be performed after the capacity expansion and contraction processing.
[0154] In this example, the bandwidth resources of the IoT gateway can be expanded or reduced, which helps to improve resource utilization and reduce the packet loss rate caused by traffic bursts.
[0155] It should be noted here that: for the contents of each step not fully described in detail in the method provided in the embodiment of the present application, please refer to the corresponding contents in the above embodiment, which will not be repeated here. In addition, in addition to the above steps, the method provided in the embodiment of the present application may also include other parts or all of the steps in the above embodiments, which can be specifically referred to the corresponding contents in the above embodiments, which will not be repeated here.
[0156] The resource scheduling solution provided in the embodiment of the present application can be applied to any one of the IoT scenarios, or a hybrid scenario of any two or more IoT scenarios, including Internet of Vehicles, smart wearables, smart security, mobile terminal devices, smart industry, smart agriculture, shared devices, and medical services. The above-mentioned IoT terminals may include cameras, smart cars, mobile phones, drones, etc.
[0157] The following will be combined Figure 4 The resource scheduling solution provided in the embodiment of the present application is introduced as follows:
[0158] Step 1: The client 60 sends an instance creation request to the gateway controller 10 in response to a user input operation.
[0159] Step 2: The gateway controller 10 determines the initial limited bandwidth according to the IoT card information carried in the instance creation request.
[0160] Specifically, the initial bandwidth limit is determined according to the number of IoT cards.
[0161] Step 3: The gateway controller 10 sends an instance creation instruction carrying an initial bandwidth restriction to the IoT gateway 20 .
[0162] Step 4: The IoT gateway 20 creates a corresponding instance for the above user.
[0163] Step 5: The user's IoT terminal 30 sends a traffic packet to the IoT gateway 20.
[0164] Step 6: The instance corresponding to the user on the IoT gateway 20 is responsible for forwarding the traffic packet to the cloud IoT platform 50.
[0165] Step 7: The IoT gateway 20 reports the bandwidth usage of each instance once every minute, which is recorded by the gateway controller.
[0166] Step 8: The gateway controller 10 determines the instance to be scheduled and the target IoT gateway to be scheduled.
[0167] The specific implementation process of step 8 can refer to the corresponding content in the above embodiments, which will not be repeated here.
[0168] Step 9: The gateway controller 10 sends an instruction on instance migration to the IoT gateway.
[0169] Specifically, an instance creation instruction may be sent to the target IoT gateway; after receiving a successful establishment message fed back by the target IoT gateway, an instance deletion instruction may be sent to the IoT gateway where the instance to be scheduled originally resides, so that the IoT gateway deletes the target instance to be scheduled.
[0170] Step 10, the client 60 sends the bandwidth adjustment requirement input by the user to the gateway controller 10.
[0171] Step 11: The gateway controller 10 estimates the estimated limited bandwidth of each instance based on the prediction result of the bandwidth prediction model and the bandwidth adjustment requirement.
[0172] For the specific process, please refer to the corresponding contents in the above embodiments, which will not be repeated here.
[0173] Step 12: The gateway controller 10 determines whether it is necessary to expand or shrink the capacity of the Internet of Things gateway according to the estimation result.
[0174] For the specific process, please refer to the corresponding contents in the above embodiments, which will not be repeated here.
[0175] Step 13: When capacity expansion or contraction processing is required, the gateway controller 10 sends a capacity expansion or contraction instruction to the IoT gateway 20.
[0176] Step 14: The gateway controller 10 sends a resource allocation instruction to the IoT gateway 20 according to the estimated limited bandwidth of each instance.
[0177] Step 15: The IoT gateway 20 reallocates resources.
[0178] In summary, the embodiments of the present application provide a segmented peak-shifting scheduling solution and a bandwidth resource elastic scaling solution based on tenant configuration and bandwidth awareness.
[0179] Figure 6 FIG. 1 is a schematic diagram showing the structure of an electronic device provided by an embodiment of the present application. Figure 6 As shown, the electronic device includes a memory 1101 and a processor 1102. The memory 1101 can be configured to store various other data to support operations on the electronic device. Examples of these data include instructions for any application or method for operating on the electronic device. The memory 1101 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.
[0180] The memory 1101 is used to store programs;
[0181] The processor 1102 is coupled to the memory 1101 and is used to execute the program stored in the memory 1101 to implement the resource scheduling method provided by the above-mentioned method embodiments.
[0182] Further, if Figure 6 As shown, the electronic device also includes: a communication component 1103, a display 1104, a power component 1105, an audio component 1106 and other components. Figure 6 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 6 Components shown.
[0183] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the steps or functions of the resource scheduling method provided by the above-mentioned method embodiments can be implemented.
[0184] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0185] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0186] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource scheduling method, wherein: include: Determine whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to the historical bandwidth usage information of the first Internet of Things gateway; The balanced usage state means that the difference in historical bandwidth usage between any two time periods remains within a preset range; When the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state, determining a target instance from multiple instances run by the first Internet of Things gateway; wherein the target instance is an instance that causes the bandwidth resources of the first Internet of Things gateway to be not in a balanced usage state; Determining whether the second Internet of Things gateway is suitable for receiving the target instance according to the historical bandwidth usage information of the second Internet of Things gateway and the historical bandwidth usage information of the target instance; When it is determined that the second Internet of Things gateway is suitable for receiving the target instance, migrating the target instance to the second Internet of Things gateway; After migrating out the target instance, if the first Internet of Things gateway is in a balanced usage state and the bandwidth usage rate of the first Internet of Things gateway remains at a level lower than a preset bandwidth usage rate threshold, the bandwidth resources of the first Internet of Things gateway are reduced.
2. The method according to claim 1, wherein: The historical bandwidth usage information of the first IoT gateway includes: the historical bandwidth usage of the first IoT gateway in multiple time periods; Determining whether bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to historical bandwidth usage information of the first Internet of Things gateway includes: Determine a historical bandwidth usage rate of the first Internet of Things gateway in the multiple time periods according to the historical bandwidth used by the first Internet of Things gateway in the multiple time periods and the total bandwidth of the first Internet of Things gateway; According to the historical bandwidth usage rates of the first Internet of Things gateway in the multiple time periods, it is determined whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state.
3. The method according to claim 2, wherein: Determining whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state according to the historical bandwidth usage rates of the first Internet of Things gateway in the multiple time periods includes: Determine a time period pair according to the multiple time periods; the time period pair includes a first time period and a second time period; Determine a difference in historical bandwidth usage corresponding to the time periods according to the historical bandwidth usage of the first Internet of Things gateway in the first time period and the historical bandwidth usage in the second time period; If the difference in the historical bandwidth usage rate corresponding to the time period is greater than or equal to the first preset difference threshold, it is determined that the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state.
4. The method according to claim 3, wherein: The time period pair is multiple; When the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state, determining a target instance from multiple instances run by the first Internet of Things gateway includes: Determine a target time period pair from the multiple time period pairs according to the differences in historical bandwidth usage rates corresponding to the multiple time period pairs; wherein the difference in historical bandwidth usage rates corresponding to the target time period pair is greater than or equal to the first preset difference threshold; and the target time period pair includes a first target time period and a second target time period; The target instance is determined from the multiple instances according to a historical bandwidth usage of each instance in the multiple instances in the first target time period and a historical bandwidth usage in the second target time period.
5. The method according to claim 4, wherein: Determining the target instance from the multiple instances according to the historical bandwidth usage of each instance in the first target time period and the historical bandwidth usage in the second target time period includes: Determine a difference in historical bandwidth usage of each instance between the first target time period and the second target time period according to the historical bandwidth usage of each instance in the first target time period and the historical bandwidth usage in the second target time period; An instance having the largest difference in historical bandwidth usage is determined as the target instance.
6. The method according to any one of claims 1 to 5, wherein: The historical bandwidth usage information of the second IoT gateway includes: the historical bandwidth usage of the second IoT gateway in multiple time periods; the historical bandwidth usage information of the target instance includes: the historical bandwidth usage of the target instance in the multiple time periods; Determining whether the second Internet of Things gateway is suitable for receiving the target instance according to the historical bandwidth usage information of the second Internet of Things gateway and the historical bandwidth usage information of the target instance includes: Determine, according to the historical bandwidth usage of the second IoT gateway in the multiple time periods, the historical bandwidth usage of the target instance in the multiple time periods, and the total bandwidth of the second IoT gateway, an estimated bandwidth usage rate of the second IoT gateway in the multiple time periods after receiving the target instance; Determine whether the second Internet of Things gateway is suitable for receiving the target instance according to the estimated bandwidth usage rate of the second Internet of Things gateway in the multiple time periods after receiving the target instance.
7. The method according to claim 6, wherein: Determining whether the second Internet of Things gateway is suitable for receiving the target instance according to the estimated bandwidth usage rate of the second Internet of Things gateway in the multiple time periods after receiving the target instance includes: Determining a maximum estimated bandwidth usage rate from the estimated bandwidth usage rates of the second IoT gateway in the plurality of time periods after receiving the target instance; If the maximum estimated bandwidth usage is less than or equal to the preset bandwidth usage, determining whether the bandwidth resources of the second Internet of Things gateway can be in a balanced usage state after receiving the target instance according to the estimated bandwidth usage of the second Internet of Things gateway in the multiple time periods after receiving the target instance; If the bandwidth resources of the second Internet of Things gateway can be in a balanced usage state after receiving the target instance, it is determined that the second Internet of Things gateway is suitable for receiving the target instance.
8. The method according to any one of claims 1 to 5, wherein: The multiple instances include a first instance; the method further includes: Inputting the currently used bandwidth of the first instance into a trained bandwidth prediction model, so that the bandwidth prediction model predicts the predicted used bandwidth of the first instance in a future preset time period; Determining an estimated limited bandwidth of the first instance in the future preset time period according to the predicted used bandwidth of the first instance in the future preset time period; According to the estimated limited bandwidth of the first instance in the future preset time period, a resource allocation instruction is sent to the first Internet of Things gateway, so that the first Internet of Things gateway allocates bandwidth resources for the first instance.
9. The method according to claim 8, wherein: Also includes: Determine whether it is necessary to scale up or down the bandwidth resources of the first Internet of Things gateway according to the estimated limited bandwidth of each instance in the future preset time period and the total bandwidth of the first Internet of Things gateway.
10. The method according to claim 8, wherein: Also includes: receiving a bandwidth adjustment requirement set by a user for the first instance; Determining, according to the bandwidth adjustment requirement, a target bandwidth used by the first instance in a future time period to be adjusted; If the future preset time period intersects with the future time period to be adjusted, determining the estimated restricted bandwidth of the first instance in the future preset time period according to the target bandwidth used by the first instance in the time period to be adjusted; If the future preset time period does not intersect with the future time period to be adjusted, the step of determining the limited bandwidth of the first instance in the future preset time period based on the predicted bandwidth usage of the first instance in the future preset time period is triggered.
11. A resource scheduling system, wherein: include: A gateway controller and a plurality of Internet of Things gateways; the plurality of Internet of Things gateways include a first Internet of Things gateway and a second Internet of Things gateway; Wherein, the gateway controller is used to: Determine, according to the historical bandwidth usage information of the first Internet of Things gateway, whether the bandwidth resources of the first Internet of Things gateway are in a balanced usage state; the balanced usage state means that the difference in historical bandwidth usage between any two time periods remains within a preset range; When the bandwidth resources of the first Internet of Things gateway are not in a balanced usage state, determining a target instance from multiple instances run by the first Internet of Things gateway; wherein the target instance is an instance that causes the bandwidth resources of the first Internet of Things gateway to be not in a balanced usage state; Determining whether the second Internet of Things gateway is suitable for receiving the target instance according to the historical bandwidth usage information of the second Internet of Things gateway and the historical bandwidth usage information of the target instance; When it is determined that the second Internet of Things gateway is suitable for receiving the target instance, migrating the target instance to the second Internet of Things gateway; After migrating out the target instance, if the first Internet of Things gateway is in a balanced usage state and the bandwidth usage rate of the first Internet of Things gateway remains at a level lower than a preset bandwidth usage rate threshold, the bandwidth resources of the first Internet of Things gateway are reduced.
12. An electronic device, wherein: include: A memory and a processor, wherein The memory is used to store programs; The processor is coupled to the memory, and is used to execute the program stored in the memory to implement the resource scheduling method according to any one of claims 1 to 10.
13. A computer-readable storage medium storing a computer program, wherein: When the computer program is executed by a computer, the resource scheduling method according to any one of claims 1 to 10 can be implemented.
Citation Information
Cited By
Predicting a bandwidth usage associated with a mobile device operating on a wireless telecommunication network
US12413677B2
