Multi-task retry method and device, electronic equipment and storage medium

By analyzing the historical time interval and the time wheel algorithm of the equipment, dynamically adjust the heavy test interval and arrange the trial task, solve the problem of low efficiency of the trial task when connecting the device of the Internet of Things platform, and realize the efficient and stable equipment connection management management Essence

CN119376875APending Publication Date: 2025-01-28E SURFING IOT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411260175.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently solve the problem of a large number of retry tasks when connecting devices on the Internet of Things platform, especially to ensure successful device connection in a short period of time.

Method used

By analyzing the historical time interval of the successful connection of the device, dynamically adjust the heavy test interval, and use the time wheel algorithm to arrange the review task, and allocate the use of the available node asynchronous execution in batches.

Benefits of technology

A stable and efficient equipment connection management in a high concurrency environment has been realized, reducing ineffective retry, and improving the overall efficiency and resource utilization rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376875A_ABST
    Figure CN119376875A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-task retry method and device, electronic equipment and a storage medium. The method comprises the steps that based on historical time of successful connection between different types of equipment and a target platform, a time interval of successful connection of each type of equipment is obtained through arrangement; based on the time interval, allocating execution time to a retry task corresponding to the to-be-connected equipment; according to the execution time of the retry task, putting the retry task into a time grid corresponding to the time wheel; in response to the direction of the target time in the time wheel, taking out all retry tasks of the target time grid as target tasks; all available nodes of the target platform at the target time are obtained, and the target tasks are distributed to the available nodes in batches; and asynchronously executing the target task based on the available nodes. According to the method, stable and efficient equipment connection management can be realized in a high-concurrency environment, and the method can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a multi-task retry method, device, electronic equipment and storage medium. Background Art

[0002] With the rapid development of IoT technology, IoT sensing cloud platforms, as a bridge connecting the physical world and the digital world, have been increasingly widely used, from smart homes to smart cities, from industrial manufacturing to agricultural monitoring, all of which have demonstrated their strong influence and potential. As these platforms are widely adopted and deployed, the number of connected IoT devices has also shown an explosive growth trend, forming a huge device network, which is large enough to make the transmission of any instruction face unprecedented challenges.

[0003] However, at present, there is no complete solution to solve the problem of connecting devices to the IoT platform. It is necessary to ensure that when the device can be finally connected after multiple retries, the problem of solving a large number of retry tasks in a short period of time. Summary of the invention

[0004] The present invention proposes a multi-task retry method, device, electronic device and storage medium, aiming to solve one of the technical problems in the related art at least to a certain extent. The embodiments of the present invention can efficiently implement multi-task retry.

[0005] On the one hand, an embodiment of the present invention provides a multi-task retry method, including:

[0006] Based on the historical time of successful connection between different types of devices and the target platform, the time interval of successful connection of each type of device is obtained;

[0007] Based on the time interval, the execution time is allocated to the retry task corresponding to the device to be connected;

[0008] According to the execution time of the retry task, put the retry task into the corresponding time grid of the time wheel;

[0009] In response to the target time pointing to the time wheel, taking out all the retry tasks of the target time grid as the target tasks;

[0010] Obtain all available nodes of the target platform at the target time, distribute the target tasks to each available node in batches; and asynchronously execute the target tasks based on the available nodes.

[0011] Optionally, obtaining a time interval for successful connection of each type of device based on historical times of successful connection of different types of devices to the target platform includes the following steps:

[0012] Get all the historical times when each type of device successfully connects to the target platform; the historical time represents the timestamp of the moment when the device successfully connects to the target platform;

[0013] Split the timestamp into three independent dimensions: hours, minutes, and seconds, and then store them in the target database;

[0014] Perform statistical analysis on the time data corresponding to each type of device in the target database, and obtain the high-frequency time period of successful connection of each type of device as the time interval;

[0015] The high-frequency time period represents that the number of data items of the time data of the corresponding time period is greater than a preset threshold.

[0016] Optionally, allocating execution time for the retry task corresponding to the device to be connected based on the time interval includes the following steps:

[0017] Take the current time as the candidate time;

[0018] Determine whether the candidate time and the time interval corresponding to the device to be connected conform to a preset corresponding relationship;

[0019] If it meets the preset corresponding relationship, the candidate time is used as the execution time of the retry task corresponding to the device to be connected; otherwise, the next time point of the candidate time is used as the candidate time, and the step of determining whether the candidate time and the time interval corresponding to the device to be connected meet the preset corresponding relationship is returned until the retry task is assigned an execution time.

[0020] Optionally, the method further comprises the following steps:

[0021] The time wheel is initialized based on a preset time span through a time wheel algorithm to obtain a time wheel.

[0022] Optionally, in response to the target time being pointed at on the time wheel, taking out all retry tasks in the target time grid as target tasks includes the following steps:

[0023] The rotation of the time wheel is pushed through the polling thread so that the current time pointer continues to move forward on the time wheel; the target time is updated in real time based on the current time that is advanced;

[0024] The time grid pointed to by the current time pointer on the time wheel is taken as the target time grid, and all retry tasks of the target time grid are taken out as the target tasks.

[0025] Optionally, obtaining all available nodes of the target platform at the target time and allocating the target tasks in batches to the available nodes includes the following steps:

[0026] Obtain all available nodes of the target platform at the target time, and then determine the number of available nodes;

[0027] The number of tasks that each available node undertakes is based on the ratio of the total number of tasks of the target task to the number of nodes;

[0028] Based on the number of tasks, the target tasks are allocated in batches to each available node by initiating an interface request.

[0029] Optionally, asynchronously executing the target task based on available nodes includes the following steps:

[0030] Determine multiple target connection devices corresponding to the target task obtained by allocating available nodes;

[0031] An asynchronous network request is initiated to multiple target connection devices through an available node, so that the multiple target connection devices asynchronously execute target tasks in response to the asynchronous network request.

[0032] On the other hand, an embodiment of the present invention provides a multi-task retry device, including:

[0033] The first module is used to obtain the time interval of successful connection of each type of device based on the historical time of successful connection between different types of devices and the target platform;

[0034] The second module is used to allocate execution time for the retry task corresponding to the device to be connected based on the time interval;

[0035] The third module is used to put the retry task into the time grid corresponding to the time wheel according to the execution time of the retry task;

[0036] The fourth module is used for taking out all the retry tasks of the target time grid as the target tasks in response to the direction of the target time on the time wheel;

[0037] The fifth module is used to obtain all available nodes of the target platform at the target time, distribute the target tasks to each available node in batches, and asynchronously execute the target tasks based on the available nodes.

[0038] Optionally, the device further comprises:

[0039] The sixth module is used to obtain a time wheel by initializing the time wheel algorithm based on a preset time span.

[0040] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned multi-task retry method.

[0041] On the other hand, an embodiment of the present invention provides a computer storage medium, in which a program executable by a processor is stored. When the program executable by the processor is executed by the processor, it is used to implement the above-mentioned multi-task retry method.

[0042] The embodiment of the present invention obtains the time interval of successful connection of each type of device by sorting out the historical time of successful connection between different types of devices and the target platform; based on the time interval, the execution time is allocated to the retry task corresponding to the device to be connected; according to the execution time of the retry task, the retry task is placed in the time grid corresponding to the time wheel; in response to the direction of the target time in the time wheel, all retry tasks in the target time grid are taken out as the target task; all available nodes of the target platform at the target time are obtained, and the target tasks are batch-allocated to each available node; and the target task is asynchronously executed based on the available nodes. The embodiment of the present invention introduces a refined time management function, which automatically records and analyzes the time pattern of successful connection of each device, and dynamically adjusts the retry interval of each device accordingly, so as to realize a personalized and efficient retry strategy. The present invention can ensure stable and efficient device connection management even in a high concurrency environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

[0044] Figure 1 A schematic diagram of an implementation environment for performing multi-task retry provided by an embodiment of the present invention;

[0045] Figure 2 A flowchart of a multi-task retry method provided by an embodiment of the present invention;

[0046] Figure 3 A schematic diagram of an expanded flow chart of arranging the time intervals of successful connections provided by an embodiment of the present invention;

[0047] Figure 4 A schematic diagram of an expanded flow chart of allocating execution time provided by an embodiment of the present invention;

[0048] Figure 5 A schematic diagram of the principle of allocating tasks to time slots provided by an embodiment of the present invention;

[0049] Figure 6 A schematic diagram of the principle of extracting a time wheel task provided by an embodiment of the present invention;

[0050] Figure 7 A schematic diagram of the principle of task allocation provided by an embodiment of the present invention;

[0051] Figure 8 A schematic diagram of an example of data parameters for performance comparison provided by an embodiment of the present invention;

[0052] Fig. 9 A schematic diagram of the structure of a multi-task retry device provided by an embodiment of the present invention;

[0053] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.

[0055] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0056] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0057] To facilitate the understanding of the technical solution of the present invention, the technical feature terms that may appear in the embodiments of the present invention are first explained:

[0058] Network latency: refers to the time required for data to be transmitted from the sender to the receiver in network communications. This time includes the propagation time of the data packet in the network, the processing time (such as routing decisions, queuing, etc.), and the additional waiting time that may be caused by factors such as network congestion and device performance.

[0059] Packet loss: refers to the phenomenon that during the process of data packets being transmitted from the sender to the receiver in a computer network, due to network congestion, hardware failure, signal interference, software defects or transmission path problems, the data packets fail to successfully reach the destination and are discarded.

[0060] Distributed: refers to a system in which hardware or software components are distributed on different network computers and communicate and coordinate with each other only through message passing. These components can be distributed in different geographical locations and connected to each other through computer networks, but they appear to be a unified whole to the outside world and provide consistent services.

[0061] It is understandable that the multi-task retry method provided in the embodiment of the present invention can be applied to any computer device with data processing computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this.

[0062] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.

[0063] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0064] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.

[0065] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present invention.

[0066] Based on the example Figure 1 In the implementation environment shown, an embodiment of the present invention provides a multi-task retry method. The following is an example of the multi-task retry method being applied in the terminal 102. It can be understood that the multi-task retry method can also be applied in the server 101.

[0067] Reference Figure 2 , Figure 2 The flowchart of the multi-task retry method applied to the terminal provided by the embodiment of the present invention, the execution subject of the multi-task retry method can be any of the aforementioned computer devices (including servers or terminals). Figure 2 , the method comprises the following steps:

[0068] S100, sorting out the historical time of successful connection between different types of devices and the target platform to obtain the time interval of successful connection of each type of device;

[0069] It should be noted that in some embodiments, Figure 3 As shown, step S100 may include the following steps: S101, obtaining all historical times when each type of device successfully connects to the target platform; the historical time represents the timestamp of the moment when the device successfully connects to the target platform; S102, splitting the timestamp into three independent dimensions of hours, minutes and seconds, and then storing them in the target database; S103, performing statistical analysis on the time data corresponding to each type of device in the target database, and obtaining the high-frequency time period of successful connection of each type of device as the time interval; wherein the high-frequency time period represents that the number of data items of the time data of the corresponding time period is greater than a preset threshold.

[0070] Exemplarily, in some specific implementations, the embodiments of the present invention include a time interval optimization process for successful connection of computing devices. In order to accurately capture and analyze the time pattern of successful connection of devices to the platform, the present invention implements a set of systematic time recording and analysis strategies. Whenever the platform successfully establishes a connection with the device, the timestamp of this critical moment will be automatically captured and stored in the database. Subsequently, the present invention finely divides this timestamp into three independent dimensions of hours, minutes and seconds, and stores them separately for subsequent in-depth analysis. The specific steps can be implemented as follows:

[0071] Step 1: Time recording. When the platform and the device are successfully connected, the current timestamp is immediately and accurately recorded in the back-end database to ensure the integrity and timeliness of the information.

[0072] Step 2: Time splitting and storage. The timestamps of the above records are deeply processed and split into three independent fields: hours, minutes, and seconds, and stored separately. This step is intended to provide a more detailed time granularity for subsequent data analysis.

[0073] Step 3: Calculate the connection success interval. Based on the historical connection success hour, minute, and second data, use statistical analysis methods to identify and calculate the high-frequency time period of successful connection. The core of this step is to explore the rules behind the data in order to predict the closest time point when the device may succeed when it needs to retry the connection in the future.

[0074] Through the above process, the present invention can more accurately grasp the time characteristics of successful device connection, and provide strong support for optimizing connection strategies and improving user experience.

[0075] S200, allocating execution time for the retry task corresponding to the device to be connected based on the time interval;

[0076] It should be noted that in some embodiments, Figure 4 As shown, step S200 may include the following steps: S201, taking the current time as the candidate time; S202, judging whether the candidate time and the time interval corresponding to the device to be connected conform to a preset corresponding relationship; S203, if it conforms to the preset corresponding relationship, taking the candidate time as the execution time of the retry task corresponding to the device to be connected; otherwise, taking the next time point of the candidate time as the candidate time, and returning to the step of judging whether the candidate time and the time interval corresponding to the device to be connected conform to the preset corresponding relationship, until the retry task is assigned an execution time.

[0077] Exemplarily, in some specific implementations, the embodiments of the present invention analyze the time intervals of successful device connections in the past, and accurately calculate the time node that is most suitable for initiating the device retry connection task based on the current retry time. The process of calculating the time for retrying the connection mainly has several steps. First, compare the current time (task initiation time) with the time of all successful connections, and calculate the proportion of the current time in the time of successful connection, that is, the probability. If the proportion is greater than 10% (for example, the task initiation time is within the time interval or within a preset time range before and after the time interval), the current time is used for connection. Otherwise, the subsequent time points are traversed sequentially to determine whether they meet the conditions until a time that meets the conditions is found.

[0078] Among them, if the connection fails in the subsequent specific execution process, the next successful connection time with a probability greater than the current probability can be found in the new task retry process. The search for a suitable connection time can be continued in this way until the connection is successful. This process incorporates the historical laws of device connection behavior and is closely integrated with the current time, aiming to ensure that the retry operation can be performed within the most favorable time window, thereby maximizing the possibility of successful connection. It should be understood that the process steps of the multi-task retry method implemented by the present invention can be executed periodically, for example, based on a preset execution frequency / period, all the process steps of the multi-task retry method of an embodiment of the present invention are continuously executed.

[0079] S300, placing the retry task into the time grid corresponding to the time wheel according to the execution time of the retry task;

[0080] In some embodiments, the method may further include the following steps: obtaining a time wheel by initializing a time wheel algorithm based on a preset time span.

[0081] For example, in some specific embodiments, Figure 5 As shown in the figure, according to the logic of the time wheel algorithm, the tasks can be assigned to the corresponding slots on the time wheel according to the execution time of the current retry task. This process ensures that each task can be properly arranged according to its preset time point, which not only avoids conflicts and interference between tasks, but also ensures the punctuality and efficiency of task execution. The application of the time wheel algorithm makes the allocation and management of retry tasks both intuitive and efficient. When using the time wheel algorithm, you first need to initialize the time wheel and use 1 second as the basic time span of the time wheel. Then each retry task object is stored in the task list as basic data.

[0082] S400, in response to the target time pointing to the time wheel, taking out all retry tasks of the target time grid as the target task;

[0083] It should be noted that, in some embodiments, step S400 may include the following steps: pushing the rotation of the time wheel through a polling thread so that the current time pointer continues to move forward on the time wheel; the target time is updated in real time based on the current time that is advanced to; the time grid pointed to by the current time pointer on the time wheel is used as the target time grid, and all retry tasks in the target time grid are taken out as target tasks.

[0084] For example, in some specific implementations, after the retry task is placed in the time wheel, the time wheel is started, and the rotation of the time wheel is pushed by the polling thread; as time goes by, the currentTime pointer (i.e., the current time pointer) moves forward continuously and steadily on the time wheel. Figure 6 As shown, whenever the currentTime pointer points to a certain time grid, all retry tasks carried in the time grid will be automatically identified and centrally extracted by the system.

[0085] S500, obtaining all available nodes of the target platform at the target time, distributing the target tasks to each available node in batches; and asynchronously executing the target tasks based on the available nodes.

[0086] It should be noted that, in some embodiments, obtaining all available nodes of the target platform at the target time and allocating the target tasks to each available node in batches may include the following steps: obtaining all available nodes of the target platform at the target time, and then determining the number of available nodes; calculating the number of tasks undertaken by each available node based on the ratio of the total number of tasks of the target task to the number of nodes; and allocating the target tasks to each available node in batches by initiating an interface request based on the number of tasks.

[0087] For example, in some specific implementations, the embodiments of the present invention can also realize batch allocation of retry tasks. When the time wheel algorithm accurately identifies and extracts a large number of tasks to be retried, the system immediately starts an efficient batch allocation mechanism. Figure 7 As shown in the figure, these tasks are carefully organized so that they can be distributed to the widely distributed nodes in the platform in an orderly manner at one time. Each node further subdivides these tasks and assigns them to multiple threads within it for parallel execution. This method of batch allocation and parallel processing not only greatly improves the efficiency of task execution, but also effectively utilizes platform resources and ensures that all retry tasks can be properly processed in the shortest time. The specific steps can be implemented as follows:

[0088] Step 1: The system obtains the number of all available nodes on the current platform in real time and accurately. This process ensures that the system can fully understand the platform's carrying capacity, thereby providing a solid data foundation for subsequent task allocation strategies. By accurately grasping the number of nodes, the system can more flexibly adjust the task allocation plan to maximize the use of the computing resources of each node and improve overall operating efficiency.

[0089] Step 2: The total number of tasks in this batch is used as the dividend and the number of nodes as the divisor to perform a division operation to obtain the number of retry tasks that each node should undertake. This process is designed to ensure the fairness and rationality of task allocation, so that each node can undertake the amount of tasks that matches its computing power, thereby improving the efficiency and stability of overall task processing.

[0090] Step 3: By initiating an interface request, each node is assigned a certain number of retry tasks according to its identifier. This process ensures efficient and accurate task allocation. Subsequently, upon receiving the task request, each node immediately starts the internal scheduling mechanism, further subdividing these tasks into smaller units and assigning them to all its available threads for parallel processing. This distributed parallel execution method not only significantly improves the task processing rate, but also effectively utilizes platform resources, ensuring that tasks can be executed quickly and accurately.

[0091] It should also be noted that, in some embodiments, asynchronously executing the target task based on available nodes may include the following steps: determining multiple target connection devices corresponding to the target task based on the target task allocated by the available nodes; initiating asynchronous network requests to the multiple target connection devices through the available nodes, so that the multiple target connection devices asynchronously execute the target task in response to the asynchronous network requests.

[0092] Exemplarily, in some specific implementations, the embodiments of the present invention can also implement asynchronous execution of retry tasks. The retry task mainly initiates a network request to the device, and each thread needs to initiate a network request to multiple devices. If the network request is executed synchronously and the number of devices is large, the execution time of a single thread will also be very large. Moreover, this time consumption will increase with the increase in the number of devices. Therefore, by initiating an asynchronous network request, a single thread does not need to wait for the device to return before connecting to the next device. Instead, it initiates network requests for multiple devices at the same time. The processing time of a single thread is greatly reduced.

[0093] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0094] First of all, it should be noted that, based on the background technology, the efficiency and stability of the interaction between the platform and the device have become the key factors that determine the performance of the entire IoT system. However, due to the complexity of the network environment (such as signal fluctuations, network delays, packet loss, etc.) and the possible failures or limitations of the device itself (such as response delays in low-power mode, firmware defects, etc.), the instructions sent by the platform to the device often cannot be successfully received and executed at one time. In order to overcome this problem and ensure the accurate transmission of instructions and the smooth execution of tasks, the IoT perception cloud platform urgently needs to implement an efficient, reliable and scalable retry task management mechanism.

[0095] This high-performance retry task method not only needs to be able to quickly respond to network or device failures and automatically resend instructions, but also needs to have an intelligent retry strategy, such as dynamically adjusting the retry interval based on the device response history, and adopting differentiated retry logic for different types of errors, etc., to reduce invalid retries and improve overall efficiency. At the same time, in the face of millions or even higher levels of retry tasks, the platform must also have strong concurrent processing capabilities and resource scheduling strategies to ensure stable operation under high load conditions and avoid system bottlenecks and resource exhaustion.

[0096] Therefore, how to efficiently perform reconnection tasks involving millions of devices and ensure that the number of connections for each device is minimized has become a major technical challenge facing the IoT platform. With such a large scale of devices, how to optimize the connection process, improve processing speed, ensure that the link between devices and the platform remains unobstructed, and effectively manage resource consumption are all key issues that need to be solved. The existing methods all have some limitations:

[0097] 1) In a highly complex and dynamic IoT ecosystem, it is a very challenging task to quickly distribute instructions to millions of devices. These devices are widely distributed in different network environments and application scenarios, and their status, response speed and stability are affected by many factors. Therefore, when the IoT platform needs to issue unified instructions to these devices within a tight time window, such as within a few minutes, it often encounters a series of expected challenges. First, due to the complexity and variability of the network environment, including network congestion, unstable signals, routing delays, etc., some instructions may not be immediately received or executed by the target device. In addition, the status of the device itself, such as hardware aging, software bugs, low power mode, etc., is also an important reason for the failure of instruction execution. In the face of these inevitable failures, the platform must rely on an efficient retry mechanism to ensure the final delivery of the instruction. However, traditional retry strategies seem to be powerless when facing millions of devices. Whenever a command fails to be successfully delivered or executed, the platform triggers a retry request and sets a certain time interval between the two attempts. However, when the number of tasks that need to be retried increases sharply, the overall processing time will increase dramatically if these requests are processed synchronously, i.e. they are queued one by one and wait for processing, and may even be delayed for several hours. This low processing efficiency not only affects the overall performance of the IoT system, but may also have serious consequences for business scenarios that rely on real-time data interaction.

[0098] 2) To ensure that all tasks can be executed effectively, the IoT platform will implement a retry mechanism. In this mechanism, for tasks that fail to succeed the first time, the system will arrange multiple retries, and a fixed time interval will be set between each retry to balance the system load and task completion efficiency. However, this seemingly reasonable strategy faces complex challenges unique to the IoT environment in actual applications. The vast field of the IoT covers a wide variety of access devices, from smart home devices to industrial sensors, from wearable devices to smart city infrastructure, each of which has its own unique operating mode and state changes. The operating working hours of these devices are often different. Some devices may run uninterruptedly around the clock, while others may only be activated during specific periods or conditions. Therefore, when a fixed interval is used for retrying, the following situation is likely to occur: for some devices, this interval just matches their operating status, ensuring that the command is successfully received when the device is active; but for other devices, this interval may be too long or too short, resulting in the command being sent when the device is dormant or busy, thus forming an invalid retry task. Ineffective retry tasks not only waste system resources, but may also interfere with the normal operation of the device. In some cases, such as frequently waking up a sleeping device, it may also have an adverse effect on the battery life of the device.

[0099] It should be noted that the existing technical solutions include the following disadvantages:

[0100] 1. When a device fails to issue a command, the system will immediately trigger a retry mechanism. However, given the periodic network interruptions that may occur on the device, this immediate retry is often difficult to ensure success, and may instead trigger a large number of invalid execution attempts, increasing the system burden without substantial progress.

[0101] 2. It does not support distributed execution of retry tasks, that is, all retry tasks are limited to processing on local nodes alone, and cannot effectively utilize the parallel processing capabilities and resource sharing advantages of the cluster. This limitation significantly restricts the performance of the system and leads to low efficiency in processing retry tasks.

[0102] 3. Retry tasks are currently executed in synchronous mode, and retry tasks mainly focus on network communication with devices. Using synchronous methods to handle network communication often leads to performance bottlenecks because it requires tasks to continue waiting for network responses during execution, thereby limiting the system's ability to handle concurrent requests.

[0103] Currently, there is no complete solution to solve the problem of connecting devices to the IoT platform. It is necessary to ensure that when the device can be finally connected after multiple retries, the problem of solving a large number of retry tasks in a short period of time.

[0104] In view of this, the present invention aims to solve the problem of million-level retry tasks in the field of the Internet of Things. The present invention combines the current problems of million-level task retry and proposes a new solution. The main process steps of the technical solution are as follows:

[0105] 1. Optimize the time interval of successful device connection. In order to accurately capture and analyze the time pattern of successful device connection to the platform, the present invention implements a systematic time recording and analysis strategy. Whenever the platform and the device successfully establish a connection, the timestamp of this critical moment will be automatically captured and stored in the database. Subsequently, the present invention will finely split this timestamp into three independent dimensions of hours, minutes and seconds, and store them separately for subsequent in-depth analysis. The specific steps are as follows:

[0106] Step 1: Time recording. When the platform and the device are successfully connected, the current timestamp is immediately and accurately recorded in the back-end database to ensure the integrity and timeliness of the information.

[0107] Step 2: Time splitting and storage. The timestamps of the above records are deeply processed and split into three independent fields: hours, minutes, and seconds, and stored separately. This step is intended to provide a more detailed time granularity for subsequent data analysis.

[0108] Step 3: Calculate the connection success interval. Based on the historical connection success hour, minute, and second data, use statistical analysis methods to identify and calculate the high-frequency time period of successful connection. The core of this step is to explore the rules behind the data in order to predict the closest time point when the device may succeed when it needs to retry the connection in the future.

[0109] Through the above process, the present invention can more accurately grasp the time characteristics of successful device connection, and provide strong support for optimizing connection strategies and improving user experience.

[0110] 2. In the process of optimizing the stability of device connections, the present invention cleverly uses the time wheel algorithm to schedule and execute retry tasks. This strategy first deeply analyzes the time intervals of the device's historical successful connections, uses these data as a reference, and through precise calculations, determines the most appropriate retry time point in the current situation. Subsequently, the present invention once again relies on the powerful function of the time wheel algorithm to accurately embed this retry task into the corresponding position of the time wheel to ensure that it can be efficiently executed in accordance with the predetermined time sequence. By utilizing the time wheel algorithm in this way, the present invention not only improves the execution efficiency of the retry tasks, but also significantly enhances the system's ability to respond to device connection problems and overall stability.

[0111] Step 1: Carefully analyze the time intervals when the device successfully connected in the past, and based on the current retry time, accurately calculate the time node that is most suitable for initiating the device retry connection task. The process of calculating the time for retrying the connection mainly has several steps. First, compare the current time (task initiation time) with the time of all successful connections, and calculate the proportion of the current time in the time of successful connection, that is, the probability. If the proportion is greater than 10% (for example, the task initiation time is within the time interval or within the preset time range before and after the time interval), use the current time for connection.

[0112] If the connection fails during the subsequent execution, the next successful connection time with a probability greater than the current probability will be searched. The search for a suitable connection time can be continued in this way until the connection is successful. This process combines the historical laws of device connection behavior and is closely combined with the current time, aiming to ensure that the retry operation can be performed within the most favorable time window, thereby maximizing the possibility of successful connection.

[0113] Step 2: If Figure 5As shown in the figure, according to the logic of the time wheel algorithm, the tasks are assigned to the corresponding slots on the time wheel according to the execution time of the current retry task. This process ensures that each task can be properly arranged according to its preset time point, which not only avoids conflicts and interference between tasks, but also ensures the punctuality and efficiency of task execution. The application of the time wheel algorithm makes the allocation and management of retry tasks both intuitive and efficient. When using the time wheel algorithm, you first need to initialize the time wheel and use 1 second as the basic time span of the time wheel. Then store each retry task object as basic data in the task list. Finally, start the time wheel and push the rotation of the time wheel through the polling thread.

[0114] Step 3: As time goes by, the currentTime pointer moves forward steadily on the time wheel. Figure 6 As shown, whenever the currentTime pointer points to a certain time grid, all retry tasks carried in the time grid will be automatically identified and centrally extracted by the system.

[0115] 3. Batch allocation of retry tasks. When the time wheel algorithm accurately identifies and extracts a large number of tasks to be retried, the system immediately starts an efficient batch allocation mechanism. Figure 7 As shown in the figure, these tasks are carefully organized so that they can be distributed to the widely distributed nodes in the platform in an orderly manner at one time. Each node further subdivides these tasks and assigns them to multiple threads within it for parallel execution. This method of batch allocation and parallel processing not only greatly improves the efficiency of task execution, but also effectively utilizes platform resources and ensures that all retry tasks can be properly processed in the shortest time.

[0116] 4. Step 1: The system obtains the number of all available nodes on the current platform in real time and accurately. This process ensures that the system can fully understand the carrying capacity of the platform, thereby providing a solid data foundation for subsequent task allocation strategies. By accurately grasping the number of nodes, the system can more flexibly adjust the task allocation plan to maximize the use of the computing resources of each node and improve the overall operation efficiency.

[0117] Step 2: The total number of tasks in this batch is used as the dividend and the number of nodes as the divisor to perform a division operation to obtain the number of retry tasks that each node should undertake. This process is designed to ensure the fairness and rationality of task allocation, so that each node can undertake the amount of tasks that matches its computing power, thereby improving the efficiency and stability of overall task processing.

[0118] Step 3: By initiating an interface request, each node is assigned a certain number of retry tasks according to its identifier. This process ensures efficient and accurate task allocation. Subsequently, upon receiving the task request, each node immediately starts the internal scheduling mechanism, further subdividing these tasks into smaller units and assigning them to all its available threads for parallel processing. This distributed parallel execution method not only significantly improves the task processing rate, but also effectively utilizes platform resources, ensuring that tasks can be executed quickly and accurately.

[0119] 4. Asynchronous execution of retry tasks. The retry task mainly initiates network requests to the device. Each thread needs to initiate network requests to multiple devices. If the network request is executed synchronously and the number of devices is large, the execution time of a single thread will also be very long. Moreover, this time consumption will increase with the increase of the number of devices. Therefore, by initiating asynchronous network requests, a single thread does not need to wait for the device to return before connecting to the next device. Instead, it initiates network requests to multiple devices at the same time. This greatly reduces the processing time of a single thread.

[0120] The present invention mainly solves the problem that the current IoT platform cannot efficiently process a large number of retry tasks when connecting devices. Through the scheme described in the present invention, a large number of retry tasks that occur when connecting devices can be processed with high performance and the performance comparison is obvious. Figure 8 It shows the specific system application scenario (this system) and other task retry methods (Spring-Retry and Guava-Retry) implemented by the embodiment of the present invention.

[0121] In summary, the present invention has carefully constructed a set of high-performance, comprehensive coverage of millions of multi-task retry systems. Its core innovation is to achieve extremely fast processing of massive device connection retry tasks. The system adopts an advanced asynchronous execution mechanism to effectively disperse and accelerate the execution process of retry tasks. By integrating the time wheel algorithm, an efficient scheduling strategy, the system can intelligently arrange and allocate a large retry task queue to ensure that each task can be triggered at the optimal time.

[0122] In addition, the present invention also introduces a refined time management function, which automatically records and analyzes the time pattern of successful connection of each device, and dynamically adjusts the retry interval of each device accordingly, thus realizing a personalized and efficient retry strategy. This innovation not only improves the success rate of a single retry, but also significantly optimizes the efficiency and resource utilization of the overall retry process.

[0123] Specifically, the high-performance multi-task retry method proposed in the present invention, combined with asynchronous processing, time wheel algorithm and intelligent time management, provides strong technical support for handling large-scale device connection retry challenges, ensuring stable and efficient device connection management even in a high-concurrency environment.

[0124] Compared with the prior art, the present invention has at least the following beneficial effects:

[0125] 1. Calculate the retry task time. Calculate the time when the device successfully connects to estimate the execution time of the retry task. There are many types of devices connected to the IoT platform, and various devices may periodically disconnect from the network. By recording the time when the device successfully connects each time and reasonably calculating the time of the retry task, invalid retry tasks can be reduced.

[0126] 2. Use the time wheel algorithm to schedule retry tasks. After the retry tasks are scheduled by the time wheel algorithm, they can be scheduled by threads in a timely manner and handed over to business threads for execution. With this method, the execution time of the retry tasks will not be delayed and only a single thread is needed to complete the scheduling of a large number of tasks.

[0127] 3. Make full use of cluster resources to efficiently handle retry tasks. The IoT platform is usually a service cluster with multiple service nodes. Retry tasks may be concentrated on some nodes, and the retry tasks of these nodes are distributed to all nodes for execution through interfaces. Efficient execution of these retry tasks can greatly improve platform performance.

[0128] 4. Use asynchronous methods to efficiently execute retry tasks. Reissuing instructions to the device is a network request. Network requests consume less CPU and can be executed asynchronously. When there are a large number of network requests that need to be processed, asynchronous execution of network requests can complete the task using fewer threads, which significantly improves the overall performance.

[0129] On the other hand, Fig. 9 As shown, an embodiment of the present invention provides a multi-task retry device 900, comprising:

[0130] The first module 901 is used to sort out the historical time of successful connection between different types of devices and the target platform to obtain the time interval of successful connection of each type of device;

[0131] The second module 902 is used to allocate execution time for the retry task corresponding to the device to be connected based on the time interval;

[0132] The third module 903 is used to put the retry task into the time grid corresponding to the time wheel according to the execution time of the retry task;

[0133] The fourth module 904 is used to take out all retry tasks in the target time grid as target tasks in response to the direction of the target time on the time wheel;

[0134] The fifth module 905 is used to obtain all available nodes of the target platform at the target time, distribute the target tasks to each available node in batches, and asynchronously execute the target tasks based on the available nodes.

[0135] In some embodiments, the apparatus may further include:

[0136] The sixth module is used to obtain a time wheel by initializing the time wheel algorithm based on a preset time span.

[0137] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0138] On the other hand, an embodiment of the present invention further provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above sensitive information method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0139] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0140] like Fig.10 As shown, Fig.10 A specific example of the hardware structure of an electronic device 1000 according to an embodiment is shown. The electronic device 1000 includes:

[0141] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.

[0142] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the network node population optimization method of the embodiment of the present invention;

[0143] Input / output interface 1003, used to implement information input and output;

[0144] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0145] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0146] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0147] The electronic device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0148] The contents of the method embodiments of the present invention are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0149] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.

[0150] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read to Only Memory, CD to ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0151] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0152] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.

[0153] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0154] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0155] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD to ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present invention.

[0156] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0157] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[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 present invention, 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. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0159] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution device, apparatus or device (such as a computer-based device, a device including a processor, or other device that can fetch instructions from an instruction execution device, apparatus or device and execute the instructions), or in conjunction with such instruction execution device, apparatus or device. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution device, apparatus or device, or in conjunction with such instruction execution device, apparatus or device.

[0160] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0161] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0162] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0163] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0164] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A multi-task retry method, characterized in that: The following steps are involved: Based on the historical time of successful connection between different types of devices and the target platform, the time interval of successful connection of each type of the device is obtained; Based on the time interval, allocating execution time for the retry task corresponding to the device to be connected; According to the execution time of the retry task, the retry task is placed in the time grid corresponding to the time wheel; In response to the target time pointing to the time wheel, taking out all the retry tasks in the target time grid as target tasks; Acquire all available nodes of the target platform at the target time, and distribute the target tasks to each of the available nodes in batches; The target task is asynchronously executed based on the available nodes.

2. The multi-task retry method according to claim 1, characterized in that: The method of arranging the historical time of successful connection between different types of devices and the target platform to obtain the time interval of successful connection of each type of the device includes the following steps: Acquire all the historical times when the devices of various types are successfully connected to the target platform; the historical times represent the timestamps of the moments when the devices are successfully connected to the target platform; Splitting the timestamp into three independent dimensions of hours, minutes and seconds, and then storing them in a target database; Performing statistical analysis on the time data corresponding to each type of the device in the target database, respectively, to obtain a high-frequency time period of successful connection of each type of the device as the time interval; The high-frequency time period represents that the number of data items of the time data in the corresponding time period is greater than a preset threshold.

3. The multi-task retry method according to claim 1, characterized in that: The allocating execution time for the retry task corresponding to the device to be connected based on the time interval includes the following steps: Take the current time as the candidate time; Determine whether the candidate time and the time interval corresponding to the device to be connected conform to a preset corresponding relationship; If it meets the preset corresponding relationship, the candidate time is used as the execution time of the retry task corresponding to the device to be connected; otherwise, the next time point of the candidate time is used as the candidate time, and the step of determining whether the candidate time and the time interval corresponding to the device to be connected meet the preset corresponding relationship is returned to execute until the retry task is assigned the execution time.

4. The multi-task retry method according to claim 1, characterized in that: The method further comprises the following steps: The time wheel is obtained by initializing the time wheel algorithm based on a preset time span.

5. The multi-task retry method according to claim 1, characterized in that: In response to the target time pointing to the time wheel, taking out all the retry tasks of the target time grid as the target task, comprises the following steps: The rotation of the time wheel is pushed through a polling thread so that the current time pointer continuously moves forward on the time wheel; the target time is updated in real time based on the current time that is advanced; The time grid pointed to by the current time pointer on the time wheel is taken as the target time grid, and all the retry tasks in the target time grid are taken out as the target tasks.

6. The multi-task retry method according to claim 1, characterized in that: The step of acquiring all available nodes of the target platform at the target time and allocating the target tasks in batches to each of the available nodes comprises the following steps: Acquire all available nodes of the target platform at the target time, and then determine the number of the available nodes; The number of tasks undertaken by each of the available nodes is determined based on the ratio of the total number of tasks of the target task to the number of nodes; Based on the number of tasks, the target tasks are allocated in batches to each of the available nodes by initiating an interface request.

7. The multi-task retry method according to claim 1, characterized in that: The asynchronously executing the target task based on the available nodes comprises the following steps: Determine a plurality of target connection devices corresponding to the target task obtained by allocating the available nodes; An asynchronous network request is initiated to the plurality of target connection devices through the available node, so that the plurality of target connection devices asynchronously execute the target task in response to the asynchronous network request.

8. A multi-task retry device, characterized in that: include: The first module is used to sort out the historical time of successful connection between different types of devices and the target platform to obtain the time interval of successful connection of each type of device; The second module is used to allocate execution time for the retry task corresponding to the device to be connected based on the time interval; The third module is used to put the retry task into the time grid corresponding to the time wheel according to the execution time of the retry task; A fourth module is used for taking out all the retry tasks of the target time grid as target tasks in response to the direction of the target time on the time wheel; The fifth module is used to obtain all available nodes of the target platform at the target time, and distribute the target tasks to each of the available nodes in batches; The target task is asynchronously executed based on the available nodes.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.