Equipment connection method and device, electronic equipment and computer readable medium
By obtaining the temporary key and temporary connection service address returned by the dispatching service, the device establishes a connection with the temporary connection service, and forwards the request to the cloud service through the temporary connection service, solving the network congestion problem during the concurrent connection of the device, and achieving the effect of reducing concurrency and improving system reliability.
Patent Information
- Application Number
- CN202411925879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-25
AI Technical Summary
In the prior art, concurrent connection of devices is likely to cause congestion in the device connection network, congestion in the cloud service network, failure of requests one after another, and even causing cloud service downtime.
By obtaining the temporary key and temporary connection service address returned by the scheduler service, the device establishes a connection with the temporary connection service and forwards the request to the cloud service through the temporary connection service, thereby reducing the peak pressure on the cloud service.
It effectively solves the problem of network congestion during concurrent connection of equipment, reduces the concurrent amount of device connections, and improves the reliability of IoT systems.
Smart Images

Figure CN119892906A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a device connection method, apparatus, electronic device and computer-readable medium. Background Art
[0002] With the development of the Internet of Things industry, the number of devices that IoT vendors need to manage is increasing day by day. When managing IoT devices, it usually involves the connection between the device and the cloud service. The device needs to maintain a connection with the cloud service in order to update its status to the cloud service and receive execution instructions transmitted by the cloud service. When the cloud service is restarted or updated, the device needs to reconnect to the cloud service.
[0003] In the prior art, when a device finds that it is disconnected from a cloud service, it will initiate a request to the scheduling service to obtain the address and verification information of the cloud service, and then initiate a connection request to the address of the cloud service to establish a connection with the cloud service. When the cloud service is updated or restarted, the devices connected to the cloud service will be collectively disconnected and then collectively request a connection, which will generate a concurrency peak, causing congestion in the cloud service network, resulting in successive request failures, and even causing the cloud service to crash.
[0004] In order to avoid the above situation, the existing technology uses the method of adding service nodes and discrete connections to avoid this problem. Adding service nodes means adding nodes for cloud services to relieve the pressure of concurrency, but this method requires manual control, and the node is not needed after the link peak has passed, resulting in a waste of resources. In the case of discrete connections, the device calculates a random delay time, and then connects to the cloud service after the delay time ends. This method may still cause concurrency problems when the number of devices is large, and the discrete connection method also has a probabilistic network crowding problem.
[0005] Therefore, how to solve the problem of device connection network congestion caused by concurrent device connections has become a technical problem existing in the prior art. Summary of the invention
[0006] The present application provides a device connection method, apparatus, electronic device and computer-readable medium to solve the technical problem of device connection network congestion caused by concurrent device connections in the above-mentioned prior art.
[0007] According to one aspect of an embodiment of the present application, the present application provides a device connection method, which is applicable to devices in a device connection system, wherein the device connection system includes: a device, a scheduling service, a temporary connection service and a cloud service; the device is communicatively connected to the scheduling service, the temporary connection service and the cloud service respectively; the scheduling service is communicatively connected to the cloud service; the temporary connection service is communicatively connected to the cloud service, and the method includes: obtaining a temporary key returned by the scheduling service, wherein the temporary key is generated by the scheduling service according to a scheduling request sent by the device; when the device connection network of the scheduling service is congested, obtaining a temporary connection service address returned by the scheduling service, and initiating a connection request to the temporary connection service according to the temporary key and the temporary connection service address to establish a connection with the temporary connection service; if it is detected that the device requests cloud service data, the device request is forwarded to the cloud service through the temporary connection service; receiving the connection data returned by the cloud service, and establishing a connection with the cloud service according to the connection data.
[0008] Optionally, before obtaining the temporary key returned by the scheduling service, the method also includes: sending a scheduling request to the scheduling service; detecting congestion of the device connection network of the scheduling service based on the scheduling request; if the device connection network of the scheduling service is not congested, generating a temporary key through the scheduling service, and returning the temporary key to the device.
[0009] Optionally, after detecting the device connection network congestion of the scheduling service according to the scheduling request, the method also includes: if the device connection network of the scheduling service is congested, obtaining a temporary connection service address through the scheduling service; and returning the temporary key and the temporary connection service address to the device through the scheduling service.
[0010] Optionally, detecting congestion in the device connection network of the scheduling service according to the scheduling request includes: obtaining a preset initial monitoring parameter, where the preset initial monitoring parameter is a threshold value for the number of requests generated by the scheduling service within a fixed time period; and determining whether the device connection network of the scheduling service is congested according to the scheduling request and the preset initial monitoring parameter.
[0011] Optionally, judging whether the device connection network of the scheduling service is congested according to the scheduling request and the preset initial monitoring parameters includes: detecting the number of real-time requests generated by the scheduling service within a fixed time period according to the scheduling request; if the number of real-time requests generated by the scheduling service within the fixed time period exceeds the preset initial monitoring parameters, determining that the device connection network is congested; if the number of real-time requests generated by the scheduling service within the fixed time period does not exceed the preset initial monitoring parameters, determining that the device connection network is not congested.
[0012] Optionally, after obtaining the temporary key returned by the scheduling service, the method further includes: when the device connection network of the scheduling service is not congested, forwarding the scheduling request of the device to the cloud service through the scheduling service; and connecting to the cloud service based on the temporary key and the scheduling request of the device.
[0013] Optionally, if it is detected that the device requests cloud service data, the device request is forwarded to the cloud service through the temporary connection service, including: sending a device request to obtain cloud service data to the temporary connection service; after the temporary connection service verifies the device request, forwarding the device request to the cloud service through the temporary connection service.
[0014] According to another aspect of an embodiment of the present application, the present application provides a device connection device, which is applicable to devices in a device connection system, wherein the device connection system includes: a device, a scheduling service, a temporary connection service and a cloud service; the device is respectively communicated and connected with the scheduling service, the temporary connection service and the cloud service; the scheduling service is communicated and connected with the cloud service; the temporary connection service is communicated and connected with the cloud service, and the device includes: a first acquisition module, which is used to obtain a temporary key returned by the scheduling service, wherein the temporary key is generated by the scheduling service according to a scheduling request sent by the device; a first connection module, which is used to obtain a temporary connection service address returned by the scheduling service when the device connection network of the scheduling service is congested, and to initiate a connection request to the temporary connection service according to the temporary key and the temporary connection service address to establish a connection with the temporary connection service; a first forwarding module, which is used to forward the device request to the cloud service through the temporary connection service if it is detected that the device requests cloud service data; a second connection module, which is used to receive the connection data returned by the cloud service, and to establish a connection with the cloud service according to the connection data.
[0015] According to another aspect of an embodiment of the present application, the present application provides an electronic device, including a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program that can be run on the processor, the memory and the processor communicate through the communication bus and the communication interface, and the processor implements the steps of the device connection method when executing the computer program.
[0016] According to another aspect of an embodiment of the present application, the present application provides a computer-readable medium having a non-volatile program code executable by a processor, wherein the program code enables the processor to execute the steps of the device communication method.
[0017] The above technical solution provided by the embodiment of the present application has the following advantages compared with the related art:
[0018] This application can be applied to high-concurrency scenarios where devices in the Internet of Things connect to cloud services in batches. This application can accurately establish connections with temporary connection services and cloud services through temporary keys by obtaining temporary keys returned by the scheduling service, avoiding the problem of network congestion caused by random device connections to cloud services; when the device connection network of the scheduling service is congested, obtain the temporary connection service address returned by the scheduling service, and initiate a connection request to the temporary connection service based on the temporary key and the temporary connection service address to establish a connection with the temporary connection service. When the device needs to request cloud service data, the device request is forwarded to the cloud service through the temporary connection service. By adding a temporary connection service to forward device requests to the cloud service, it is beneficial to reduce the peak pressure of the cloud service when the device is connected in batches by delaying the connection when the device connection network of the scheduling service is congested, reduce the concurrency of device connections, and solve the problem of device connection network congestion caused by concurrent device connections, thereby improving the reliability of the entire Internet of Things system. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0021] Figure 1 A schematic diagram of a hardware environment of an optional device connection system provided according to an embodiment of the present application;
[0022] Figure 2 A schematic diagram of an optional device connection method flow chart provided according to an embodiment of the present application;
[0023] Figure 3 A schematic diagram of another optional device connection method flow chart provided according to an embodiment of the present application;
[0024] Figure 4 A schematic diagram of a module of an optional device connection device provided according to an embodiment of the present application;
[0025] Figure 5 A schematic diagram of a module of another optional device connection device provided according to an embodiment of the present application;
[0026] Figure 6 A schematic diagram of an optional electronic device structure provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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 ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0028] In order to solve the problem mentioned in the background technology, according to one aspect of the embodiments of the present application, an embodiment of a device connection method is provided.
[0029] like Figure 1 As shown, the above device connection method can be applied to Figure 1 In the device connection system shown, the device connection system architecture 100 includes a device 101, a scheduling service 103, a temporary connection service 105, and a cloud service 107; the device 101 is connected to the scheduling service 103, the temporary connection service 105, and the cloud service 107 through a network.
[0030] Among them, the device 101 can initiate a connection request and communicate with the scheduling service 103, the temporary connection service 105 and the cloud service 107. The scheduling service 103 is connected to the cloud service 107 through a network, and the scheduling service 103 can directly forward the scheduling request of the device 101 to the cloud service 107, so that the device 101 can establish a connection with the cloud service 107. The temporary connection service 105 is connected to the cloud service 107 through a network, and the temporary connection service 105 can forward the device request to the cloud service 107, so that the device 101 can communicate with the cloud service 107 after the connection is established.
[0031] Among them, device 101 is used to interact with the user and initiate requests to temporary connection service 105, cloud service 107, and scheduling service 103. Device 101 can also be called a terminal device. Scheduling service 103 is used to generate a temporary key and return the temporary key to the requesting device 101 according to the configuration to connect with temporary connection service 105 and cloud service 107. Scheduling service 103 can also be said to configure the corresponding temporary connection service 105 and cloud service 107 for device 101. Temporary connection service 105 is used to temporarily connect with device 101, receive and forward device requests. Temporary connection service 105 can be deployed in a distributed manner or as a single instance, and set according to actual business. Cloud service 107 is used to receive requests from temporary connection service 105 and device 101, and establish a connection with device 101.
[0032] The scheduling service 103, temporary connection service 105 and cloud service 107 can be used to provide services for the device 101 or a client installed on the device 101. The device 101 can connect and communicate with the scheduling service 103, temporary connection service 105 and cloud service 107 after sending a request. The network may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0033] The user can use the device 101 to interact with the scheduling service 103, the temporary connection service 105 and the cloud service 107 through the network to receive or send messages, etc. Various communication client applications can be installed on the device 101, such as web browser applications, search applications, instant messaging tools, etc. Among them, the device 101 can be various electronic devices with a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, laptops and desktop computers, etc. The scheduling service 103, the temporary connection service 105 and the cloud service 107 can all be servers that provide various services, such as a background server that supports the pages displayed on the device 101.
[0034] It should be noted that the device connection method provided in the embodiment of the present application is generally performed by the scheduling service 103, the temporary connection service 105, the cloud service 107 and / or the device 101, and accordingly, the device connection device is generally set in the scheduling service 103, the temporary connection service 105, the cloud service 107 / device. And it should be understood that Figure 1 The number of devices 101, networks, scheduling services 103, temporary connection services 105, and cloud services 107 in the figure is only illustrative. According to the implementation requirements, there can be any number of devices 101, networks, scheduling services 103, temporary connection services 105, and cloud services 107.
[0035] like Figure 2 As shown, Figure 2 A flow chart of an optional device connection method provided by an embodiment of the present invention. Taking the device connection method executed by a device as an example, a device connection method includes the following steps:
[0036] Step S202: Acquire a temporary key returned by the scheduling service, where the temporary key is generated by the scheduling service according to the scheduling request sent by the device.
[0037] In this embodiment, the device connection method provided is suitable for high-concurrency scenarios in which devices in the Internet of Things connect to cloud services in batches. During the device connection process, if the device wants to establish a communication connection with the cloud service, it needs to initiate a scheduling request to the scheduling service. The scheduling service can generate a temporary key after receiving the scheduling request of the device and return the temporary key to the device.
[0038] Among them, the above-mentioned temporary key is the verification information for the communication connection between the device and the temporary connection service and the cloud service. The temporary key includes device information, cloud service address, random check code and other information. The device information is the specific information of the device that initiates the scheduling request to the scheduling service, such as the specific model, power, size, shape, energy consumption, device purpose and other information of the device, and of course other related information of the device; the cloud service address is the address of the cloud service that wants to establish communication. The device can connect and communicate with the cloud service through the cloud service address. In this embodiment, the number of cloud services can be set according to the actual situation. The addresses corresponding to different cloud services are different, that is, the cloud service address is variable, and the device needs to burn a fixed address when burning. At this time, the address of the cloud service cannot be hard-coded, so a fixed scheduling service address is provided. If the device wants to connect to the cloud service, it must request the scheduling service to configure the corresponding cloud service to obtain different cloud service data. The random check code is a verification code generated after the scheduling service receives the scheduling request of the device. The verification code can be a fixed verification code or a real-time verification code. The verification code can be obtained by any combination of numbers, Chinese characters, letters, characters, etc. Of course, in order to enhance the security of device connection, the verification code may adopt a real-time verification code, thus ensuring the timeliness of the verification code and further enhancing the security of device connection.
[0039] Step S204, when the device connection network of the scheduling service is congested, obtain the temporary connection service address returned by the scheduling service, initiate a connection request to the temporary connection service according to the temporary key and the temporary connection service address, and establish a connection with the temporary connection service.
[0040] In some embodiments, when the network connection of the scheduling service device is congested, the scheduling service also needs to obtain a temporary connection service address and return it to the device. At this time, the device can receive the temporary key and temporary connection service address of the scheduling service.
[0041] Step S206: If it is detected that the device requests cloud service data, the device request is forwarded to the cloud service through the temporary connection service.
[0042] In this embodiment, after the scheduling service generates a temporary key, the scheduling service also configures a temporary connection service address for the device that sends the scheduling request and returns it to the device. The device then determines the location of the temporary connection service based on the received temporary connection service address, finds the corresponding temporary connection service, and initiates a connection request to the temporary connection service through the received temporary key. After the temporary connection service parses the temporary key and verifies it, it obtains the device information and cloud service address in the temporary key, and initiates a request to the cloud service through the cloud service address. The request information includes device information, temporary key, and request data when the device requests the temporary connection service. In this way, there can be a verification process, so that the device will not send the request to other places at will, and the temporary connection service or cloud service will not receive unfamiliar requests at will.
[0043] In some embodiments, after the device establishes a connection to the temporary connection service, the device starts broadcasting to receive a return message, that is, the device opens the network connection. Because many devices do not keep the network module turned on all the time due to power consumption issues, the network module is turned on here to wait for requests sent by business servers such as cloud services.
[0044] Specifically, the temporary connection service has the function of establishing a long connection with the device and can forward the device's request to the cloud service. After the device is connected to the temporary connection service, it is equivalent to the device registering its own information with the temporary connection service and making a registration. When the device does not have a real business request, the device is disconnected from the temporary connection service, and the device is also disconnected from the cloud service, so as to avoid cloud service network congestion. Once the device has a real business request, such as when the user needs to obtain the data of the cloud service, the real business request here is usually a manual operation, such as someone operating the device, and the device needs to communicate with the server. And in the case of network congestion, the device will initiate the request to obtain the cloud service data to the temporary connection service, and the temporary connection service will forward the device's request to the cloud service. Establishing the connection between the device and the cloud service when the device generates an actual request can reduce the peak pressure of the cloud service when the device is connected in batches, reduce the concurrency of device connections, and improve the reliability of the entire Internet of Things system.
[0045] Step S208: receiving connection data returned by the cloud service, and establishing a connection with the cloud service according to the connection data.
[0046] In some embodiments, the cloud service receives a request initiated by a temporary connection service, obtains the device address based on the device information in the temporary key, and returns the temporary key and connection data to the device. After the device receives the return from the cloud service, it parses the temporary key and verifies the security of the request based on the temporary key. It obtains the connection information through the connection data and establishes a connection with the cloud service before communication can be carried out. The above-mentioned connection data refers to the information required for the device to connect to the cloud service, such as some agreed verification rules, the device ID returned to the device by the cloud service, etc.
[0047] In an embodiment of the present invention, by obtaining a temporary key returned by a scheduling service, a connection can be accurately established with a temporary connection service and a cloud service through the temporary key, thereby avoiding the problem of network congestion caused by random connection of devices to cloud services; when the device connection network of the scheduling service is congested, the temporary connection service address returned by the scheduling service is obtained, and a connection request is initiated to the temporary connection service according to the temporary key and the temporary connection service address to establish a connection with the temporary connection service; when the device needs to request cloud service data, the device request is forwarded to the cloud service through the temporary connection service; by adding a temporary connection service to forward device requests to the cloud service, it is beneficial to reduce the peak pressure of the cloud service when devices are connected in batches by delaying the connection when the device connection network of the scheduling service is congested, reduce the concurrency of device connections, and solve the problem of device connection network congestion caused by concurrent device connections, thereby improving the reliability of the entire Internet of Things system.
[0048] In an optional embodiment, before the above step S202, the above method further includes:
[0049] Sending a scheduling request to the scheduling service;
[0050] Detecting network congestion of a device connected to the scheduling service according to the scheduling request;
[0051] If the network to which the device of the scheduling service is connected is not congested, a temporary key is generated through the scheduling service and the temporary key is returned to the device.
[0052] In this embodiment, when a user needs to obtain cloud service data, a scheduling request can be sent to the scheduling service through the device. The scheduling service receives the scheduling request of the device and parses the scheduling request to obtain device information and request content, etc. During the device connection process, if the device wants to establish a communication connection with the cloud service, it needs to initiate a scheduling request to the scheduling service. The scheduling service can generate a temporary key only after receiving the scheduling request of the device and return the temporary key to the device.
[0053] Specifically, after the dispatch service receives the dispatch request from the device, it can detect the congestion of the device connection network of the dispatch service according to the current dispatch request, and then choose whether to add a temporary connection service according to the congestion of the device connection network of the dispatch service. If the device connection network of the dispatch service is not congested, the regular cloud service request process can be executed, such as directly requesting the cloud service to communicate with the device through the dispatch service, and there is no need to add a temporary connection service. In this case, the dispatch service only needs to generate a temporary key and return it to the device.
[0054] In this embodiment, the connection method between the device and the cloud service is selected by detecting the congestion of the device connection network of the scheduling service. When the device connection network of the scheduling service is not congested, the device only establishes a connection with the cloud service through the temporary key, thereby improving the speed of the connection between the device and the cloud service.
[0055] In an optional embodiment, after detecting the network congestion of the device connection of the scheduling service according to the scheduling request, the method further includes:
[0056] If the network connection of the device of the scheduling service is congested, a temporary connection service address is obtained through the scheduling service;
[0057] The temporary key and the temporary connection service address are returned to the device through the scheduling service.
[0058] In this embodiment, device connection network congestion may be a network crowding problem caused when devices connect to cloud services in batches. For example, high concurrency scenarios usually result from batch power off / on situations, when devices are powered on at almost the same time and also initiate login requests to the server at almost the same time to establish a connection with the cloud service.
[0059] In this embodiment, when the device connection network of the scheduling service is congested, it means that there are too many devices requesting to connect to the cloud service at the same time, and a temporary connection service needs to be added to participate in the cloud service connection request. Then the scheduling service needs to provide both the temporary key and the specific address information of the temporary connection service, so that the device can find the corresponding temporary connection service through the temporary key and the specific temporary connection service address, thereby establishing a connection between the device and the temporary connection service, and facilitating the use of the temporary connection service to achieve delayed connection, reduce the peak pressure of the cloud service when the devices are connected in batches, reduce the concurrency of the device connection, and solve the problem of device connection network congestion caused by concurrent device connections, thereby improving the reliability of the entire Internet of Things system.
[0060] In an optional embodiment, the step of detecting the network congestion of the device connection of the scheduling service according to the scheduling request includes:
[0061] Obtaining a preset initial monitoring parameter, where the preset initial monitoring parameter is a threshold value of the number of requests generated by the scheduling service within a fixed time period;
[0062] Whether a network connected to a device of the scheduling service is congested is determined according to the scheduling request and the preset initial monitoring parameters.
[0063] In some embodiments, the above-mentioned monitoring parameter is the number of stage requests for the scheduling service, and the number of stage requests is the number of scheduling requests generated by the scheduling service within a fixed time period, and the preset initial monitoring parameter is the threshold value of the number of requests set by the scheduling service within a fixed time period.
[0064] Specifically, after the scheduling service receives the scheduling request of the device, it can determine whether the scheduling service encounters a problem of device connection network congestion based on pre-set initial monitoring parameters.
[0065] In this embodiment, by pre-setting an initial monitoring parameter to monitor whether there is a high concurrency of device connections in the scheduling service, the congestion of the device connection network of the scheduling service can be more accurately judged, so as to more quickly select the connection method between the device and the cloud service, thereby improving the connection speed between the device and the cloud service, and further improving the efficiency of the device connection.
[0066] In an optional embodiment, the step of determining whether the device connection network of the scheduling service is congested according to the scheduling request and the preset initial monitoring parameters includes:
[0067] Detecting the number of real-time requests generated by the scheduling service within a fixed time period according to the scheduling request;
[0068] If the number of real-time requests generated by the scheduling service within a fixed time period exceeds the preset initial monitoring parameter, it is determined that the device connection network is congested;
[0069] If the number of real-time requests generated by the scheduling service within a fixed time period does not exceed the preset initial monitoring parameter, it is determined that the network connected to the device is not congested.
[0070] In this embodiment, the real-time request number is the current number of requests of the scheduling service within a fixed duration. For example, the fixed duration is set to 10 minutes, and the preset initial monitoring parameters are set to 1000. When the device sends a scheduling request to the scheduling service, the scheduling request of the device is exactly the 1001st request of the scheduling service within 10 minutes. At this time, the actual number of requests of the scheduling service is 1001, indicating that when the scheduling service receives the scheduling request of the device, the actual number of requests of the scheduling service has exceeded the preset initial monitoring parameters, which indicates that the device connection has a high concurrency, and further indicates that there is congestion in the device connection network.
[0071] In this embodiment, when the number of device scheduling requests received by the scheduling service does not exceed the pre-set initial monitoring parameters, it means that there is no high concurrency in the device connection. At this time, the scheduling service is in a normal request state and there is no high concurrency, which further indicates that there is no congestion in the device connection network.
[0072] In this embodiment, the device request situation in the scheduling service is monitored in real time by presetting preset initial monitoring parameters. When the device connection network of the scheduling service is congested, a temporary connection service is added to generate a temporary connection with the device, and a temporary key that can be quickly verified by the cloud service is generated. When the device generates a real request, the connection between the device and the cloud service is established to achieve delayed device connection, reduce the peak value of device connection concurrency, thereby improving the device connection speed and solving the problem of device connection network congestion. Alternatively, when the device connection network is not congested, a normal connection method can be selected to directly forward the device request to the cloud service through the scheduling service, reduce the steps of the temporary connection service, and further improve the device connection speed. In this way, the method of realizing the connection and communication between the device and the cloud service can be flexibly selected according to the device request situation, which can improve the device connection speed in terms of steps, further solve the problem of device connection network congestion, and thus improve the reliability of device connection.
[0073] In an optional embodiment, the above step S202 specifically includes:
[0074] When the network connected to the device of the scheduling service is not congested, forwarding the scheduling request of the device to the cloud service through the scheduling service;
[0075] Connecting with the cloud service is performed based on the temporary key and the scheduling request of the device.
[0076] In this embodiment, when the network connected to the device of the scheduling service is not congested, the request of the device can be directly forwarded to the cloud service through the scheduling service. In combination with the temporary key, the connection communication between the device and the cloud service is realized, so there is no need to add a temporary connection service to realize the connection between the device and the cloud service, which improves the connection speed between the device and the cloud service from the connection step, thereby improving the connection efficiency between the device and the cloud service.
[0077] In an optional embodiment, step S206 includes:
[0078] Sending a device request to the temporary connection service to obtain cloud service data;
[0079] After the temporary connection service verifies the device request, the temporary connection service forwards the device request to the cloud service.
[0080] In this embodiment, when a user needs to request cloud service data, he needs to send a device request to obtain the cloud service data to the temporary connection service. If the device connection network of the scheduling service happens to be congested, he can directly establish a temporary connection with the temporary connection service. After the temporary connection service verifies the device's request information, the two can establish a connection, and the temporary connection service can forward the device request of the device to the cloud service to facilitate the cloud service to establish a communication connection with the device.
[0081] In an optional embodiment, in combination Figure 3 As shown, Figure 3 A flowchart of an optional device connection method is provided for an embodiment of the present invention. Applicable to a scheduling service in a device connection system, the device connection system includes: a device, a scheduling service, a temporary connection service, and a cloud service; the device is respectively connected to the scheduling service, the temporary connection service, and the cloud service in communication; the scheduling service is connected to the cloud service in communication; the temporary connection service is connected to the cloud service in communication, and a device connection method includes the following steps:
[0082] Step S302: Obtain a scheduling request from a device.
[0083] In this embodiment, when a user needs to obtain cloud service data, a scheduling request can be sent to a scheduling service through a device. The scheduling service receives the scheduling request from the device and parses the scheduling request to obtain device information and the like.
[0084] Step S304: determining whether the network to which the device is connected is congested according to the scheduling request and preset initial monitoring parameters.
[0085] In some embodiments, after receiving the dispatch request of the device, the dispatch service can determine whether the dispatch service has a device connection network congestion problem based on the pre-set initial monitoring parameters. Device connection network congestion can be a network crowding problem caused when devices connect to the cloud service in batches. For example, high concurrency scenarios usually come from batch power off / on situations. At this time, the devices are powered on at almost the same time and also initiate login requests to the server at almost the same time to request to establish a connection with the server.
[0086] Step S306: If the network to which the device is connected is congested, a temporary key is generated according to the scheduling request and a temporary connection service address is obtained.
[0087] The device connection method provided is suitable for high-concurrency scenarios in which devices in the Internet of Things connect to cloud services in batches. During the device connection process, if the device wants to establish a communication connection with the cloud service, it needs to initiate a scheduling request to the scheduling service. The scheduling service can generate a temporary key after receiving the device's scheduling request and return the temporary key to the device.
[0088] Among them, the above-mentioned temporary key is the verification information for the communication connection between the device and the temporary connection service and the cloud service. The temporary key includes device information, cloud service address, random check code and other information. The device information is the specific information of the device that initiates the scheduling request to the scheduling service, such as the specific model, power, size, shape, energy consumption, device purpose and other information of the device, and of course other related information of the device; the cloud service address is the address of the cloud service that wants to establish communication. The device can connect and communicate with the cloud service through the cloud service address. In this embodiment, the number of cloud services can be set according to the actual situation. The addresses corresponding to different cloud services are different, that is, the cloud service address is variable, and the device needs to burn a fixed address when burning. At this time, the address of the cloud service cannot be hard-coded, so a fixed scheduling service address is provided. If the device wants to connect to the cloud service, it must request the scheduling service to configure the corresponding cloud service to obtain different cloud service data. The random check code is a verification code generated after the scheduling service receives the scheduling request of the device. The verification code can be a fixed verification code or a real-time verification code. The verification code can be obtained by any combination of numbers, Chinese characters, letters, characters, etc. Of course, in order to enhance the security of device connection, the verification code may adopt a real-time verification code, thus ensuring the timeliness of the verification code and further enhancing the security of device connection.
[0089] When the network connection of the scheduling service device is congested, the scheduling service also needs to obtain a temporary connection service address and return it to the device. At this time, the device can receive the temporary key and temporary connection service address of the scheduling service.
[0090] Step S308: sending the temporary key and the temporary connection service address to the device, so that a connection is established with the temporary connection service when it is detected that the device requests cloud service data.
[0091] In some embodiments, after the scheduling service generates a temporary key, the scheduling service also configures a temporary connection service address for the device that sent the scheduling request and returns it to the device. The device then determines the location of the temporary connection service based on the received temporary connection service address, finds the corresponding temporary connection service, and initiates a connection request to the temporary connection service through the received temporary key. After the temporary connection service parses the temporary key and verifies it, it obtains the device information and cloud service address in the temporary key, and initiates a request to the cloud service through the cloud service address. The request information includes device information, temporary key, and request data when the device requests the temporary connection service. In this way, there can be a verification process so that the device will not send the request to other places at will, and the temporary connection service or cloud service will not receive unfamiliar requests at will.
[0092] Step S310: forwarding the device request of the device to the cloud service through the temporary connection service, and establishing a connection between the device and the cloud service based on the device request.
[0093] In some embodiments, after the device establishes a connection to the temporary connection service, the device starts broadcasting to receive a return message, that is, the device opens the network connection. Because many devices do not keep the network module turned on all the time due to power consumption issues, the network module is turned on here to wait for requests sent by business servers such as cloud services.
[0094] Specifically, the temporary connection service has the function of establishing a long connection with the device and can forward the device's request to the cloud service. After the device is connected to the temporary connection service, it is equivalent to the device registering its own information with the temporary connection service and making a registration. When the device does not have a real business request, the device is disconnected from the temporary connection service, and the device is also disconnected from the cloud service, so as to avoid cloud service network congestion. Once the device has a real business request, such as when the user needs to obtain the data of the cloud service, the real business request here is usually a manual operation, such as someone operating the device, and the device needs to communicate with the server. And in the case of network congestion, the device will initiate the request to obtain the cloud service data to the temporary connection service, and the temporary connection service will forward the device's request to the cloud service. Establishing the connection between the device and the cloud service when the device generates an actual request can reduce the peak pressure of the cloud service when the device is connected in batches, reduce the concurrency of device connections, and improve the reliability of the entire Internet of Things system.
[0095] In an embodiment of the present invention, a scheduling request of a device is obtained; based on the scheduling request and preset initial monitoring parameters, whether the device connection network is congested is determined; if the device connection network is congested, a temporary key is generated based on the scheduling request and a temporary connection service address is obtained; the temporary key and the temporary connection service address are sent to the device, so that when it is detected that the device requests cloud service data, a connection is established with a temporary connection service; the device request of the device is forwarded to the cloud service through the temporary connection service, and a connection is established between the device and the cloud service based on the device request. In this way, when the device connection network is congested, a temporary connection service can be added to achieve a delayed connection method, reducing the peak pressure of the cloud service when the device is connected in batches, reducing the concurrency of device connections, and solving the problem of device connection network congestion caused by concurrent device connections, thereby improving the reliability of the entire Internet of Things system.
[0096] In an optional embodiment, the above step S302 specifically includes:
[0097] Preset initial monitoring parameters, where the preset initial monitoring parameters are thresholds for the number of requests for a scheduling service within a fixed duration;
[0098] If the number of real-time requests generated by the scheduling service within a fixed time period exceeds the preset initial monitoring parameter, it is determined that the device connection network is congested;
[0099] If the number of real-time requests generated by the scheduling service within a fixed time period does not exceed the preset initial monitoring parameter, it is determined that the network connected to the device is not congested.
[0100] In some embodiments, the above-mentioned monitoring parameter is the number of stage requests for the scheduling service, and the number of stage requests is the number of scheduling requests generated by the scheduling service within a fixed time period, and the preset initial monitoring parameter is the threshold value of the number of requests set by the scheduling service within a fixed time period.
[0101] Specifically, an initial monitoring parameter is pre-set to monitor whether a high concurrency of device connections occurs in the scheduling service.
[0102] In this embodiment, when the number of device scheduling requests received by the scheduling service exceeds the preset initial monitoring parameter, it indicates that the device connection has a high concurrency, which further indicates that the device connection network is congested.
[0103] In this embodiment, when the number of device scheduling requests received by the scheduling service does not exceed the pre-set initial monitoring parameters, it means that there is no high concurrency in the device connection. At this time, the scheduling service is in a normal request state and there is no high concurrency, which further indicates that there is no congestion in the device connection network.
[0104] In this embodiment, the device request situation in the scheduling service is monitored in real time by presetting preset initial monitoring parameters. When the device connection network of the scheduling service is congested, a temporary connection service is added to generate a temporary connection with the device, and a temporary key that can be quickly verified by the cloud service is generated. When the device generates a real request, the connection between the device and the cloud service is established to achieve delayed device connection, reduce the peak value of device connection concurrency, thereby improving the device connection speed and solving the problem of device connection network congestion. Alternatively, when the device connection network is not congested, a normal connection method can be selected to directly forward the device request to the cloud service through the scheduling service, reduce the steps of the temporary connection service, and further improve the device connection speed. In this way, the method of realizing the connection and communication between the device and the cloud service can be flexibly selected according to the device request situation, which can improve the device connection speed in terms of steps, further solve the problem of device connection network congestion, and thus improve the reliability of device connection.
[0105] In an optional embodiment, after determining whether the network connected to the device is congested according to the scheduling request and the preset initial monitoring parameters, the method further includes:
[0106] If the network to which the device of the scheduling service is connected is not congested, generating a temporary key according to the scheduling request;
[0107] The temporary key is sent to the device, and the scheduling request of the device is forwarded to the cloud service, and a connection between the device and the cloud service is established based on the temporary key and the scheduling request.
[0108] In this embodiment, when the device connection network of the scheduling service is not congested, the scheduling request of the device can be directly forwarded to the cloud service through the scheduling service. In combination with the temporary key, the connection communication between the device and the cloud service is realized, so there is no need to add a temporary connection service to realize the connection between the device and the cloud service, which improves the connection speed between the device and the cloud service from the connection step, thereby improving the connection efficiency between the device and the cloud service.
[0109] According to another aspect of the embodiment of the present application, Figure 4 As shown, corresponding to the device connection method in the above embodiment, this embodiment provides a device connection device 400, which is applicable to a device in a device connection system, wherein the device connection system includes: a device, a scheduling service, a temporary connection service, and a cloud service; the device is respectively connected to the scheduling service, the temporary connection service, and the cloud service in communication; the scheduling service is connected to the cloud service in communication; the temporary connection service is connected to the cloud service in communication, and the device connection device 400 includes:
[0110] A first acquisition module 401 is used to acquire a temporary key returned by a scheduling service, where the temporary key is generated by the scheduling service according to a scheduling request sent by a device;
[0111] The first connection module 403 is used to obtain the temporary connection service address returned by the scheduling service when the device connection network of the scheduling service is congested, and initiate a connection request to the temporary connection service according to the temporary key and the temporary connection service address to establish a connection with the temporary connection service;
[0112] A first forwarding module 405 is configured to forward the device request to the cloud service through the temporary connection service if it is detected that the device requests cloud service data;
[0113] The second connection module 407 is used to receive the connection data returned by the cloud service and establish a connection with the cloud service according to the connection data.
[0114] It should be noted that, in this embodiment, the first acquisition module 401 can be used to execute step S202 in the embodiment of the present application, the first connection module 403 in this embodiment can be used to execute step S204 in the embodiment of the present application, the first forwarding module 405 in this embodiment can be used to execute step S206 in the embodiment of the present application, and the second connection module 407 in this embodiment can be used to execute step S208 in the embodiment of the present application.
[0115] Optionally, before the first obtaining module 401, the device further includes:
[0116] A first sending module, configured to send a scheduling request to the scheduling service;
[0117] A detection module, used to detect the congestion of the network connected to the device of the scheduling service according to the scheduling request;
[0118] A generating module is used to generate a temporary key through the scheduling service if the network to which the device of the scheduling service is connected is not congested, and return the temporary key to the device.
[0119] Optionally, after the detection module, the device further includes:
[0120] A second acquisition module is used to acquire a temporary connection service address through the scheduling service if the device connection network of the scheduling service is congested;
[0121] A returning module is used to return the temporary key and the temporary connection service address to the device through the scheduling service.
[0122] Optionally, the detection module includes:
[0123] An acquisition unit, configured to acquire a preset initial monitoring parameter, wherein the preset initial monitoring parameter is a threshold value of the number of requests generated by the scheduling service within a fixed time period;
[0124] A judging unit is used to judge whether the device connection network of the scheduling service is congested according to the scheduling request and the preset initial monitoring parameters.
[0125] Optionally, the judgment unit is also used to detect the number of real-time requests generated by the scheduling service within a fixed time period based on the scheduling request; if the number of real-time requests generated by the scheduling service within the fixed time period exceeds the preset initial monitoring parameters, it is determined that the device connection network is congested; if the number of real-time requests generated by the scheduling service within the fixed time period does not exceed the preset initial monitoring parameters, it is determined that the device connection network is not congested.
[0126] Optionally, after the first acquisition module 401, the device also includes: a request sending module, used to forward the scheduling request of the device to the cloud service through the scheduling service when the device connection network of the scheduling service is not congested; a connection establishment module, used to connect to the cloud service based on the temporary key and the scheduling request of the device.
[0127] Optionally, the first forwarding module 405 is further used to send a device request for obtaining cloud service data to the temporary connection service; after the temporary connection service verifies the device request, the device request is forwarded to the cloud service through the temporary connection service.
[0128] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware.
[0129] It should be noted here that the suffixes such as module, component, unit, sub-module, and sub-unit used to represent elements described in the above device are only for the convenience of description of this application and have no specific meaning in themselves. Therefore, they can be used in combination.
[0130] According to another aspect of the embodiment of the present application, Figure 5 As shown, corresponding to the device connection method in the above embodiment, this embodiment provides a device connection device 500, and the device connection device 500 includes:
[0131] The third acquisition module 501 is used to obtain a scheduling request of a device;
[0132] A determination module 503, configured to determine whether the network to which the device is connected is congested according to the scheduling request and preset initial monitoring parameters;
[0133] A generating module 505, configured to generate a temporary key and obtain a temporary connection service address according to the scheduling request if the network connected to the device is congested;
[0134] A sending module 507, configured to send the temporary key and the temporary connection service address to the device, so that a connection is established with the temporary connection service when it is detected that the device requests cloud service data;
[0135] The second forwarding module 509 is configured to forward the device request of the device to the cloud service through the temporary connection service, and establish a connection between the device and the cloud service based on the device request.
[0136] It should be noted that, in this embodiment, the third acquisition module 501 can be used to execute step S302 in the embodiment of the present application, the judgment module 503 in this embodiment can be used to execute step S304 in the embodiment of the present application, the generation module 505 in this embodiment can be used to execute step S306 in the embodiment of the present application, the sending module 507 in this embodiment can be used to execute step S308 in the embodiment of the present application, and the second forwarding module 509 in this embodiment can be used to execute step S310 in the embodiment of the present application.
[0137] Optionally, the judgment module 503 includes: a preset unit, used to preset an initial monitoring parameter, wherein the preset initial monitoring parameter is a threshold value of the number of requests within a fixed duration of the scheduling service; a second determination unit, used to determine that the device connection network is congested if the number of real-time requests generated by the scheduling service within a fixed duration exceeds the preset initial monitoring parameter; and a third determination unit, used to determine that the device connection network is not congested if the number of real-time requests generated by the scheduling service within a fixed duration does not exceed the preset initial monitoring parameter.
[0138] Optionally, the device also includes: a third connection module, used to generate a temporary key according to the scheduling request if the device connection network of the scheduling service is not congested; a third forwarding module, used to send the temporary key to the device and forward the scheduling request of the device to the cloud service, and establish a connection between the device and the cloud service based on the temporary key and the scheduling request.
[0139] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above embodiments. It should be noted that the above modules as part of the device can be run in Figure 1 In the hardware environment shown, it can be implemented by software or by hardware.
[0140] It should be noted here that the suffixes such as module, component, unit, sub-module, and sub-unit used to represent elements described in the above device are only for the convenience of description of this application and have no specific meaning in themselves. Therefore, they can be used in combination.
[0141] According to another aspect of the embodiments of the present application, the present application provides an electronic device, such as Figure 6 As shown, it includes a memory 601, a processor 603, a communication interface 605 and a communication bus 607. The memory 601 stores a computer program that can be run on the processor 603. The memory 601 and the processor 603 communicate through the communication interface 605 and the communication bus 607. When the processor 603 executes the computer program, the steps of the above-mentioned device connection method are implemented.
[0142] The memory and processor in the above electronic device communicate via a communication bus and a communication interface. The communication bus may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus may be divided into an address bus, a data bus, a control bus, etc.
[0143] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0144] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0145] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the steps of the device connection method in any of the above embodiments.
[0146] Optionally, in an embodiment of the present application, the computer-readable medium is configured to store program codes for the processor to execute the steps of the device connection method applicable to the device or the scheduling service in the above embodiment:
[0147] The device connection method applicable to the device includes the following steps:
[0148] S202, obtaining a temporary key returned by the scheduling service, wherein the temporary key is generated by the scheduling service according to the scheduling request sent by the device; S204, when the device connection network of the scheduling service is congested, obtaining a temporary connection service address returned by the scheduling service, and initiating a connection request to the temporary connection service according to the temporary key and the temporary connection service address, so as to establish a connection with the temporary connection service; S206, if it is detected that the device requests cloud service data, forwarding the device request to the cloud service through the temporary connection service; S208, receiving the connection data returned by the cloud service, and establishing a connection with the cloud service according to the connection data.
[0149] The device connection method applicable to the dispatching service includes the following steps:
[0150] S302, obtaining a scheduling request from the device; S304, determining whether the network to which the device is connected is congested based on the scheduling request and preset initial monitoring parameters; S306, if the network to which the device is connected is congested, generating a temporary key based on the scheduling request and obtaining a temporary connection service address; S308, sending the temporary key and the temporary connection service address to the device so that a connection is established with the temporary connection service when it is detected that the device requests cloud service data; S310, forwarding the device request of the device to the cloud service through the temporary connection service, and establishing a connection between the device and the cloud service based on the device request.
[0151] Optionally, the specific examples in this embodiment can refer to the examples described in the above embodiments, and this embodiment will not be repeated here. And when the embodiments of this application are specifically implemented, they can refer to the above embodiments and have corresponding technical effects.
[0152] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.
[0153] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.
[0154] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0155] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0156] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0157] 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 units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0158] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0159] It should be noted that, in this article, relational terms such as first, second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms include, include or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0160] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A device connection method, applicable to a device in a device connection system, the device connection system comprising: equipment, dispatch services, temporary connection services, and cloud services; The device is respectively connected to the scheduling service, the temporary connection service and the cloud service for communication; The scheduling service is communicatively connected with the cloud service; The temporary connection service is communicatively connected with the cloud service, wherein the method comprises: Obtaining a temporary key returned by the scheduling service, where the temporary key is generated by the scheduling service according to the scheduling request sent by the device; When the device connection network of the scheduling service is congested, obtaining the temporary connection service address returned by the scheduling service, and initiating a connection request to the temporary connection service according to the temporary key and the temporary connection service address to establish a connection with the temporary connection service; If it is detected that the device requests cloud service data, forwarding the device request to the cloud service via the temporary connection service; Receive connection data returned by the cloud service, and establish a connection with the cloud service according to the connection data.
2. The device connection method according to claim 1, characterized in that: Before obtaining the temporary key returned by the scheduling service, the method further includes: Sending a scheduling request to the scheduling service; Detecting network congestion of a device connected to the scheduling service according to the scheduling request; If the network to which the device of the scheduling service is connected is not congested, a temporary key is generated through the scheduling service and the temporary key is returned to the device.
3. The device connection method according to claim 2, characterized in that: After detecting the network congestion of the device connection of the scheduling service according to the scheduling request, the method further includes: If the network connection of the device of the scheduling service is congested, a temporary connection service address is obtained through the scheduling service; The temporary key and the temporary connection service address are returned to the device through the scheduling service.
4. The device connection method according to claim 2, characterized in that: The detecting, according to the scheduling request, a network congestion condition of a device connected to the scheduling service includes: Obtaining a preset initial monitoring parameter, where the preset initial monitoring parameter is a threshold value of the number of requests generated by the scheduling service within a fixed time period; Whether a network connected to a device of the scheduling service is congested is determined according to the scheduling request and the preset initial monitoring parameters.
5. The device connection method according to claim 4, characterized in that: The determining, according to the scheduling request and the preset initial monitoring parameters, whether the device connection network of the scheduling service is congested includes: Detecting the number of real-time requests generated by the scheduling service within a fixed time period according to the scheduling request; If the number of real-time requests generated by the scheduling service within a fixed time period exceeds the preset initial monitoring parameter, it is determined that the device connection network is congested; If the number of real-time requests generated by the scheduling service within a fixed time period does not exceed the preset initial monitoring parameter, it is determined that the network connected to the device is not congested.
6. The device connection method according to claim 2, characterized in that: After obtaining the temporary key returned by the scheduling service, the method further includes: When the network connected to the device of the scheduling service is not congested, forwarding the scheduling request of the device to the cloud service through the scheduling service; Connecting with the cloud service is performed based on the temporary key and the scheduling request of the device.
7. The device connection method according to claim 1, characterized in that: If it is detected that the device requests cloud service data, forwarding the device request to the cloud service through the temporary connection service includes: Sending a device request to the temporary connection service to obtain cloud service data; After the temporary connection service verifies the device request, the temporary connection service forwards the device request to the cloud service.
8. A device connection device, applicable to a device in a device connection system, the device connection system comprising: equipment, dispatch services, temporary connection services, and cloud services; The device is respectively connected to the scheduling service, the temporary connection service and the cloud service for communication; The scheduling service is communicatively connected with the cloud service; The temporary connection service is communicatively connected to the cloud service, wherein the device comprises: A first acquisition module, used to acquire a temporary key returned by a scheduling service, where the temporary key is generated by the scheduling service according to a scheduling request sent by a device; A first connection module, configured to, when the network connection of the device of the scheduling service is congested, obtain a temporary connection service address returned by the scheduling service, initiate a connection request to the temporary connection service according to the temporary key and the temporary connection service address, so as to establish a connection with the temporary connection service; A first forwarding module, configured to forward the device request to the cloud service through the temporary connection service if it is detected that the device requests cloud service data; The second connection module is used to receive the connection data returned by the cloud service and establish a connection with the cloud service according to the connection data.
9. An electronic device, comprising a memory, a processor, a communication interface and a communication bus, wherein the memory stores a computer program that can be run on the processor, and the memory and the processor communicate through the communication bus and the communication interface, characterized in that: When the processor executes the computer program, the device connection method described in any one of claims 1 to 7 is implemented.
10. A computer readable medium having a non-volatile program code executable by a processor, characterized in that: The program code enables the processor to execute the steps of the device communication method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for data transmission
CN105763618A
Database access method, device and system and computer readable storage medium
CN111935094A
System and method for controlling congestion in networks
EP1320237A2
Temporarily connecting method which distributes access requests from terminal spatially and / or temporally, server and program
JP2008097314A
Method for allocating temporary identifier to terminal in random access procedure in wireless communication system and apparatus tehrefor
US20170019930A1