Internet of Things system current limiting method and Internet of Things system

By setting current limit thresholds for each type of API and traversing the server cluster, the problem of insufficient current limit in the existing technology is solved, and the resource utilization rate and traffic management efficiency of the Internet of Things system are improved.

CN119299376APending Publication Date: 2025-01-10SANTAK ELECTRONICS SHENZHEN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310843563.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The current limiting technology of existing IoT systems cannot achieve fine-grained current limiting and dynamic adjustments to the business level, resulting in low resource waste and low utilization rate, and the inability to make full use of system resources.

Method used

By setting a current limit threshold for each type of API in the Internet of Things system, evaluating the maximum access traffic based on the API's business capabilities, and traversing the available API interfaces in the server cluster to release or deny access, achieving refined current limiting and avoiding overall situations Waste of resources caused by flow restrictions.

Benefits of technology

It improves the resource utilization rate of the Internet of Things system, avoids the restriction of APIs caused by unified flow restrictions, and achieves more efficient traffic management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119299376A_ABST
    Figure CN119299376A_ABST
Patent Text Reader

Abstract

The invention provides a flow limiting method for an Internet of Things system, and the method comprises the steps: calculating the current existing flow corresponding to an access type for the access initiated by a user, obtaining the maximum service flow, releasing the access initiated by the user when the current existing flow is smaller than the maximum service flow, and releasing the access initiated by the user when the current existing flow is greater than or equal to the maximum access service flow. And traversing whether an external user interface which can be accessed by the user exists in the server cluster, and releasing the access initiated by the user when the external user interface which can be accessed by the user exists. According to the invention, current limiting is carried out on different types of APIs according to the service capabilities of the different types of APIs. The invention further provides the gateway applied to the Internet of Things system and the Internet of Things system, and the resource utilization rate of the Internet of Things system is improved through refined current limiting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, specifically, to the technical field of current limiting in an Internet of Things system, and more specifically, to an Internet of Things current limiting method and an Internet of Things system. Background Art

[0002] At present, the Internet of Things (IOT) is developing rapidly, and the importance of IoT devices is increasing. More and more people are using or preparing to use IoT systems. With the influx of a large number of consumers, how to prevent a large number of users from accessing and connecting devices, causing system overload and thus system crashes, and how to provide a better user experience and ensure stable and efficient system operation have become issues that the Internet of Things must consider. Therefore, current limiting has become an indispensable design for the IOT system.

[0003] The so-called flow control refers to limiting the access flow of the IoT system. Access exceeding the flow threshold will be denied or placed in a queue to avoid system crash.

[0004] In the prior art, the more mainstream current limiting technologies are basically for APIs (external user interfaces) that provide services to the outside. The common practice is to directly deploy traffic restrictions on the gateway, such as using sentinel or hystrix and other tools for global or all-round current limiting. They treat APIs equally, uniformly limit the overall flow of APIs, set a unified traffic threshold, and restrict access to all APIs once the traffic threshold is exceeded. The benefits of such a current limiting method are indeed obvious, overall flow control and overall current limiting. However, this type of solution requires evaluating the estimated value of the traffic access volume of each server at the beginning of service provision, and setting a traffic threshold in the current limiting device. When this value is reached, access is denied or the access is placed in the queuing system. In fact, this type of solution is a preventive measure based on the expected impact of API requests on the system, and treats all APIs equally, which may cause some service providers to not reach the maximum traffic value, but have been overall restricted, resulting in some waste of resources. This type of solution cannot achieve fine-grained current limiting and dynamic adjustment of traffic at the business level, making it impossible to fully utilize the resources of the Internet of Things system.

[0005] As we all know, the capabilities of each type of API are different. Some APIs have more complex processing processes, while some have simple processing processes. For example, some APIs use transactions, while some APIs are simply queries. The time complexity of each type of API is different. Using a unified method to control the flow of them will result in insufficient utilization of resources. In order to improve the resource utilization of the IoT system, a more reasonable flow control solution is urgently needed. Summary of the invention

[0006] Therefore, the purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a new current limiting method for an Internet of Things system and an Internet of Things system.

[0007] According to a first aspect of the present invention, a method for limiting current in an Internet of Things system is provided, wherein a user initiates access to the Internet of Things system through a gateway, the Internet of Things system includes a server cluster composed of multiple servers, and the Internet of Things system is configured with multiple external user interfaces of different categories that provide services to the outside, and each type of external user interface has multiple external user interfaces. The method includes responding to the access initiated by the user and performing the following steps: calculating the current existing traffic and obtaining the maximum service traffic, wherein the current existing traffic is the current existing traffic of the external user interface category corresponding to the access initiated by the user in the Internet of Things system, and the maximum service traffic is the maximum service traffic of the external user interface category corresponding to the user initiated in the Internet of Things system; judging whether to release the access initiated by the user based on the current existing traffic and the maximum service traffic, wherein when the current existing traffic is less than the maximum service traffic, releasing the access initiated by the user; when the current existing traffic is greater than or equal to its maximum access service traffic, traversing whether there are any external user interfaces accessible to the user in the server cluster, and releasing the access initiated by the user when there are external user interfaces accessible to the user.

[0008] Preferably, the method further includes: pre-setting a traffic configuration table in each external user interface, wherein the traffic configuration table includes the service capabilities and maximum operating time of the external user interface; and evaluating the maximum service traffic of each category of external user interface in the Internet of Things system based on the traffic configuration table of each external user interface.

[0009] Preferably, a plurality of Dockers are deployed on the server cluster of the Internet of Things system, a plurality of external user interfaces of different categories are deployed in each Docker, and each category has one external user interface, and the method includes evaluating the maximum service flow of each category of external user interface in the following manner:

[0010]

[0011] in,

[0012]

[0013]

[0014] Among them, K(x) represents the maximum service flow of the external user interface of category x, G(x) represents the service flow of the external user interface of category x in Docker, f(x) represents the maximum access flow threshold of the external user interface of category x in Docker, apiCapability x Indicates the business capability of the external user interface of category x in Docker, runningTime x It represents the maximum running time of the external user interface of category x in Docker, Settingmemory represents the memory configuration of Docker, Memory represents the total memory of the server cluster of the Internet of Things system, CPUweight represents the CPU configuration of Docker, n represents the total number of external user interfaces in Docker, and N represents the total number of Dockers.

[0015] Preferably, when the current existing traffic is greater than or equal to the maximum service traffic, it is traversed to see whether there is a Docker accessible to the user in the Internet of Things system, and when there is a Docker accessible to the user, the access initiated by the user is allowed.

[0016] Preferably, the method further includes: before calculating the current existing traffic, querying the resource occupancy of the server cluster in the Internet of Things system, determining whether the resource occupancy of the server cluster reaches a preset resource occupancy threshold, and when the resource occupancy is greater than or equal to the preset resource threshold, denying the access initiated by the user or placing it in a queue to be released.

[0017] Preferably, when the current traffic is greater than or equal to the maximum service traffic and there is no external user interface accessible to the user, a corresponding category of external user interface traffic alarm information is generated.

[0018] According to a second aspect of the present invention, there is provided a gateway applied to an Internet of Things system, which is configured in the Internet of Things system, and the gateway is configured to use the method described in the first aspect of the present invention to limit the current of the Internet of Things system.

[0019] According to a third aspect of the present invention, there is provided an Internet of Things system, the Internet of Things system comprising: a server cluster, comprising a plurality of servers and configured with a plurality of Dockers, wherein each Docker is deployed with a plurality of external user interfaces of different categories and each category has one external user interface; a traffic evaluation table, which is configured in a cache of the Internet of Things system and is used to record information of each external user interface, wherein each external user interface setting includes at least a maximum access traffic threshold and a maximum service traffic; a gateway as described in the second aspect of the present invention, which is used to support users in initiating access to the Internet of Things system; a service provider array, which is configured in the cache of the Internet of Things system and comprises a plurality of groups of traffic data, wherein each group of traffic data is used to indicate traffic information of an external user interface.

[0020] Preferably, the system is also configured as follows: when a new Docker is enabled, the corresponding category of the external user interface in the Docker is queried in the traffic evaluation table and the information of the corresponding category in the traffic evaluation table is initialized, and the corresponding external user interface traffic information is added in the service provider array; if the external user interface category in the Docker does not exist in the traffic evaluation table, its corresponding category is added in the traffic evaluation table and the external user interface traffic information of this category is added in the service provider array; and, when a Docker goes offline, the information of its corresponding category in the traffic evaluation table is updated and the external user interface traffic information involved in the offline Docker is deleted from the service provider array.

[0021] Preferably, the system is further configured to: in response to external user interface traffic alarm information, determine whether there are resources available for expansion in the Internet of Things system, and when there are resources available for expansion, start a new Docker that can provide an external user interface of this category according to the external user interface category in the alarm information.

[0022] Compared with the prior art, the advantages of the present invention are: the present invention limits the flow of different categories of APIs according to their business capabilities, thereby achieving refined flow limiting, avoiding the situation where APIs with traffic are restricted due to unified flow limiting, and greatly improving the resource utilization of the Internet of Things system. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:

[0024] Figure 1 A schematic diagram of a flow chart of a current limiting method for an Internet of Things system according to an embodiment of the present invention;

[0025] Figure 2 A schematic diagram of the operation process of the Internet of Things system according to an embodiment of the present invention;

[0026] Figure 3 A schematic diagram of an initialization process of an Internet of Things system according to an embodiment of the present invention;

[0027] Figure 4 Schematic diagram of the current limiting process of the Internet of Things system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0028] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail by specific embodiments below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0029] As described in the background technology, the current limiting scheme in the prior art is overall flow control and overall flow limiting, which is a preventive measure taken based on the expected impact of API requests on the system, and treats all APIs equally. This may result in some service providers not reaching the maximum flow, but having their flow limited as a whole, thereby causing some waste of resources. This type of scheme cannot achieve flow limiting and dynamic adjustment of flow at the business level, making it impossible to fully utilize the resources of the Internet of Things system.

[0030] In order to solve the above problems, the present invention designs a solution for refined flow limiting based on the characteristics of external user interfaces (hereinafter referred to as APIs for convenience of description) and users of the Internet of Things system, thereby reducing the waste of system resources. In summary, the solution of the present invention is to evaluate the maximum access flow for the service capability of each API, and to estimate the maximum service flow that can be provided by the corresponding category of APIs based on the maximum access flow of each API during deployment, wherein APIs with the same service capability belong to the same category. When a user initiates access, the system determines whether there is flow based on the existing flow and the maximum service flow for the category corresponding to the access, and directly releases the access when there is flow, and denies access or enters the queue sequence when there is no flow. In short, the present invention sets flow limiting solutions for each category of APIs, sets flow limiting thresholds according to the service capabilities of different categories of APIs, so that the flow limiting thresholds are closely related to the service capabilities of the APIs themselves, and implements refined flow limiting for different categories of APIs, avoiding some APIs being limited before reaching the maximum value due to overall flow limiting, thereby improving the resource utilization of the Internet of Things system.

[0031] In order to better understand the present invention, the present invention is described in detail below with reference to the accompanying drawings and embodiments.

[0032] As is known to all, the Internet of Things is generally constructed in the form of a server cluster and used to provide external services. Among them, multiple types of APIs providing services to the outside are configured in the Internet of Things system. There are multiple APIs of each type, and the service capabilities and traffic of different APIs are different. If all APIs are uniformly limited, the problem described in the background technology will occur. The access traffic of some types of APIs is limited before reaching the maximum value, which will obviously reduce the resource utilization of the Internet of Things system.

[0033] In view of this, if Figure 1 As shown, the present invention proposes a method for limiting the flow of the Internet of Things, the method includes responding to the access initiated by the user, and performing the following steps: S1, calculating the current existing flow and obtaining the maximum service flow, wherein the current existing flow is the current existing flow of the external user interface category corresponding to the access initiated by the user in the Internet of Things system, and the maximum service flow is the maximum service flow of the external user interface category corresponding to the user initiated in the Internet of Things system; S2, based on the current existing flow and the maximum service flow, judging whether to release the access initiated by the user, if not, that is, the current existing flow is less than the maximum service flow, the access initiated by the user is released; if so, the current existing flow is greater than or equal to its maximum access service flow, traversing whether there are still external user interfaces accessible to the user in the server cluster, and releasing the access initiated by the user when there are external user interfaces accessible to the user. In this way, accurate flow limiting can be performed for different APIs to prevent the API that has not reached the maximum access value from being restricted due to overall flow limiting.

[0034] According to an embodiment of the present invention, the maximum service flow of each category of API is evaluated based on the service capability of this category of API by means of a general estimation function. The maximum service flow of each category of API is related to the hardware resource configuration in the IoT system, the service capability of the API itself, the running time, etc. In the present invention, when constructing the IoT system, a flow configuration table is set in advance in each API. The flow configuration table contains information such as the service capability and maximum running time of the API. The maximum service flow of each category of API can be evaluated and calculated through the flow configuration table of the API. Then, a flow evaluation table can be configured in the cache of the IoT system to record the maximum service flow of each category of API. The flow evaluation table should be updated in real time in the IoT system according to the changes of the API. From the perspective of software implementation, the present invention configures a maximum traffic threshold for each API when the IoT system is initialized. Specifically, the traffic configuration table is written on the API by adding annotations in the code. The annotations contain at least two pieces of information: business capability and maximum running time. In the embodiment of the present invention, the data format of (apiCapability: value, runningTime: time} is used to indicate the API annotation information as an example for explanation, where apiCapability is the business capability of the API, and runningTime is the maximum running time of the API. Assuming that x represents the APIID, i.e., the API category identifier, and f(x) represents the maximum traffic threshold of an API of category x, f(x) can be evaluated in the following manner:

[0035]

[0036] Among them, apiCapability x Indicates the business capability of the external user interface of category x, runningTime x Indicates the maximum running time of the external user interface of category x, Memory indicates the memory configuration of the server where the API is located, and CPU indicates the CPU configuration of the server where the API is located. Since evaluating the maximum flow threshold of an API by a general estimation function is a technology known to those skilled in the art, it will not be described in detail here.

[0037] The service traffic of each type of API in a server can be obtained by averaging the maximum traffic thresholds of all APIs in a service. Assuming that G(x) represents the service traffic of an API of type x in a server, then:

[0038]

[0039] Where n is the number of APIs in the server.

[0040] Get the service flow of the API in each server, and sum the service flow of the APIs of the same category in all servers to get the maximum service flow of each category of API. Assuming that K(x) represents the maximum service flow of the API of category x, then:

[0041]

[0042] Where N represents the total number of servers in the IoT system.

[0043] According to another embodiment of the present invention, in order to better realize resource utilization and improve service expansion capability, a Docker service is deployed in the Internet of Things system (Docker is an open source application container engine, so applications and dependent packages can be packaged into a portable image and then published to any popular Linux or Windows operating system machine, and virtualization can be realized. The container completely uses the sandbox mechanism and there is no interface between them. Based on this feature of Docker, flexible application expansion can be realized), and then the API is deployed in Docker for operation. The API service in Docker increases or decreases as Docker is enabled or offline. The corresponding traffic configuration table is still configured on the API in Docker. According to the same principle as the above embodiment, when evaluating the maximum service traffic of the API, the above formulas (1), (2), and (3) are transformed into:

[0044]

[0045]

[0046]

[0047] At this time, G(x) represents the service flow of the external user interface of category x in Docker, f(x) represents the maximum access flow threshold of the API of category x in Docker, and apiCapability x Indicates the business capabilities of the API of category x in Docker, runningTime x It represents the maximum running time of the API of category x in Docker, Settingmemory represents the memory configuration of Docker, Memory represents the total memory of the server cluster of the IoT system, CPUweight represents the CPU configuration of Docker, n represents the total number of external user interfaces in Docker, and N represents the total number of Dockers.

[0048] When the API is deployed and run in Docker, as the docker service starts, the API will automatically obtain the dockerID, and the server ID will be registered in redis, so that the API can automatically register and form an initial traffic evaluation table. The initialized traffic evaluation table exists in Redis, and the data structure is: {provide: [{SID: sidValue, DID: didValue, capability: f(x), current: currentValue, runningTime: time}], count: countValue, max: K(x)}, where SID is the ID of the host server, DID represents the ID of Docker, capability represents the maximum traffic threshold of the API estimated based on the business capability apiCapabiIity in the API annotation, Current represents the current number of visits, Count represents all the current API visits, and the max value indicates the maximum service traffic K(x) of the API of this category, where all currentValue initialization values ​​are 0.

[0049] Among them, Docker will be affected by the host machine, that is, the performance of the server's CPU and memory. In order to ensure that the server will not crash, the present invention only allows the server's CPU usage to reach 60% and the memory to reach 50% of the total memory, and then it is considered that this server can no longer process other traffic. Therefore, during the operation of the Internet of Things, when a new user initiates access, before calculating the current existing traffic, the resource occupancy of the server cluster in the Internet of Things system is queried to determine whether the server cluster resource occupancy reaches the preset resource occupancy threshold, and when the resource occupancy is greater than or equal to the preset resource threshold, the access initiated by the user will be rejected or put into the queue to be released.

[0050] When deploying an IoT system in the form of a Docker service, the number and types of APIs in the IoT system may change as Docker goes online and offline. In this case, you need to update the traffic evaluation table based on the changes in Docker to achieve more accurate current limiting control. Figure 2As shown, when the Docker service is started, the API is automatically registered and the traffic evaluation table is initialized; when a user initiates access, the traffic evaluation table is found according to the API category, and a time window is dynamically created and the traffic is calculated; based on the calculated traffic and the maximum service traffic of this type of API recorded in the traffic evaluation table, it is determined whether there is no traffic? If the traffic reaches the maximum service traffic and there is no accessible Docker in the IoT system, there is no traffic. The message of excessive traffic is returned and a traffic alarm is generated. At the same time, the administrator is notified. The administrator can determine whether to automatically expand the capacity based on the alarm information. If not, the capacity will be directly ended to deny the access initiated by the user or put it into the queue sequence. If the administrator determines to expand the capacity, a new Docker is directly started, and then the API automatic registration link and subsequent processes are entered again; if the traffic has not reached the maximum service traffic, it means that there is available traffic. At this time, it is further determined whether the traffic has reached 80% of the maximum service traffic (the preset warning threshold). If the traffic has not reached 80% of the maximum service traffic, the user is directly allowed to access. If the traffic has reached 80% of the maximum service traffic, an alarm is generated and the administrator is notified. The alarm information contains the category of the API for which the traffic alarm occurs and the access time. The administrator can determine whether to expand the capacity based on the alarm information.

[0051] In addition, when the Internet of Things system is deployed in the form of a Docker service, a service provider array is configured in the cache of the Internet of Things system. The service provider array is configured in the cache of the Internet of Things system and includes multiple groups of traffic data. Each group of traffic data is used to indicate an external user interface traffic information. The service provider array can also be referred to as a provide array. For the convenience of description in subsequent embodiments, it is uniformly referred to as a provide array. When the Internet of Things system is started, the API will automatically register and initialize the traffic evaluation table according to the startup of the Docker service. That is, the initialization process is automatic registration and discovery, that is, when a service is online, the traffic evaluation table and the corresponding provide array are automatically updated. When the service is offline, the traffic belonging to itself in the traffic evaluation table and the information in the provide array are automatically deleted.

[0052] Process Figure 3As shown in the figure, it simply shows the process of updating the provided data and traffic evaluation table of the newly added docker. Among them, when a Docker service is started, the API will automatically obtain its corresponding DID and SID; then scan all APIs in the docker to obtain the API ID of each API; query its corresponding access traffic estimate through the API ID, and initialize the information of this type of API in the traffic evaluation table according to the access traffic estimate; at the same time, find the API ID in the IoT system cache to determine whether the corresponding API ID already exists in the IoT system cache. If it already exists, add a set of traffic data to the corresponding provide data group to indicate the API traffic information in the newly started docker. If it does not exist, create a new traffic data and add a set of traffic data to the provide data group to indicate the API traffic information of the newly started docker, and initialize the SID in the API traffic data in the provide array to the obtained SID, initialize the DID to the obtained DID, and initialize the access volume to 0, and the access capability to f(x) of the same type of API.

[0053] Similarly, when a docker goes offline, the traffic evaluation table must be initialized and the API information involved in the offline docker must be deleted from the provide array.

[0054] For the entire IoT system, after the IoT system is initialized, the API can provide services. Since the service is provided by the server cluster, an API gateway is required. During operation, the flow limit is calculated by the gateway and the API in docker. When the API passes the authentication and enters the gateway, the flow limit algorithm begins to be activated. When the API traffic arrives, a time window will be dynamically created according to the runningTime in the traffic configuration table in Redis. The length of the time is the value of runningTime. The process is as follows: Figure 4As shown, first the user initiates access and generates an API request; the gateway responds to the API request, obtains the APIID, and dynamically creates a time window based on the obtained APIID to calculate the current existing traffic, and queries the traffic evaluation table in the IoT system cache to determine whether there is traffic. If there is traffic, the service corresponding to the API request is directly searched and the server executes the task, and then returns the result to the gateway. The gateway releases the occupied traffic according to the returned result and returns the structure to the user; if the gateway determines that there is no traffic based on the current existing traffic and the traffic evaluation table, it initiates a request to traverse the server to the server and waits for the service traffic query structure. The server side traverses all servers to determine whether there is service traffic and returns the traffic query result to the gateway. The gateway further determines whether there is traffic based on the traffic query result. If there is traffic, the service corresponding to the API request is directly searched and the server executes the task, and then returns the result to the gateway. The gateway releases the occupied traffic according to the returned result and returns the structure to the user. When there is no traffic, a no traffic alarm is generated and the information is returned to the user.

[0055] Among them, during the operation of the current limiting algorithm, in order to make the system more available, the countValue is first compared with the Max value. If it reaches 80%, an early warning notification is first generated to the administrator. If the CountValue is already greater than the Max value, the gateway starts to query whether all service providers can provide services. If the corresponding service is idle, the API is provided with services until no service provider is available. It is considered that the traffic has reached the maximum value and traffic access is restricted. Every time a time window is created, the CPU and memory usage of the entire IoT system server are monitored at the same time to determine whether the preset threshold is reached. If it is not reached, it can be adjusted through operation and maintenance, such as expanding the docker. As mentioned above, when the traffic reaches the maximum value, a traffic alarm will be reported to alert the system administrator, which API has reached the maximum access at which time point. If expansion is required, the alarm information can directly know which Docker needs to be expanded and which server needs to be expanded. After a period of operation, the server can achieve the best utilization.

[0056] In order to demonstrate the operation process of the present invention, the present invention deploys two Dockers (with a maximum service flow of 2000) on two servers to run the flow limiting solution of the present invention. When the API has flow to access, in Redis, the flow configuration table is shown in Table 1:

[0057] Table 1

[0058]

[0059] When the flow limiting scheme of the present invention is run in the IoT system, the API information can be automatically updated in Redis, including SID, DID, previous visits, and all visits of the current API, etc. Furthermore, when the API is used for stress testing, when the flow reaches 2000, the API will return to tomanycall (no flow alarm).

[0060] It can be seen from the above embodiments that the solution of the present invention limits the flow of different categories of APIs according to their business capabilities, thereby achieving refined flow limiting, avoiding the situation where APIs with traffic are restricted due to unified flow limiting, and greatly improving the resource utilization of the Internet of Things system.

[0061] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.

[0062] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0063] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.

[0064] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A current limiting method for an Internet of Things system, wherein: The user initiates access to the Internet of Things system through a gateway. The Internet of Things system includes a server cluster composed of multiple servers. The Internet of Things system is configured with multiple external user interfaces of different categories for providing services to the outside. There are multiple external user interfaces of each category. The method includes: In response to the user's access, the following steps are performed: Calculate the current existing traffic and obtain the maximum service traffic, wherein the current existing traffic is the current existing traffic of the external user interface category corresponding to the access initiated by the user in the Internet of Things system, and the maximum service traffic is the maximum service traffic of the corresponding external user interface category initiated by the user in the Internet of Things system; Based on the current existing traffic and the maximum service traffic, it is judged whether to release the access initiated by the user. When the current existing traffic is less than the maximum service traffic, the access initiated by the user is released; when the current existing traffic is greater than or equal to its maximum access service traffic, it is traversed in the server cluster to see if there are any external user interfaces accessible to the user, and if there are external user interfaces accessible to the user, the access initiated by the user is released.

2. The method according to claim 1, characterized in that The method further comprises: Pre-setting a flow configuration table in each external user interface, wherein the flow configuration table includes the service capability and maximum operation time of the external user interface; The maximum service flow of each category of external user interface in the Internet of Things system is evaluated based on the flow configuration table of each external user interface.

3. The method according to claim 2, characterized in that A plurality of Dockers are deployed on the server cluster of the Internet of Things system, a plurality of external user interfaces of different categories are deployed in each Docker, and each category has one external user interface. The method includes evaluating the maximum service flow of each category of external user interface in the following manner: in, Among them, K(x) represents the maximum service flow of the external user interface of category x, G(x) represents the service flow of the external user interface of category x in Docker, f(x) represents the maximum access flow threshold of the external user interface of category x in Docker, apiCapability x Indicates the business capability of the external user interface of category x in Docker, runningTime x It represents the maximum running time of the external user interface of category x in Docker, Settingmemory represents the memory configuration of Docker, Memory represents the total memory of the server cluster of the Internet of Things system, CPUweight represents the CPU configuration of Docker, n represents the total number of external user interfaces in Docker, and N represents the total number of Dockers.

4. The method according to claim 3, characterized in that When the current existing flow is greater than or equal to the maximum service flow, it is traversed to see whether there is a Docker accessible to the user in the IoT system, and if there is a Docker accessible to the user, the access initiated by the user is allowed.

5. The method according to claim 1, characterized in that The method also includes: before calculating the current existing traffic, querying the resource occupancy of the server cluster in the Internet of Things system, judging whether the resource occupancy of the server cluster reaches a preset resource occupancy threshold, and when the resource occupancy is greater than or equal to the preset resource threshold, rejecting the access initiated by the user or placing it in a queue to be released.

6. The method according to claim 1, characterized in that When the current traffic is greater than or equal to the maximum service traffic and there is no external user interface accessible to users, an external user interface traffic alarm information of the corresponding category is generated.

7. A gateway applied to an Internet of Things system, which is configured in the Internet of Things system, characterized in that: The gateway is configured to limit the current of the Internet of Things system by using the method described in any one of claims 1-6.

8. An Internet of Things system, characterized in that: The Internet of Things system includes: A server cluster includes multiple servers and is configured with multiple Dockers, each of which has multiple external user interfaces of different categories deployed therein and each category of external user interface has one; A flow evaluation table, which is configured in the cache of the Internet of Things system, and is used to record information of each external user interface, each external user interface definition at least including a maximum access flow threshold and a maximum service flow; The gateway according to claim 7, used to support a user to initiate access to the Internet of Things system; A service providing array is configured in the cache of the Internet of Things system and includes multiple groups of flow data, each group of flow data is used to indicate an external user interface flow information.

9. The system according to claim 8, characterized in that The system is also configured to: When a new Docker is enabled, the corresponding category of the external user interface in the Docker is queried in the traffic evaluation table and the information of the corresponding category in the traffic evaluation table is initialized, and the corresponding external user interface traffic information is added to the service provider array; if the external user interface category in the Docker does not exist in the traffic evaluation table, the corresponding category is added to the traffic evaluation table and the external user interface traffic information of the category is added to the service provider array; and, When a Docker goes offline, the information of the corresponding category in the traffic evaluation table is updated and the external user interface traffic information involved in the offline Docker is deleted from the service provider array.

10. The system according to claim 9, characterized in that The system is also configured to: In response to the external user interface traffic alarm information, it is determined whether there are resources available for expansion in the Internet of Things system. If there are resources available for expansion, a new Docker that can provide the external user interface of this category is started according to the external user interface category in the alarm information.