Task checking method and device, equipment and medium
By dynamically adjusting the order of the task inspection of the Internet of Things equipment, the problem of low task inspection efficiency in existing technologies has been solved, and more efficient task matching and execution have been achieved.
Patent Information
- Application Number
- CN202411311320.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-09-20
AI Technical Summary
The prior art is inefficient in task inspection of IoT devices, and the inspection sequence cannot be dynamically adjusted, resulting in a reduced task execution efficiency.
Provide a task check method to obtain equipment information by receiving task inspection requests for IoT devices, and start traversing from the head node of the task queue according to the information. If it is not matched, the target task node is determined to optimize the sequence of inspection and improve efficiency.
Dynamically adjust the order of task inspection, improve the efficiency of task inspection, enable IoT equipment to match and perform tasks more quickly, and improve overall production efficiency.
Smart Images

Figure CN119383104A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a task inspection method, device, equipment and medium. Background Art
[0002] With the continuous development of computer technology, the Industrial Internet of Things has been increasingly applied to various scenarios, such as equipment monitoring and maintenance, production process optimization, intelligent manufacturing, industrial safety, energy management, etc. Among them, the Industrial Internet of Things is to continuously integrate various types of acquisition and control sensors or controllers with perception and monitoring capabilities, as well as mobile communications, intelligent analysis and other technologies into all aspects of the industrial production process, thereby greatly improving manufacturing efficiency, improving product quality, reducing product costs and resource consumption, and ultimately achieving a new stage of upgrading traditional industries to intelligence. In the Industrial Internet of Things, each IoT device needs to build and execute tasks during operation. In order to make each IoT device more intelligent, it is particularly important to check the tasks of each IoT device.
[0003] At present, in the related technology, the IoT platform checks whether it needs to send tasks to the IoT device from the task queue in turn according to the relevant information of the IoT device. However, this solution needs to check all the tasks in the task queue from the beginning for each task request. Its checking method is relatively single and one-sided, resulting in extremely low efficiency of task checking. Summary of the invention
[0004] The purpose of this application is to provide a task inspection method, device, equipment and medium, which can dynamically adjust the order of task inspection, make the task inspection more flexible, and further improve the efficiency of task inspection.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a task checking method, comprising:
[0007] Receive the current task check request sent by the IoT device and obtain the IoT device information;
[0008] According to the IoT device information, traverse all task nodes of the task queue starting from the head node of the task queue to determine whether there is a task matching the IoT device information; the task queue includes a plurality of task nodes connected in a ring;
[0009] If there is no task matching the IoT device information, determining a target task node from the task queue, wherein the target task node is a task node determined from the task queue according to a task check frequency;
[0010] Starting from the target task node, all task nodes in the task queue are traversed to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
[0011] Optionally, according to the IoT device information, traversing all task nodes of the task queue starting from the head node of the task queue to determine whether there is a task matching the IoT device information specifically includes:
[0012] Point the head pointer to the head node in the task queue, and determine whether there is a task matching the IoT device information in the head node;
[0013] If it exists, the head pointer is pointed to the next sequential node of the head node in the task queue; the next sequential node is the next task node in the task queue whose sequence number is after the head node;
[0014] When a next task check request sent by the IoT device is received, all nodes of the task queue are traversed starting from the next task node to determine whether there is a task matching the IoT device.
[0015] Optionally, determining a target task node from the task queue specifically includes:
[0016] Obtain the task matching times of all task nodes in the task queue;
[0017] The task node with the largest number of task matches in the task queue is determined as the target task node; or the task node with the smallest number of task matches in the task queue is determined as the target task node.
[0018] Optionally, traversing all task nodes in the task queue from the target task node to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed, specifically includes:
[0019] Point the head pointer to the target task node, and determine whether the target task node has a task matching the IoT device information;
[0020] If it exists, point the head pointer to the next target node of the target task node;
[0021] When a next task check request sent by the IoT device is received, all nodes in the task queue are traversed starting from the next task node to determine whether there is a task matching the IoT device, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
[0022] Optionally, when the target task node is the task node with the largest number of task matches, the next target node is the next task node in the task queue that is arranged after the target task node in order of the number of task matches from most to least;
[0023] When the target task node is the task node with the least number of task matches, the next target node is the next task node in the task queue that is arranged after the target task node in order of the number of task matches from small to large.
[0024] Optionally, the method further comprises:
[0025] If a task matching the IoT device information exists at the current task node, the task is sent to the IoT device; the current task node is a head node or a target task node.
[0026] Optionally, after sending the task to the IoT device, the method further includes:
[0027] Increase the task matching count of the current task node by one.
[0028] In a second aspect, the present application provides a task inspection device, comprising:
[0029] An acquisition module is used to receive a current task check request sent by an IoT device and obtain IoT device information;
[0030] A traversal module, used to traverse all task nodes of the task queue starting from the head node of the task queue according to the IoT device information, and determine whether there is a task matching the IoT device information; the task queue includes a plurality of task nodes connected in a ring;
[0031] A determination module, configured to determine a target task node from the task queue if there is no task matching the IoT device information, wherein the target task node is a task node determined from the task queue according to a preset rule;
[0032] A matching module is used to traverse all task nodes in the task queue starting from the target task node to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
[0033] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any one of the task inspection methods described above.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the task inspection methods described above.
[0035] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0036] The present application provides a task inspection method, apparatus, device and medium, which receive a current task inspection request sent by an Internet of Things device, obtain the Internet of Things device information, and traverse all circularly connected task nodes in the task queue from the head node of the task queue according to the Internet of Things device information to determine whether there is a task matching the Internet of Things device information, and can traverse all task nodes in the task queue more comprehensively according to the Internet of Things device information; and when there is no task matching the Internet of Things device information, it can determine the target task node from the task queue according to the task inspection frequency, and each task request does not need to check all tasks in the task queue from the beginning in sequence, but only needs to traverse the task nodes in the task queue from the target task node to determine whether there is a task matching the Internet of Things device information, so that the order of task inspection can be dynamically adjusted, and the target task node is guaranteed to be prioritized for task inspection by traversing from the target task node until there is a task matching the Internet of Things device information or all task nodes in the task queue are traversed, so that the flexibility of task inspection is higher and the efficiency of task inspection is further improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 This is a structural diagram of an existing task inspection method in an embodiment of the present application;
[0039] Figure 2 This is an application environment diagram of a task inspection method in an embodiment of the present application;
[0040] Figure 3A flowchart of a task checking method provided in one embodiment of the present application;
[0041] Figure 4 A schematic diagram of the structure of a task queue provided in one embodiment of the present application;
[0042] Figure 5 A detailed flow chart of the steps of traversing all task nodes in a task queue starting from the head node of the task queue according to the IoT device information provided in one embodiment of the present application;
[0043] Figure 6 A flowchart of a method for traversing all task nodes in a task queue starting from a target task node is provided in another embodiment of the present application;
[0044] Figure 7 A schematic diagram of the structure of a task checking method provided in one embodiment of the present application;
[0045] Figure 8 A schematic diagram of functional modules of a task inspection device provided in one embodiment of the present application;
[0046] Fig. 9 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] As mentioned in the background technology, see Figure 1 As shown, in the related technology, the IoT platform manages each networked device, and each IoT device will report heartbeat information regularly. When the IoT platform receives a task execution request sent by an IoT device, it obtains the information of the IoT device, and checks one by one from the task list whether the current task needs to be sent to the IoT device. If so, the task is directly sent to the IoT device, and the task status of the IoT device is set to being executed, and other tasks in the task list are no longer checked; if not, other tasks in the task list are checked in turn until a task is matched to the IoT device or all tasks are checked. When all tasks are checked and no task is matched to the IoT device, heartbeat information is generated and sent to the IoT device. Among them, the task list includes task 1, task 2,..., task n.
[0049] However, in the above scheme, during the task execution process, each IoT device needs to check all tasks from the task list in turn, and the task checking order cannot be adjusted dynamically. If the previous tasks are always issued, the subsequent tasks will not be able to be checked and executed, resulting in reduced efficiency of task execution.
[0050] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0051] The task checking method provided in the embodiment of the present application can be applied to Figure 2 In the application environment shown. The application environment includes an Internet of Things platform and multiple Internet of Things devices, wherein the Internet of Things device 102 communicates with the Internet of Things platform 104 through a network. The data storage system can store data that the Internet of Things platform 104 needs to process. The data storage system can be set up separately, integrated on the Internet of Things platform 104, or placed on the cloud or other servers. The Internet of Things device 102 can send a task check request to the Internet of Things platform 104. After receiving the task check request, the Internet of Things platform 104 obtains the Internet of Things device information. The Internet of Things platform 104 determines whether there is a task matching the Internet of Things device information from the task queue based on the Internet of Things device information, until there is a task matching the Internet of Things device information or all task nodes in the task queue are traversed. The Internet of Things platform 104 can send the matched task to the Internet of Things device 102 for execution.
[0052] The IoT device 102 may be one or more, and the IoT device 102 may be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, IoT devices, and portable wearable devices. The IoT device may be a smart speaker, a smart TV, a smart air conditioner, a smart car device, etc. The portable wearable device may be a smart watch, a smart bracelet, a head-mounted device, etc. The IoT platform 104 may be implemented by an independent server or a server cluster consisting of multiple servers, or may be a cloud server.
[0053] In an exemplary embodiment, Figure 3 As shown, a task checking method is provided, which is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 2 The IoT platform 104 in the example is used as an example to illustrate, including the following steps 201 to 204. Among them:
[0054] Step 201: Receive a current task check request sent by an IoT device and obtain IoT device information.
[0055] It should be noted that the above-mentioned IoT platform can pre-store a mapping relationship between tasks and IoT devices, and each task can correspond to one or more IoT devices. For example, when there are multiple tasks, they are task 1, task 2 and task 3, and when there are multiple IoT devices, they are device 1, device 2, device 3 and device 4, then task 1 can correspond to device 1 and device 2, task 2 can correspond to device 2 and device 3, and task 3 can correspond to device 4.
[0056] Specifically, the above-mentioned IoT device can send a current task check request to the IoT platform, so that the IoT platform receives the current task check request sent by the IoT device and obtains the IoT device information, which may include the IoT device identifier, the IoT device IP address, etc.
[0057] In this step, when the current task check request sent by the IoT device is received and the IoT device information is obtained, it can be determined in a targeted manner whether there is a task that matches the IoT device information, thereby improving the accuracy of task inspection.
[0058] Step 202, based on the IoT device information, traverse all task nodes in the task queue starting from the head node of the task queue to determine whether there is a task matching the IoT device information; the task queue includes a plurality of task nodes connected in a ring.
[0059] Specifically, see Figure 4 As shown, Figure 4 A schematic diagram of the structure of a task queue provided in an embodiment of the present application, wherein the task queue includes a plurality of task nodes connected in a ring in sequence, each task node corresponds to a task, and the task may include a task type and a task execution subject, and the task execution subject may be an Internet of Things device. The task queue includes, for example, task node 1, task node 2, task node 3, and task node 4, and task node 1, task node 2, task node 3, and task node 4 are connected in sequence.
[0060] After obtaining the IoT device information, all task nodes in the task queue can be traversed from the head node of the task queue according to the IoT device information, that is, starting from task node 1 and judging whether the task corresponding to task node 1 matches the IoT device information. When the task corresponding to task node 1 matches the IoT device information, the task corresponding to task node 1 is sent to the IoT device; when the task corresponding to task node 1 does not match the IoT device information, it can be judged whether the task corresponding to task node 2 matches the IoT device information. When the task corresponding to task node 2 matches the IoT device information, the task corresponding to task node 2 is sent to the IoT device; when the task corresponding to task node 2 does not match the IoT device information, it can be judged whether the task corresponding to task node 3 matches the IoT device information, and so on, until the corresponding task is matched for the IoT device, or all task nodes in the task queue are traversed and no corresponding task is matched.
[0061] Step 203: If there is no task matching the IoT device information, a target task node is determined from the task queue, where the target task node is a task node determined from the task queue according to the task check frequency.
[0062] Specifically, when there is no task matching the IoT device information in the task queue, the target task node can be determined from the task queue based on the task check frequency. The task check frequency can, for example, include the number of task matches for a certain task node, and the rules can be customized according to actual needs.
[0063] Among them, the process of determining the target task node from the task queue specifically includes: obtaining the task matching times of all task nodes in the task queue, and determining the task node with the largest number of task matching times in the task queue as the target task node, or determining the task node with the smallest number of task matching times in the task queue as the target task node.
[0064] Exemplarily, when the task queue includes four task nodes, namely task node 1, task node 2, task node 3, and task node 4, the number of task matches corresponding to each task node is different. For example, the number of matches corresponding to task node 1 is 2, the number of matches corresponding to task node 2 is 5, the number of matches corresponding to task node 3 is 8, and the number of matches corresponding to task node 2 is 3. When the target task node is set to the node with the largest number of matches, the target task node is task node 3; when the target task node is set to the node with the least number of matches, the target task node is task node 1.
[0065] In this step, by determining the target task node from the task queue, the order of task inspection can be dynamically adjusted. By traversing the tasks in the task queue starting from the target task node, it is ensured that the target task node is prioritized for task inspection, thereby improving task inspection efficiency.
[0066] Step 204, starting from the target task node, traverse all task nodes in the task queue to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
[0067] Specifically, after determining the target task node, you can start from the target task node and determine whether the task corresponding to the target task node matches the IoT device information. When the task corresponding to the target task node matches the IoT device information, send the task corresponding to the target task node to the IoT device; when the task corresponding to the target task node does not match the IoT device information, you can determine the next target node, and determine whether the task corresponding to the next target node matches the IoT device information. When the task corresponding to the next target node matches the IoT device information, send the task corresponding to the next target node to the IoT device; when the task corresponding to the next target node does not match the IoT device information, you can continue to determine the next target node of the next target node, and determine whether the task corresponding to the next target node matches the IoT device information, and so on, until the corresponding task is matched for the IoT device, or all task nodes in the task queue are traversed and no corresponding task is matched.
[0068] The present application provides a task inspection method, which receives a current task inspection request sent by an Internet of Things device, obtains Internet of Things device information, and traverses all circularly connected task nodes in the task queue from the head node of the task queue according to the Internet of Things device information to determine whether there is a task matching the Internet of Things device information, and can traverse all task nodes in the task queue more comprehensively according to the Internet of Things device information; and when there is no task matching the Internet of Things device information, it can determine the target task node from the task queue according to the task inspection frequency, and each task request does not need to check all tasks in the task queue from the beginning in sequence, and only needs to traverse the task nodes of the task queue from the target task node to determine whether there is a task matching the Internet of Things device information, so that the order of task inspection can be dynamically adjusted, and by traversing from the target task node, it is ensured that the target task node is prioritized for task inspection until there is a task matching the Internet of Things device information or all task nodes in the task queue are traversed, and the inspection and issuance processes of each task are independent of each other, and the issuance of the previous task does not affect the inspection process of the subsequent task, so that the flexibility of task inspection is higher, and the efficiency of task inspection is further improved.
[0069] In another exemplary embodiment of the present application, in order to accurately traverse and check each task node in the task queue, all task nodes in the task queue can be traversed starting from the head node to determine whether there is a task matching the IoT information, such as Figure 5 As shown, the above step 202 is replaced by the following steps 301 to 303:
[0070] Step 301, point the head pointer to the head node in the task queue, and determine whether there is a task matching the IoT device information in the head node.
[0071] Step 302, when it exists, the head pointer is pointed to the next sequential node of the head node in the task queue; the next sequential node is the next task node in the task queue whose sequence number is after the head node.
[0072] Step 303, when receiving the next task check request sent by the IoT device, traverse all nodes in the task queue starting from the next task node to determine whether there is a task matching the IoT device.
[0073] It can be understood that nodes and pointers are interdependent. Nodes include data fields and pointer fields, and the pointer field contains a pointer pointing to the address of the next node. In computer science, nodes are the basic components of data structures. They consist of two parts: data fields and pointer fields. The data field is used to store data elements, that is, to store task information, and the pointer field contains a pointer that points to the address of the next task node.
[0074] Specifically, the task queue includes multiple task nodes and a head pointer. The head pointer can be pointed to the head node in the task queue first. The head node is the task node whose serial number is located at the head of the task queue. The head node can be, for example, task node 1 in the task queue. Then, it is determined whether there is a task matching the Internet of Things information in task node 1. If so, the task is sent to the Internet of Things device, and the head pointer is pointed to the next sequential node of task node 1 in the task queue. The next sequential node is, for example, task node 2. The head pointer can be pointed to task node 2 in the task queue.
[0075] When the IoT device needs to request to issue a task, it can send a task check request to the IoT platform again, so that the IoT platform receives the next task check request sent by the IoT device, and traverses all nodes in the task queue starting from task node 2 to determine whether the task corresponding to task node 2 matches the IoT device information. When a match is found, the head pointer is pointed to the next sequential node of task node 2 in the task queue. The next sequential node is, for example, task node 3. The head pointer can be pointed to task node 3 in the task queue to further determine whether the task corresponding to task node 3 matches the IoT device information to obtain a matching result, and so on, until the IoT device is matched with the corresponding task, or all task nodes in the task queue are traversed but no corresponding task is found.
[0076] In this embodiment, when a next task check request is received from an IoT device, all nodes in the task queue are traversed starting from the next task node to determine whether there is a task matching the IoT device. There is no need to traverse the task queue starting from the head node, and the nodes for task inspection can be dynamically adjusted according to the task matching situation, so that nodes with higher matching degrees can be checked and matched first, thereby improving the efficiency of node inspection.
[0077] In another exemplary embodiment of the present application, in order to improve the efficiency of node checking, all task nodes in the task queue can be traversed starting from the target task node, such as Figure 6 As shown, in the above step 204, the method may further include the following steps 401 to 403. Among them:
[0078] Step 401, point the head pointer to the target task node, and determine whether the target task node has a task that matches the IoT device information.
[0079] Step 402: if it exists, point the head pointer to the next target node of the target task node.
[0080] Step 403, when receiving the next task check request sent by the IoT device, traverse all nodes in the task queue starting from the next task node to determine whether there is a task matching the IoT device, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
[0081] Specifically, taking the target task node as the node with the most task matches as an example, when all tasks in the task queue do not match the IoT device information, the node with the most task matches in the task queue can be determined, and the head pointer can be pointed to the node with the most task matches. Then, it is determined whether the target task node has a task that matches the IoT device information. If so, the task corresponding to the target task node is sent to the IoT device, and the next target node of the target task node is determined, and the head pointer is pointed to the next target node of the target task node. The next target node is the next node after the target task node, which is arranged in descending order of the number of task matches. The next target node is, for example, task node 3.
[0082] When the IoT device needs to request to send a task, it can send a task check request to the IoT platform again, so that the IoT platform receives the next task check request sent by the IoT device, and traverses all nodes in the task queue starting from task node 3 to determine whether the task corresponding to task node 3 matches the IoT device information. When it matches, the head pointer is pointed to the next target node of task node 3 in the task queue. The next target node is, for example, task node 2. The head pointer can be pointed to task node 2 in the task queue to further determine whether the task corresponding to task node 2 matches the IoT device information to obtain a matching result, and so on, until the corresponding task is matched for the IoT device, or all task nodes in the task queue are traversed but no corresponding task is matched.
[0083] Among them, when the target task node is the task node with the largest number of task matches, the next target node is the next task node in the task queue that is arranged in order from most to least task matches; when the target task node is the task node with the smallest number of task matches, the next target node is the next task node in the task queue that is arranged in order from least to most task matches after the target task node.
[0084] For example, see Figure 7As shown, the task queue includes n circularly connected task nodes, n>1, respectively task node 1, task node 2, ..., task node n-1, task node n, and each task node corresponds to the number of task matching. For example, a certain IoT device includes five tasks and needs to send five requests to the IoT platform to match the tasks. The IoT device can send a request to the IoT platform for the first time, so that the IoT platform parses and processes the request, obtains the IoT device identification code, and then traverses the task queue from the head pointer. The head pointer can first point to task node 1 in the task queue to determine whether there is a task matching the IoT device identification code in task node 1. If there is, the task corresponding to task node 1 is sent to the IoT device, and the head pointer is pointed to task node 2. When the IoT device sends a request to the IoT platform for the second time, all tasks in the task queue can be traversed from task node 2; if there is no task, the task queue can be traversed from task node 2 in the task queue to determine whether there is a task matching the IoT device identification code in task node 2 until there is a task matching the IoT device identification code, or all task nodes in the task queue are traversed.
[0085] If all task nodes in the task queue do not match the IoT device identification code when the first task request is received, the head pointer can be moved to the task node with the highest number of matches, where the task matching times of task node 1 is 3, the task matching times of task node 2 is 5, the matching times of task node n-1 is 8, and the matching times of task node n is 2. The matching times of task node n-1 is the highest, and the head pointer is pointed to the task node n-1, and it is determined whether there is a task matching the IoT device identification code in task node n-1. If there is, the task is sent to the IoT device, and the next target node with a higher number of matches is determined. The next target node is task node 2, and the head pointer is pointed to task node 2. When the IoT device sends a request to the IoT platform for the second time, all tasks in the task queue can be traversed from task node 2; if there is no task, the traversal continues from task node 2 in the task queue to determine whether there is a task matching the IoT device identification code in task node 2, until there is a task matching the IoT device identification code, or all task nodes in the task queue are traversed.
[0086] In this embodiment, by setting up a circular task queue, the direction of the head pointer can be dynamically adjusted according to the number of task matches, so as to dynamically adjust the inspection order of the task nodes, so that the target task node in the task queue is given priority to perform task inspection, and then when no match is found, the subsequent task nodes in the task queue are continued to be checked, so that all task nodes are traversed, ensuring that all tasks are traversed and executed, which greatly improves the task inspection efficiency.
[0087] After sending the task to the IoT device, the method further includes: increasing the number of task matches of the current task node by one.
[0088] Specifically, for example, the number of matches of the current task node is 3. When determining that the current task node matches the IoT device information, the number of matches of the current task node can be increased by one, and the number of matches of the current task node is determined to be 4.
[0089] In this embodiment, the matching order of the task nodes can be dynamically adjusted according to the matching times of the task nodes, thereby further improving the matching efficiency.
[0090] The present application also provides an application scenario, which applies the above-mentioned task inspection method. Specifically: the task inspection method provided in this embodiment can be applied in the task distribution scenario. The Internet of Things device sends a task inspection request to the Internet of Things platform, so that the Internet of Things platform determines whether there is a task that matches the Internet of Things device information from the task queue. When it matches, it issues the corresponding task and enters the downstream task execution link. The task inspection method provided in this embodiment belongs to the inspection link before the task is issued. Based on the same inventive concept, the embodiment of the present application also provides a task inspection device for implementing the task inspection method involved above. The implementation solution for solving the problem provided by the device is similar to the implementation solution recorded in the above method, so the specific limitations in one or more task inspection device embodiments provided below can refer to the limitations on the task inspection method above, which will not be repeated here.
[0091] In an exemplary embodiment, Figure 8 As shown, a task inspection device is provided, comprising:
[0092] The acquisition module 610 is used to receive the current task check request sent by the IoT device and acquire the IoT device information;
[0093] The traversal module 620 is used to traverse all task nodes of the task queue starting from the head node of the task queue according to the IoT device information, and determine whether there is a task matching the IoT device information; the task queue includes a plurality of task nodes connected in a ring;
[0094] A determination module 630 is used to determine a target task node from the task queue if there is no task matching the IoT device information, where the target task node is a task node determined from the task queue according to a preset rule;
[0095] The matching module 640 is used to traverse all task nodes in the task queue starting from the target task node to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
[0096] As an optional implementation, the traversal module 620 is specifically used for:
[0097] Point the head pointer to the head node in the task queue to determine whether there is a task matching the IoT device information in the head node;
[0098] If it exists, the head pointer is pointed to the next sequential node of the head node in the task queue; the next sequential node is the next task node in the task queue whose sequence number is after the head node;
[0099] When a next task check request is received from an IoT device, all nodes in the task queue are traversed starting from the next task node to determine whether there is a task matching the IoT device.
[0100] As an optional implementation manner, the determination module 630 is specifically configured to:
[0101] Get the task matching count of all task nodes in the task queue;
[0102] The task node with the largest number of task matches in the task queue is determined as the target task node; or the task node with the smallest number of task matches in the task queue is determined as the target task node.
[0103] As an optional implementation, the matching module 640 is specifically used to:
[0104] Point the head pointer to the target task node and determine whether the target task node has a task that matches the IoT device information;
[0105] If it exists, point the head pointer to the next target node of the target task node;
[0106] When the next task check request sent by the IoT device is received, all nodes in the task queue are traversed starting from the next task node to determine whether there is a task matching the IoT device, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
[0107] As an optional implementation, when the target task node is the task node with the largest number of task matches, the next target node is the next task node in the task queue that is arranged in order of the largest number of task matches and the smallest number of task matches after the target task node;
[0108] When the target task node is the task node with the least number of task matches, the next target node is the next task node in the task queue that is arranged after the target task node in order of the number of task matches from least to most.
[0109] As an optional embodiment, the device is also used for:
[0110] If the current task node has a task that matches the IoT device information, the task is sent to the IoT device; the current task node is the head node or the target task node.
[0111] As an optional embodiment, the device is also used for:
[0112] Increase the task matching count of the current task node by one.
[0113] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store video tag processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a task inspection method is implemented.
[0114] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0115] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0116] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0117] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0118] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0119] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0120] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0121] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0122] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A task inspection method, characterized in that: The task checking method comprises: Receive the current task check request sent by the IoT device and obtain the IoT device information; According to the IoT device information, traverse all task nodes of the task queue starting from the head node of the task queue to determine whether there is a task matching the IoT device information; the task queue includes a plurality of task nodes connected in a ring; If there is no task matching the IoT device information, determining a target task node from the task queue, wherein the target task node is a task node determined from the task queue according to a task check frequency; Starting from the target task node, all task nodes in the task queue are traversed to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
2. The task inspection method according to claim 1, characterized in that: According to the IoT device information, traverse all task nodes of the task queue starting from the head node of the task queue to determine whether there is a task matching the IoT device information, specifically including: Point the head pointer to the head node in the task queue, and determine whether there is a task matching the IoT device information in the head node; If it exists, the head pointer is pointed to the next sequential node of the head node in the task queue; the next sequential node is the next task node in the task queue whose sequence number is after the head node; When a next task check request sent by the IoT device is received, all nodes of the task queue are traversed starting from the next task node to determine whether there is a task matching the IoT device.
3. The task inspection method according to claim 2, characterized in that: Determining a target task node from the task queue specifically includes: Obtain the task matching times of all task nodes in the task queue; The task node with the largest number of task matches in the task queue is determined as the target task node; or the task node with the smallest number of task matches in the task queue is determined as the target task node.
4. The task inspection method according to claim 3, characterized in that: Traversing all task nodes in the task queue from the target task node to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed, specifically including: Point the head pointer to the target task node, and determine whether the target task node has a task matching the IoT device information; If it exists, point the head pointer to the next target node of the target task node; When a next task check request sent by the IoT device is received, all nodes of the task queue are traversed starting from the next task node to determine whether there is a task matching the IoT device, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
5. The task inspection method according to claim 4, characterized in that: When the target task node is the task node with the largest number of task matches, the next target node is the next task node in the task queue that is arranged after the target task node in order of the number of task matches from most to least; When the target task node is the task node with the least number of task matches, the next target node is the next task node in the task queue that is arranged after the target task node in order of the number of task matches from small to large.
6. The task checking method according to claim 1, characterized in that: The method further comprises: If a task matching the IoT device information exists at the current task node, the task is sent to the IoT device; the current task node is the head node or the target task node.
7. The task checking method according to claim 6, characterized in that: After sending the task to the IoT device, the method further includes: The task matching count of the current task node is increased by one.
8. A task inspection device, characterized in that: The task inspection device comprises: An acquisition module is used to receive a current task check request sent by an IoT device and obtain IoT device information; A traversal module, used to traverse all task nodes of the task queue starting from the head node of the task queue according to the IoT device information, and determine whether there is a task matching the IoT device information; the task queue includes a plurality of task nodes connected in a ring; A determination module, configured to determine a target task node from the task queue if there is no task matching the IoT device information, wherein the target task node is a task node determined from the task queue according to a preset rule; A matching module is used to traverse all task nodes in the task queue starting from the target task node to determine whether there is a task matching the IoT device information, until there is a task matching the IoT device information or all task nodes in the task queue are traversed.
9. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the task inspection method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the task inspection method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data query method, query service device, client device and data system
CN106446080A
Program starting method and device, equipment and medium
CN112799822A
Scheduling method, system and equipment and storage medium
CN115481923A
Task scheduling method and device and electronic equipment
CN116244053A
Task processing method and system
CN118552101A