Task scheduling method and device of home host, electronic equipment and storage medium

Through protocol authentication and connection between home hosts, hosts can be scaled horizontally and tasks dynamically scheduled, solving the problems of limited resources and single point of failure of home hosts, and improving the system's disaster recovery capabilities and resource utilization rate.

CN120358107APending Publication Date: 2025-07-22GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510328149.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

The home host has limited computing resources and processing capabilities, making it difficult to cope with complex tasks and high concurrent requests, and a single point of failure leads to system unavailability.

Method used

By performing protocol authentication and connection when a second home host is detected in the home host network environment, the host is scaled horizontally, using multiple home hosts to share resources, dynamically schedule tasks, including the acquisition of resource usage information and task information, determine the target host for task allocation, and perform task migration and fallback in case of failure.

Benefits of technology

It effectively alleviates the pressure on home hosts, avoids single point of failure, improves the system's disaster recovery capabilities and resource utilization, and ensures the stable execution of tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120358107A_ABST
    Figure CN120358107A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a task scheduling method and device for a home host, electronic equipment and a storage medium, and the method comprises the steps: controlling a first home host and a second home host to carry out protocol authentication when the second home host is detected in a network environment of the first home host, the first home host and the second home host are slave hosts under the master host; when the protocol authentication is passed, controlling the first home host to be connected with the second home host; and performing task scheduling on a first task to be processed currently based on the first home host and the second home host. Through the embodiment of the invention, the host transverse expansion of the home hosts is realized, and the first home host and the second home host can enter the resource pool to allocate tasks, so that the pressure of the first home host is effectively relieved, a single-point fault is avoided, and the disaster recovery capability of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smart home, and particularly to a task scheduling method and device for a home host, an electronic device, and a storage medium. Background Art

[0002] With the popularization of smart home devices, as the core of the smart home system, the home host undertakes important functions such as device management, data processing, and issuing control instructions. However, the computing resources and processing capabilities of a single host are limited, making it difficult to handle complex tasks and high-concurrency requests. In addition, a single-point failure will also lead to the unavailability of the entire system. Summary of the Invention

[0003] In view of the above problems, a task scheduling method and device for a home host, an electronic device, and a storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:

[0004] A task scheduling method for a home host, which is applied to a main host, and the method includes:

[0005] When a second home host is detected in the network environment of the first home host, controlling the first home host to perform protocol authentication with the second home host, where the first home host and the second home host are slave hosts under the main host;

[0006] When the protocol authentication is passed, controlling the first home host to connect to the second home host;

[0007] Based on the first home host and the second home host, perform task scheduling on a first task to be currently processed.

[0008] Optionally, the performing task scheduling on the first task to be currently processed based on the first home host and the second home host includes:

[0009] Obtain the real-time resource usage information of the first home host and the second home host;

[0010] Obtain the first task information of the first task;

[0011] Based on the real-time resource usage information and the first task information, determine a target home host for processing the first task from the first home host and the second home host;

[0012] Allocate the first task to the target home host.

[0013] Optionally, determining a target home host for processing the first task from the first home host and the second home host based on the resource usage information and the first task information includes:

[0014] Determining a resource priority according to the first task information;

[0015] Sorting the first home host and the second home host according to the resource priority and the resource usage information;

[0016] Determining a target home host for processing the first task according to the sorting result, where the target home host is the home host whose resource usage situation is most adapted to the resource priority.

[0017] Optionally, the method further includes:

[0018] Obtaining the running states of the first home host and the second home host;

[0019] When the running state of the first home host is a normal state and the running state of the second home host is a fault state, determining second task information of a second task being processed in the second home host;

[0020] Migrating the second task information to the first home host so that the first home host processes the second task.

[0021] Optionally, the method further includes:

[0022] When it is detected that the running state of the second home host changes from a fault state to a normal state, obtaining the current resource state and task compatibility of the second home host;

[0023] If the resource state and the task compatibility meet a preset task fallback condition, then fallback some or all of the subtasks in the second task to the second home host for processing.

[0024] Optionally, the method further includes:

[0025] Obtaining the first resource usage situation of the first home host and / or the second home host within a preset time period;

[0026] When the first resource usage situation triggers a preset dynamic allocation policy, adjusting the task allocation of the first home host and / or the second home host according to the dynamic allocation policy.

[0027] Optionally, when the first resource usage situation triggers a preset dynamic allocation policy, adjusting the task allocation of the first home host and / or the second home host according to the dynamic allocation policy includes:

[0028] When the first resource usage is the CPU usage rate, when the first CPU usage rate in the first home host is greater than the first CPU threshold and the second CPU usage rate in the second home host is less than the second CPU threshold, it is determined to trigger a preset dynamic allocation policy;

[0029] When the third task is a task allocated to the first home host, in accordance with the dynamic allocation policy, the third task is allocated to the second home host.

[0030] Optionally, when the first resource usage triggers a preset dynamic allocation policy, adjusting the task allocation of the first home host and / or the second home host according to the dynamic allocation policy includes:

[0031] When the first resource usage is the memory usage rate, when the first memory usage rate in the first home host is greater than the first memory threshold and the second memory usage rate in the second home host is less than the second memory threshold, it is determined to trigger a preset dynamic allocation policy;

[0032] Determine a fourth task from the first home host according to the memory usage rate and real-time requirement of each task in the first home host;

[0033] In accordance with the dynamic allocation policy, migrate the fourth task to the second home host for processing.

[0034] Optionally, when the first resource usage triggers a preset dynamic allocation policy, adjusting the task allocation of the first home host and / or the second home host according to the dynamic allocation policy includes:

[0035] When the first resource usage is the network bandwidth occupancy rate, when the first network bandwidth occupancy rate in the first home host is greater than the first network bandwidth occupancy rate threshold and the second network bandwidth occupancy rate in the second home host is less than the second network bandwidth occupancy rate, it is determined to trigger a preset dynamic allocation policy;

[0036] Determine a fifth task from the first home host according to the network bandwidth occupancy rate of each task in the first home host;

[0037] In accordance with the dynamic allocation policy, migrate the fifth task to the second home host for processing.

[0038] Optionally, the method further includes:

[0039] Obtain a fifth task to be allocated. When the fifth task meets the preset task decomposition condition, decompose the fifth task into a first subtask and a second subtask;

[0040] Assign the first subtask to the first home host and assign the second subtask to the second home host.

[0041] A task scheduling device for a home host, applied to a main host, the device includes:

[0042] A new host detection module, configured to control the first home host and the second home host to perform protocol authentication when a second home host is detected in the network environment of the first home host, where the first home host and the second home host are slave hosts under the main host;

[0043] A host connection module, configured to control the first home host and the second home host to connect when the protocol authentication is passed;

[0044] A task scheduling module, configured to perform task scheduling on a first task to be processed currently based on the first home host and the second home host.

[0045] An electronic device includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the task scheduling method for a home host as described above is implemented.

[0046] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the task scheduling method for a home host as described in any one of claims 1 to 10 is implemented.

[0047] The embodiments of the present invention have the following advantages:

[0048] In the embodiments of the present invention, when it is detected that a second home host joins the network environment of the first home host, the first home host and the second home host can perform protocol authentication, and then connection is achieved, thereby realizing the horizontal expansion of home hosts. The first home host and the second home host can enter the resource pool to allocate tasks, effectively alleviating the pressure on the first home host, avoiding single-point failures, and improving the disaster tolerance of the system. Description of the Drawings

[0049] In order to more clearly illustrate the technical solutions of the present invention, the drawings required for the description of the present invention will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0050] Figure 1 It is a step flowchart of a task scheduling method for a home host provided by an embodiment of the present invention;

[0051] Figure 2 is a flowchart of steps of another task scheduling method for a home host provided by an embodiment of the present invention;

[0052] Figure 3 is a flowchart of steps of another task scheduling method for a home host provided by an embodiment of the present invention;

[0053] Figure 4 is a schematic structural diagram of a task scheduling device for a home host provided by an embodiment of the present invention. Detailed implementation manners

[0054] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation manners. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts shall fall within the protection scope of the present invention.

[0055] Referring to Figure 1 , which shows a flowchart of steps of a task scheduling method for a home host provided by an embodiment of the present invention, applied to a main host, and specifically may include the following steps:

[0056] Step 101, when a second home host is detected in the network environment of the first home host, control the first home host to perform protocol authentication with the second home host, where the first home host and the second home host are slave hosts under the main host;

[0057] In practical applications, the first home host and the main host have a master-slave relationship, that is, the first home host is a slave host under the main host, and both the first home host and the main host manage home appliances in the same network environment. Among them, the main host can also manage one or more slave home hosts subordinate to it, including resource scheduling and the like.

[0058] When a new second home host is detected in this network environment, the main host can control the first home host to perform protocol authentication with the second home host, so as to realize the connection between the first home host and the second home host, thereby horizontally expanding the home host.

[0059] Step 102, when the protocol authentication is passed, control the first home host to connect to the second home host;

[0060] When the protocol authentication is passed, the first home host and the second home host are connected. Furthermore, in this network environment, a home host group can be formed among the main host, the first home host, and the second home host. Moreover, this home host group can also support the horizontal expansion of the host. When the resources of a single home host are insufficient, more home hosts can be automatically accessed to meet the growing demand, having flexible scalability.

[0061] In practical applications, it can be determined whether to trigger the horizontal expansion of the host according to the resource usage of the first home host. When it is determined to trigger the horizontal expansion, step S101 is executed. In an example, when the resource usage indicates that the current task processing pressure of the first home host is high, the horizontal expansion can be triggered. Specifically, the resource usage can include but is not limited to any one or more of the CPU usage rate, memory occupancy rate, and network bandwidth occupancy rate. Thresholds for CPU, memory, and network bandwidth occupancy can be set. Then, when the CPU usage rate, memory occupancy rate, and network bandwidth occupancy rate are greater than the set thresholds, it can be determined that the current task processing pressure of the first home host is high, and the horizontal expansion of the host is triggered.

[0062] Step 103, perform task scheduling on the current first task to be processed based on the first home host and the second home host.

[0063] After the second home host joins the network environment and is connected to the first home host, at this time, the number of home hosts that can process tasks increases. To relieve the task processing pressure, task scheduling can be performed on the current first task to be processed. For example, the tasks in the first home host can be scheduled to the second home host for processing, or the newly assigned tasks can be scheduled to the second home host for processing.

[0064] In an embodiment of the present invention, step 103 can specifically include the following sub-steps:

[0065] Sub-step S11, obtain the real-time resource usage information of the first home host and the second home host;

[0066] Among them, the real-time resource usage information can include but is not limited to information such as the CPU usage rate, memory occupancy rate, and network bandwidth occupancy rate.

[0067] Sub-step S12, obtain the first task information of the first task;

[0068] Among them, the first task information can include the task ID, task requirements, etc.

[0069] Sub-step S13, determine the target home host for processing the first task from the first home host and the second home host based on the real-time resource usage information and the first task information;

[0070] After obtaining the resource usage information of each home host and the first task information, the target home host that is most suitable for processing the first task can be determined from multiple home hosts according to the adaptation situation between the two.

[0071] Sub-step S14, allocate the first task to the target home host.

[0072] In an embodiment of the present invention, determining the target home host for processing the first task from the first home host and the second home host based on the resource usage information and the first task information includes: determining the resource priority according to the first task information; sorting the first home host and the second home host according to the resource priority and the resource usage information; determining the target home host for processing the first task according to the sorting result, and the target home host is the home host whose resource usage situation is most adapted to the resource priority.

[0073] In practical applications, after obtaining the first task information, the characteristics of the first task can be analyzed to determine the demand priority of the first task for each resource, that is, the resource priority. For example, for a task with high CPU requirements, the CPU priority is high, and for a task with high bandwidth occupancy requirements, the bandwidth occupancy priority is high. Thus, the first home host and the second home host can be sorted according to the resource priority and the resource usage information, such as sorting according to the CPU or sorting according to the bandwidth. Furthermore, the target home host can be selected based on the sorting result, such as selecting the home host with the least CPU occupancy or the least bandwidth occupancy as the target home host.

[0074] In an embodiment of the present invention, the main host can perform intelligent allocation of indicators such as network load, CPU, memory, and hard disk through scheduling algorithms (such as load balancing algorithms, priority scheduling algorithms, least load scheduling, response time-based scheduling, based on the home host usage scenario, and weighted round-robin algorithms to achieve hybrid scheduling) to ensure the efficient use of resources.

[0075] In an embodiment of the present invention, the main host can obtain the fifth task to be allocated. When the fifth task meets the preset task decomposition condition, the fifth task is decomposed into a first sub-task and a second sub-task; the first sub-task is allocated to the first home host, and the second sub-task is allocated to the second home host.

[0076] In practical applications, for some complex tasks, the tasks can be decomposed before allocation, and the decomposed sub-tasks can be processed by different home hosts to improve the execution efficiency of the tasks.

[0077] Among them, the preset task decomposition condition can be set according to the actual scenario, such as setting the task decomposition condition according to the commonness of complex tasks.

[0078] In an embodiment of the present invention, a main host, a first home host, and a second home host constitute a smart home system. Among them, the main host is responsible for overall task allocation and resource management, and the slave hosts are connected to various smart devices (such as smart bulbs, smart cameras, smart air conditioners, etc.) and execute tasks. The system dynamically adjusts the task allocation strategy according to the real-time resource usage situation to achieve efficient utilization of resources.

[0079] For example, the smart home system includes a main host (Master) and multiple slave hosts (Slave1, Slave2, Slave3, etc.). In the initial operation stage of the system, a simple polling strategy is adopted for task allocation. That is, tasks are allocated in sequence according to the order of the slave hosts. For example, task 1 is allocated to Slave1, task 2 is allocated to Slave2, task 3 is allocated to Slave3, and then the cycle repeats.

[0080] By the above method of dynamically adjusting the allocation strategy, the smart home system can optimize task allocation according to the real-time resource usage situation, improve the overall performance and resource utilization rate of the system, and ensure that each slave host can operate stably and efficiently.

[0081] In an embodiment of the present invention, data sharing and consistency can also be achieved through a distributed file system and a database.

[0082] (I) Realization of data sharing

[0083] At the level of the distributed file system, data sharing can be specifically achieved in aspects such as data storage and access, data replication and redundancy, and unified namespace.

[0084] Data storage and access: The distributed file system (such as Ceph, GlusterFS, etc.) dispersedly stores data on multiple nodes. Taking the smart home system as an example, the data generated by each home host (such as the status information of smart devices, user operation records, etc.) can be uploaded to the distributed file system. Each home host is like a data generation source, writing its own data into the specified directory or bucket of the file system. Different hosts can access the stored data through the network to achieve preliminary data sharing. For example, the main host can read the energy consumption data of smart devices uploaded by each slave host from the distributed file system for overall energy management analysis.

[0085] Data replication and redundancy: To improve the availability and reliability of data, the distributed file system usually replicates data. The data will be replicated to multiple different storage nodes. When a certain node fails, the replicas on other nodes can continue to provide data services. In the smart home scenario, if a certain storage node has a hardware failure, the home host can still obtain the required data from other replica nodes to ensure the continuity of data sharing.

[0086] Unified Namespace: The distributed file system provides a unified namespace, enabling all participating hosts to access data using the same paths and file names. This is like a large virtual filing cabinet where each host knows how to find the files it needs. For example, all hosts can access the log data of smart devices through the / smart_home_data / device_logs path, facilitating data sharing and management.

[0087] At the database level, data sharing can be achieved specifically from perspectives such as data integration and storage, data synchronization mechanisms, distributed query, and transaction processing.

[0088] Data Integration and Storage: Databases (such as MySQL Cluster, MongoDB Replica Set, etc.) are used to store structured and semi-structured data. In a smart home system, the database can store device configuration information, user account information, and various rules and policies. Different home hosts can write relevant data into the database and read the required data from it. For example, the main host can store the smart device scheduling task information set by the user in the database, and each slave host can read this task information from the database to achieve task synchronization and sharing.

[0089] Data Synchronization Mechanism: Databases usually adopt synchronization mechanisms such as master-slave replication and multi-master replication to ensure data consistency between different nodes. In the master-slave replication mode, the master database receives write operations and synchronizes these operations to the slave databases. In a smart home scenario, if the main host updates a certain device configuration information in the database, this update operation will be synchronized to the slave databases connected to each slave host, thus ensuring that the data seen by all hosts is consistent.

[0090] Distributed Query and Transaction Processing: Databases support distributed query and transaction processing functions. Home hosts can obtain the required data from multiple database nodes by executing distributed query statements. For example, the main host can query the device status information in multiple slave databases simultaneously for comprehensive analysis. At the same time, the transaction processing mechanism of the database can ensure data consistency and integrity when multiple hosts operate on data. For example, when the main host and slave hosts modify the permission information of a certain device simultaneously, the transaction processing of the database can ensure that these operations either all succeed or all fail.

[0091] (2) Data Consistency Implementation:

[0092] At the distributed file system level, data consistency can be achieved through version control, metadata management, and consistency protocols.

[0093] Version control: Distributed file systems typically support version control functions. When data is modified, the system assigns a unique version number to each version of the data. In a smart home system, if a home host modifies the device configuration file stored in the distributed file system, the system generates a new version and retains the old version. Other hosts can select different versions as needed when accessing the data, ensuring data consistency and traceability.

[0094] Metadata management: The consistency of metadata (such as the creation time, modification time, storage location, etc. of a file) is crucial for data sharing. Distributed file systems manage and maintain the consistency of metadata through a metadata server. The metadata server records the detailed information of each file and updates this information in a timely manner when the file changes. In a smart home scenario, when a host uploads a new device data file, the metadata server updates information such as the storage location and creation time of the file to ensure that other hosts can access the latest data correctly.

[0095] Consistency protocols: Distributed file systems adopt consistency protocols (such as strong consistency protocols, weak consistency protocols, etc.) to ensure data consistency. Strong consistency protocols require that all nodes see consistent data at all times, while weak consistency protocols allow data to be inconsistent for a certain period of time but will eventually become consistent. In a smart home system, if high requirements are placed on data real-time performance and consistency, a strong consistency protocol can be selected; if the requirement for data real-time performance is not high, a weak consistency protocol can be selected to improve the performance and availability of the system.

[0096] At the database level, data consistency can be achieved through methods such as two-phase commit (2PC), multi-version concurrency control (MVCC), and heartbeat detection and failure recovery.

[0097] Two-phase commit (2PC): Two-phase commit is a commonly used distributed transaction consistency protocol. In a smart home system, when multiple home hosts need to modify data in the database, the database uses the two-phase commit protocol to ensure data consistency. First, the coordinator (usually the primary database node) sends a prepare request to all participants (slave database nodes), and the participants decide whether they can execute the transaction based on their own situation. If all participants agree, the coordinator sends a commit request and the participants execute the transaction; if any one participant disagrees, the coordinator sends a rollback request and the participants undo the operations that have been executed.

[0098] Multi-Version Concurrency Control (MVCC): MVCC is a technology used to improve the concurrency performance of a database while ensuring data consistency. In MVCC, the database assigns a timestamp to each data version, and different transactions can read different versions of data simultaneously without interfering with each other. In a smart home system, when multiple hosts perform read and write operations on the data in the database simultaneously, MVCC can ensure that each transaction sees consistent data and improve the system's concurrency processing ability.

[0099] Heartbeat Detection and Fault Recovery: The database system monitors the status of each node through a heartbeat detection mechanism. If a node fails, the system will detect it in a timely manner and perform fault recovery. In a smart home system, if a slave database node fails, the master database node will remove the node from the replication cluster and replicate the data it is responsible for to other normal nodes to ensure data consistency and availability.

[0100] (III) Achieving Data Sharing and Consistency by Combining Data Processing

[0101] Data Collection and Preprocessing: Each home host is responsible for collecting data generated by smart devices, such as temperature, humidity, device switch status, etc. The collected data will be preliminarily preprocessed locally, such as data cleaning, format conversion, etc. Then, the preprocessed data will be uploaded to a distributed file system or database for storage. In this process, through the unified namespace of the distributed file system and the synchronization mechanism of the database, it is ensured that the data can be correctly shared and stored.

[0102] Data Analysis and Mining: The master host or other hosts with data analysis capabilities can obtain the required data from the distributed file system and database for analysis and mining. For example, by analyzing the energy consumption data of smart devices, the peak periods of energy consumption and device usage patterns can be found. During the data analysis process, due to the distributed file system and database ensuring data consistency, the accuracy and reliability of the analysis results are guaranteed.

[0103] Decision Making and Execution: Based on the results of data analysis, the system can make corresponding decisions, such as adjusting the operating parameters of smart devices, sending notifications to users, etc. These decision-making messages will be stored in the database and synchronized to each home host through a data sharing mechanism. Each host controls the smart devices to perform corresponding operations according to the received decision-making messages, realizing the collaborative work of the entire smart home system and the consistent application of data.

[0104] Through the collaborative work of the distributed file system and database, and the effective application in each link of data processing, data sharing and consistency in the smart home system can be achieved, improving the reliability, availability, and intelligence level of the system.

[0105] In an embodiment of the present invention, the home host may include a cloud docking module, one or more control modules, a scheduling algorithm module, a distributed computing framework, a connection authentication module, and a resource monitoring module.

[0106] Among them, the cloud docking module is used to dock with the cloud, and can report the detected anomalies in the home host to the cloud. The control module is used to control the home appliances. The scheduling algorithm module can be used to implement the task allocation and scheduling of the home host; the distributed computing framework can be used to implement task decomposition and the processing of the decomposed subtasks on different home hosts; the connection authentication module is used to authenticate the home hosts detected in the same network, so as to achieve horizontal expansion. The resource monitoring module can be used to monitor the usage of various resources in the home host.

[0107] In an embodiment of the present invention, the main host can also regularly perform data backup and recovery tests on the first home host and the second home host to ensure that the system can be quickly restored in case of a failure. The multi-copy mechanism is adopted to ensure the high availability and consistency of the data.

[0108] According to the embodiment of the present invention, a scenario can be set: there are three home hosts, namely Master_Host (main host), Slave_Host_1, and Slave_Host_2 (slave hosts), which jointly build a smart home management system. Master_Host is responsible for overall resource scheduling and task allocation. Slave_Host_1 is connected to the smart devices in the living room (such as smart TVs, smart speakers), and Slave_Host_2 is connected to the smart devices in the bedroom (such as smart air conditioners, smart curtains). Each host is connected through the home WiFi network and communicates and authenticates according to a custom extended protocol.

[0109] Furthermore, the authentication connection process between the home gateways based on the set scenario is as follows:

[0110] (1) Network connection and protocol formulation

[0111] Network connection: Each home host is equipped with a module supporting WiFi connection. When the user uses it for the first time, through the mobile phone APP or the configuration interface of the host, they are connected to the home wireless router to ensure that they are in the same local area network environment.

[0112] Extended protocol: The development team has developed a set of extended protocols, which stipulate the communication format, authentication mechanism, and resource scheduling rules between the hosts. For example, the communication messages adopt the JSON format, the authentication uses a symmetric encryption algorithm (such as AES), and the resource scheduling is based on the load conditions of the hosts and the device priorities.

[0113] (2) Automatic Trigger of Protocol Authentication

[0114] New Slave Host Access: Slave_Host_2 is a newly added slave host to the system. After the user powers it on, according to the operation guide, the user configures the home WiFi network information for it using the mobile phone APP. After Slave_Host_2 successfully connects to the home WiFi, it automatically starts the device initialization process.

[0115] Authentication Trigger: Broadcasting Presence Information: Slave_Host_2 broadcasts its presence information to the home network according to the extended protocol. The broadcast message is sent in JSON format, and the content is as follows:

[0116] {"device_type":"slave_host","device_id":"SH2_123456","supported_protocol":"SmartHomeProtocol_v1.0","connected_devices":["Smart_AC_01","Smart_Curtain_01"]}

[0117] Master Host Receives and Triggers Authentication: Master_Host continuously listens for broadcast messages in the network. When it receives the broadcast from Slave_Host_2, it parses the message content to confirm that it is a new slave host requesting access. Master_Host then triggers the authentication process, generates and sends an authentication request message to Slave_Host_2. The message format is as follows:

[0118] {"message_type":"authentication_request","challenge":"56789abcdef","encryption_algorithm":"AES","key_length":128}

[0119] Among them, challenge is a randomly generated challenge string, and encryption_algorithm and key_length indicate the encryption algorithm and key length used in the authentication process.

[0120] Slave Host Responds to Authentication: After Slave_Host_2 receives the authentication request message, it encrypts the challenge string using the pre-stored symmetric key and the specified AES algorithm to generate a response value. Then it sends the response message back to Master_Host. The message format is as follows:

[0121] {"message_type":"authentication_response","response":"encrypted_value_generated_by_AES","device_id":"SH2_123456"}

[0122] Master-Host authentication: After receiving the response message from Slave-Host-2, Master-Host encrypts the previously sent challenge string using the same symmetric key and AES algorithm, and compares the result with the response value sent by Slave-Host-2. If they are the same, the authentication passes.

[0123] (3) Automatically connect and join the node pool

[0124] Connection establishment: After the authentication passes, Master-Host sends a connection confirmation message to Slave-Host-2, containing the parameters required for the connection (such as communication port, heartbeat interval, etc.). After receiving the confirmation message, Slave-Host-2 establishes a stable TCP connection with Master-Host. Joining the node pool: Master-Host adds the information of Slave-Host-2 (device ID, connection status, list of connected devices, etc.) to the node pool management database. At this time, Slave-Host-2 officially becomes a part of the smart home system and can participate in subsequent resource scheduling and task execution.

[0125] (4) Participate in task assignment and execution

[0126] Task initiation: The user issues an instruction through the mobile phone APP to turn off the smart air conditioner and smart curtains in the bedroom at 10 pm. After receiving the instruction, Master-Host parses the task requirements.

[0127] Task assignment: Based on the information in the node pool, Master-Host determines that Slave-Host-2 is connected to the smart air conditioner and smart curtains in the bedroom. Therefore, Master-Host generates a task assignment message and sends it to Slave-Host-2. The message format is as follows:

[0128] {"message_type":"task_assignment","task_id":"TASK_001","task_description":"Turn off Smart_AC_01and Smart_Curtain_01at 22:00","execution_time":"22:00"}

[0129] Task execution: After receiving the task assignment message, Slave_Host_2 stores the task information in the local task queue. When the execution time arrives (10:00 p.m.), Slave_Host_2 sends shutdown instructions to the smart air conditioner and the smart curtain respectively, and monitors the execution status of the devices. After completing the task, Slave_Host_2 sends a task completion report to Master_Host, and the message format is as follows:

[0130] {"message_type":"task_completion_report","task_id":"TASK_001","execution_status":"success","device_status":{"Smart_AC_01":"off","Smart_Curtain_01":"closed"}}

[0131] After receiving the task completion report, Master_Host updates the task status and feeds back the execution result to the user's mobile APP. Through the above example of the master-slave mode smart home system, it shows how multiple home hosts can automatically complete protocol authentication, connect and join the node pool in the same network environment, and participate in the task assignment and execution.

[0132] In the embodiment of the present invention, when it is detected that the second home host joins the network environment of the first home host, the first home host and the second home host can perform protocol authentication, and then establish a connection, thereby realizing the horizontal expansion of the home hosts. The first home host and the second home host can enter the resource pool to allocate tasks, effectively relieve the pressure on the first home host, avoid single point of failure, and improve the disaster tolerance of the system.

[0133] Referring to Figure 2 , it shows a flowchart of the steps of another task scheduling method for a home host provided by an embodiment of the present invention, which may specifically include the following steps:

[0134] Step S201, when the second home host is detected in the network environment of the first home host, control the first home host and the second home host to perform protocol authentication. The first home host and the second home host are slave hosts under the master host;

[0135] Step S202, when the protocol authentication is passed, control the first home host and the second home host to establish a connection;

[0136] Step S203, perform task scheduling on the current first task to be processed based on the first home host and the second home host.

[0137] Step S204, obtain the operating status of the first home host and the second home host;

[0138] Step S205, when the operating status of the first home host is normal and the operating status of the second home host is faulty, determine the second task information of the second task being processed in the second home host;

[0139] When the second home host is in a faulty state, it cannot process the tasks in the host. To ensure the continued execution of the tasks, the processing tasks can be migrated to ensure the normal execution of the tasks.

[0140] Step S206, migrate the second task information to the first home host so that the first home host processes the second task.

[0141] In an embodiment of the present invention, when it is detected that the operating status of the second home host changes from a faulty state to a normal state, obtain the current resource status and task compatibility of the second home host; if the resource status and task compatibility meet the preset task fallback conditions, then part or all of the subtasks in the second task are fallback to the second home host for processing.

[0142] In an embodiment of the present invention, the fault handling process of the home host may include the following stages:

[0143] (1) Fault detection stage:

[0144] Heartbeat mechanism: A heartbeat mechanism is established between the master host and each slave host. The slave host sends a heartbeat packet to the master host at regular time intervals (for example, every 5 seconds). The heartbeat packet contains the basic information of the slave host (such as device ID, current status, etc.).

[0145] The master host maintains a heartbeat time record table to record the time when each slave host last sent a heartbeat packet. When the master host does not receive a heartbeat packet from a certain slave host within a preset time threshold (for example, 15 seconds), it marks that the slave host may have a fault.

[0146] Status monitoring: The master host can also assist in determining whether a slave host is faulty by querying the status of the devices connected to the slave host. For example, the master host sends a status query instruction to the intelligent device connected to a certain slave host. If no response can be obtained after multiple attempts and the heartbeat of the slave host is also abnormal, then it can be further confirmed that the slave host has a fault.

[0147] (2) Task information collection stage:

[0148] Task list acquisition: Once the master host confirms that a slave host (assumed to be Slave_Host_X) has failed, it will immediately obtain the task list of the slave host that is currently being executed and to be executed from the task management database it maintains. The task list contains detailed information about the tasks, such as task ID, task type (such as controlling the switch of intelligent devices, timing operations, etc.), task execution progress, relevant device information, etc.

[0149] Data backup check: The master host checks the data storage situation involved in these tasks. If the task data is stored in a distributed file system or database, the master host needs to ensure that this data can be accessed by other hosts. For tasks that have processed part of the data, the master host needs to determine the consistency and integrity of the data so that other hosts can continue to process it subsequently.

[0150] (3) Available host evaluation phase:

[0151] Resource evaluation: The master host conducts a resource evaluation on other normally operating slave hosts in the node pool. The resource metrics for evaluation include CPU usage, memory usage, network bandwidth, remaining storage space, etc. For example, the master host can understand the resource usage situation of each slave host by regularly collecting its system information.

[0152] For each normal slave host, the master host calculates its available resource score. The calculation of the score can be weighted according to the importance of different resources. For example, CPU usage accounts for 40%, memory usage accounts for 30%, network bandwidth accounts for 20%, and remaining storage space accounts for 10%.

[0153] Compatibility evaluation: In addition to resource evaluation, the master host also needs to evaluate the compatibility of other slave hosts with the tasks on the failed host. For example, if the task on the failed host is to control a specific model of intelligent device, the master host needs to check whether other slave hosts are also connected to the same model of device or have the ability to execute this task.

[0154] (4) Task migration decision-making phase:

[0155] Task allocation algorithm: The master host selects a suitable task allocation algorithm based on the evaluation results of available hosts and the characteristics of the tasks. Common algorithms include round-robin algorithm, least load algorithm, performance-first algorithm, etc.

[0156] For example, when using the least load algorithm, the master host allocates the tasks on the failed host to the slave host with the highest resource score (i.e., the lightest load) and task compatibility. If there are multiple tasks, the master host can allocate them sequentially according to the task priority and resource requirements.

[0157] Migration strategy determination: The primary host determines the specific strategy for task migration. For some tasks that can be interrupted and resumed, the primary host can migrate the current execution status of the task and related data to the new host together; for some tasks that cannot be interrupted, the primary host may need to restart the task.

[0158] (5) Task migration execution phase

[0159] Data transfer: The primary host notifies the slave host (assumed to be Slave_Host_Y) selected to receive the task, and transfers the data required for the task on the failed host from the distributed file system or database to Slave_Host_Y. During the data transfer process, techniques such as checksum and data encryption can be used to ensure the integrity and consistency of the data.

[0160] Task startup: When the data transfer is completed, the primary host sends a task startup instruction to Slave_Host_Y. Slave_Host_Y starts to execute the task according to the execution status of the task (if it is an interruptible task) or re-initializes the task (if it is a non-interruptible task).

[0161] Status update: During the task execution process, Slave_Host_Y periodically feeds back the execution status of the task to the primary host. The primary host updates the task information in the task management database, updates the execution host of the task from the failed host to the new host, and records the migration time of the task and the new execution progress.

[0162] (6) Fault recovery and rollback mechanism

[0163] Repair of the failed host: When the failed host Slave_Host_X is repaired, it sends a notice of returning to normal to the primary host. The primary host re-evaluates Slave_Host_X and checks its resource status and task compatibility.

[0164] Task rollback: If the failed host has better resource conditions or better compatibility for some tasks after repair, the primary host can consider rolling back some tasks from Slave_Host_Y to Slave_Host_X for continued execution. The rollback process is similar to the task migration process and requires operations such as data transfer and task status synchronization.

[0165] Through the above steps, when a certain host fails, the task can be automatically migrated to other hosts for continued execution, ensuring the stable operation of the smart home system and the successful completion of the task.

[0166] In the embodiment of the present invention, the task of the second home host can be migrated to the first home host in the state of the failure of the second home host, avoiding single point of failure and improving the reliability and availability of the system.

[0167] Reference Figure 3 , which shows a flowchart of steps of another task scheduling method for a home host provided by an embodiment of the present invention. Specifically, it may include the following steps:

[0168] Step S301, when a second home host is detected in the network environment of the first home host, control the first home host to perform protocol authentication with the second home host. The first home host and the second home host are slave hosts under the master host;

[0169] Step S302, when the protocol authentication is passed, control the first home host to connect with the second home host;

[0170] Step S303, perform task scheduling on the first task to be processed currently based on the first home host and the second home host.

[0171] Step S304, obtain the first resource usage of the first home host and / or the second home host within a preset time period;

[0172] Among them, the first resource usage may include any one or more of CPU usage rate, memory usage rate, and network bandwidth occupancy rate.

[0173] Step S305, when the first resource usage triggers a preset dynamic allocation policy, adjust the task allocation of the first home host and / or the second home host according to the dynamic allocation policy.

[0174] In an embodiment of the present invention, when the first resource usage is the CPU usage rate, when the first CPU usage rate in the first home host is greater than the first CPU threshold and the second CPU usage rate of the second home host is less than the second CPU threshold, it is determined that the preset dynamic allocation policy is triggered; when the third task is a task allocated to the first home host, according to the dynamic allocation policy, the third task is allocated to the second home host.

[0175] In another embodiment of the present invention, when the first resource usage is the memory usage rate, when the first memory usage rate in the first home host is greater than the first memory threshold and the second memory usage rate of the second home host is less than the second memory threshold, it is determined that the preset dynamic allocation policy is triggered; determine the fourth task from the first home host according to the memory usage rate and real-time requirement of each task in the first home host; according to the dynamic allocation policy, migrate the fourth task to the second home host for processing.

[0176] In another embodiment of the present invention, when the first resource usage is the network bandwidth occupancy rate, when the first network bandwidth occupancy rate in the first home host is greater than the first network bandwidth occupancy rate threshold and the second network bandwidth occupancy rate of the second home host is less than the second network bandwidth occupancy rate, it is determined to trigger a preset dynamic allocation strategy; the fifth task is determined from the first home host according to the network bandwidth occupancy rate of each task in the first home host; according to the dynamic allocation strategy, the fifth task is migrated to the second home host for processing.

[0177] In the embodiment of the present invention, the master host has a real-time resource monitoring function, that is, the master host continuously monitors the real-time resource usage of each slave host, including CPU usage rate, memory usage rate, network bandwidth occupancy rate, and remaining storage space, etc. The monitoring data is collected and updated at regular time intervals (such as every 5 minutes).

[0178] In practical applications, the triggering conditions for dynamically adjusting the allocation strategy can be any one of the following:

[0179] Excessive CPU usage rate: When the CPU usage rate of a certain slave host exceeds 80% for three consecutive monitoring cycles, it indicates that the processing capacity of this host is approaching the limit and the task allocation needs to be adjusted.

[0180] Insufficient memory: If the memory usage rate of a certain slave host continuously exceeds 90%, it may affect the normal execution of tasks and trigger a strategy adjustment.

[0181] Network congestion: When the network bandwidth occupancy rate of a certain slave host exceeds 90% for a long time, resulting in serious data transmission delays, it is also necessary to optimize the task allocation.

[0182] Based on the above description of the dynamic adjustment process, the following is an exemplary illustration of the dynamic adjustment:

[0183] Example 1: Adjustment for excessive CPU usage rate.

[0184] Problem detected: The master host discovers that the CPU usage rate of Slave1 has exceeded 80% for three consecutive cycles, while the CPU usage rates of Slave2 and Slave3 are 30% and 20% respectively.

[0185] Adjustment strategy: The master host reallocates the next task originally planned for Slave1 (such as a task for analyzing a large amount of intelligent camera video data) to Slave3 with a lower CPU usage rate. At the same time, the master host reduces the priority of subsequent tasks for Slave1 and preferentially allocates new tasks to other slave hosts with sufficient resources.

[0186] Effect evaluation: After adjustment, the CPU usage rate of Slave1 gradually decreases and stabilizes at about 60%. Although Slave3 undertakes new tasks, due to its sufficient resources, it can complete the tasks smoothly, and the task processing efficiency of the overall system is improved.

[0187] Example 2: Memory shortage adjustment.

[0188] Problem detected: The master host detects that the memory usage rate of Slave2 continuously exceeds 90%, while the memory usage rates of Slave1 and Slave3 are 40% and 35% respectively.

[0189] Adjustment strategy: The master host migrates some tasks that occupy a large amount of memory but have low real-time requirements on Slave2 (such as the historical data backup task of intelligent devices) to Slave3 with sufficient memory to execute. At the same time, for new memory-intensive tasks, they are preferentially allocated to slave hosts with lower memory usage rates.

[0190] Effect evaluation: The memory usage rate of Slave2 drops to about 70%, and the stability of the system is enhanced, avoiding task crashes or freezes caused by memory shortages.

[0191] Example 3: Network congestion adjustment.

[0192] Problem detected: The master host finds that the network bandwidth occupancy rate of Slave3 has exceeded 90% for a long time, resulting in serious data transmission delays between it and intelligent devices and affecting the task execution efficiency. The network bandwidth occupancy rates of Slave1 and Slave2 are 20% and 25% respectively.

[0193] Adjustment strategy: The master host migrates some tasks that require a large amount of network bandwidth on Slave3 (such as high-definition video stream transmission tasks) to Slave1 with sufficient network bandwidth. At the same time, for new network-intensive tasks, they are preferentially allocated to slave hosts with good network conditions.

[0194] Effect evaluation: The network bandwidth occupancy rate of Slave3 drops to about 60%, the data transmission delay is significantly reduced, and the task execution efficiency is significantly improved.

[0195] In the embodiment of the present invention, the master host continuously optimizes the dynamic allocation strategy according to the effects after each adjustment. For example, analyze the resource demand characteristics of different types of tasks, establish a task resource demand model to allocate tasks more accurately. At the same time, adjust the weights of resource evaluation indicators according to the hardware configuration and performance of slave hosts to make task allocation more reasonable and efficient.

[0196] In an embodiment of the present invention, by monitoring the resource usage of slave home hosts, the first home host and the second home host can be dynamically adjusted according to the resource usage. Through intelligent resource scheduling, the computing resources of each host can be efficiently utilized, improving the overall performance of the system.

[0197] It should be noted that for method embodiments, for simplicity of description, they are expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.

[0198] Referring to Figure 4 , a schematic structural diagram of a task scheduling device for a home host provided by an embodiment of the present invention is shown, which may specifically include the following modules:

[0199] A new host detection module 401, configured to control the first home host and the second home host to perform protocol authentication when the second home host is detected in the network environment of the first home host, where the first home host and the second home host are slave hosts under the master host;

[0200] A host connection module 402, configured to control the first home host and the second home host to connect when the protocol authentication is passed;

[0201] A task scheduling module 403, configured to perform task scheduling on a first task to be processed currently based on the first home host and the second home host.

[0202] In an embodiment of the present invention, the task scheduling module 403 may include:

[0203] A real-time resource usage information acquisition sub-module, configured to acquire the real-time resource usage information of the first home host and the second home host;

[0204] A first task information acquisition sub-module, configured to acquire first task information of the first task;

[0205] A target home host determination sub-module, configured to determine a target home host for processing the first task from the first home host and the second home host based on the real-time resource usage information and the first task information;

[0206] A first task allocation sub-module, configured to allocate the first task to the target home host.

[0207] In an embodiment of the present invention, the target home host determination sub-module may include the following units:

[0208] A resource priority determination unit, configured to determine a resource priority according to the first task information;

[0209] A host sorting unit, configured to sort the first home host and the second home host according to the resource priority and the resource usage information;

[0210] A home host determination unit, configured to determine a target home host for processing the first task according to the sorting result, where the target home host is the home host whose resource usage situation is most adapted to the resource priority.

[0211] In an embodiment of the present invention, the apparatus further includes:

[0212] An operating state acquisition module, configured to acquire the operating states of the first home host and the second home host;

[0213] A second task information determination module, configured to determine second task information of a second task being processed in the second home host when the operating state of the first home host is a normal state and the operating state of the second home host is a fault state;

[0214] A second task migration module, configured to migrate the second task information to the first home host so that the first home host processes the second task.

[0215] In an embodiment of the present invention, the apparatus further includes:

[0216] A resource and compatibility monitoring module, configured to acquire the current resource state and task compatibility of the second home host when it is detected that the operating state of the second home host changes from a fault state to a normal state;

[0217] A task fallback processing module, configured to fallback some or all of the subtasks in the second task to the second home host for processing if the resource state and the task compatibility meet a preset task fallback condition.

[0218] In an embodiment of the present invention, the apparatus may further include:

[0219] A resource usage situation acquisition module, configured to acquire the first resource usage situation of the first home host and / or the second home host within a preset time period;

[0220] A dynamic allocation module, configured to adjust the task allocation of the first home host and / or the second home host according to the dynamic allocation policy when the first resource usage situation triggers a preset dynamic allocation policy.

[0221] In an embodiment of the present invention, the dynamic allocation module may include:

[0222] A first dynamic allocation policy determination sub-module, configured to determine to trigger a preset dynamic allocation policy when the first resource usage is the CPU usage rate, the first CPU usage rate in the first home host is greater than the first CPU threshold, and the second CPU usage rate in the second home host is less than the second CPU threshold;

[0223] A third task allocation sub-module, configured to, when the third task is a task to be allocated to the first home host, allocate the third task to the second home host according to the dynamic allocation policy.

[0224] In an embodiment of the present invention, the dynamic allocation module may include:

[0225] A second dynamic allocation policy determination sub-module, configured to determine to trigger a preset dynamic allocation policy when the first resource usage is the memory usage rate, the first memory usage rate in the first home host is greater than the first memory threshold, and the second memory usage rate in the second home host is less than the second memory threshold;

[0226] A fourth task determination sub-module, configured to determine a fourth task from the first home host according to the memory usage rate and real-time requirement of each task in the first home host;

[0227] A fourth task migration sub-module, configured to migrate the fourth task to the second home host for processing according to the dynamic allocation policy.

[0228] In an embodiment of the present invention, the dynamic allocation module may include:

[0229] A third dynamic allocation policy determination sub-module, configured to determine to trigger a preset dynamic allocation policy when the first resource usage is the network bandwidth occupancy rate, the first network bandwidth occupancy rate in the first home host is greater than the first network bandwidth occupancy rate threshold, and the second network bandwidth occupancy rate in the second home host is less than the second network bandwidth occupancy rate;

[0230] A fifth task determination sub-module, configured to determine a fifth task from the first home host according to the network bandwidth occupancy rate of each task in the first home host;

[0231] A second task migration sub-module, configured to migrate the fifth task to the second home host for processing according to the dynamic allocation policy.

[0232] In an embodiment of the present invention, the device further includes:

[0233] A task decomposition module, configured to obtain a fifth task to be allocated, and when the fifth task meets a preset task decomposition condition, decompose the fifth task into a first subtask and a second subtask;

[0234] A subtask allocation module, configured to allocate the first subtask to the first home host and allocate the second subtask to the second home host.

[0235] In an embodiment of the present invention, when it is detected that a second home host joins the network environment of a first home host, the first home host and the second home host can perform protocol authentication and then establish a connection, thereby realizing horizontal expansion of home hosts. The first home host and the second home host can enter the resource pool to allocate tasks, effectively alleviating the pressure on the first home host, avoiding single point of failure, and improving the disaster tolerance of the system.

[0236] An embodiment of the present invention further provides an electronic device, which may include a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the task scheduling method of the home host as described above is implemented.

[0237] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the task scheduling method of the home host as described above is implemented.

[0238] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the partial description of the method embodiment.

[0239] Each embodiment in this specification is described in a progressive manner. Each embodiment focuses on the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other.

[0240] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0241] Embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing terminal device generate a device for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0242] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device that implements the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0243] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, such that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one flow Figure 1 one flow or multiple flows and / or blocks Figure 1 or multiple blocks.

[0244] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0245] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.

[0246] The above has introduced in detail the task scheduling method and device, electronic device, and storage medium of the provided home host. Specific examples are used in this text to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A task scheduling method for a home host, characterized in that, Applied to the main host, the method includes: When a second home host is detected in the network environment of the first home host, control the first home host to perform protocol authentication with the second home host, where the first home host and the second home host are slave hosts under the main host; When the protocol authentication is passed, control the first home host to connect to the second home host; Based on the first home host and the second home host, perform task scheduling for the first task to be processed currently.

2. The method according to claim 1, wherein The performing task scheduling for the first task to be processed currently based on the first home host and the second home host includes: obtaining the real-time resource usage information of the first home host and the second home host; obtaining the first task information of the first task; Based on the real-time resource usage information and the first task information, determine a target home host for processing the first task from the first home host and the second home host; allocate the first task to the target home host.

3. The method according to claim 2, wherein The determining a target home host for processing the first task from the first home host and the second home host based on the resource usage information and the first task information includes: Determine the resource priority according to the first task information; Sort the first home host and the second home host according to the resource priority and the resource usage information; Determine a target home host for processing the first task according to the sorting result, where the target home host is the home host whose resource usage situation is most adapted to the resource priority.

4. The method according to claim 1, wherein The method further includes: obtaining the running states of the first home host and the second home host; when the running state of the first home host is a normal state and the running state of the second home host is a fault state, determine the second task information of the second task being processed in the second home host; Migrate the second task information to the first home host so that the first home host processes the second task.

5. The method according to claim 4, wherein The method further includes: when it is detected that the running state of the second home host changes from a fault state to a normal state, obtain the current resource state and task compatibility of the second home host; If the resource state and the task compatibility meet the preset task fallback condition, then fallback some or all of the subtasks in the second task to the second home host for processing.

6. The method according to claim 1, wherein The method further includes: obtaining the first resource usage situation of the first home host and / or the second home host within a preset time period; When the first resource usage situation triggers a preset dynamic allocation policy, adjust the task allocation of the first home host and / or the second home host according to the dynamic allocation policy.

7. The method according to claim 6, wherein When the first resource usage situation triggers a preset dynamic allocation policy, adjusting the task allocation of the first home host and / or the second home host according to the dynamic allocation policy includes: When the first resource usage is the CPU usage rate, when the first CPU usage rate in the first home host is greater than the first CPU threshold and the second CPU usage rate in the second home host is less than the second CPU threshold, it is determined to trigger a preset dynamic allocation policy; When the third task is a task allocated to the first home host, in accordance with the dynamic allocation policy, the third task is allocated to the second home host.

8. The method according to claim 6, wherein When the first resource usage triggers a preset dynamic allocation policy, adjusting the task allocation of the first home host and / or the second home host according to the dynamic allocation policy, including: When the first resource usage is the memory usage rate, when the first memory usage rate in the first home host is greater than the first memory threshold and the second memory usage rate in the second home host is less than the second memory threshold, it is determined to trigger a preset dynamic allocation policy; Determine the fourth task from the first home host according to the memory usage rate and real-time requirements of each task in the first home host; In accordance with the dynamic allocation policy, migrate the fourth task to the second home host for processing.

9. The method according to claim 6, characterized in that, When the first resource usage triggers a preset dynamic allocation policy, adjusting the task allocation of the first home host and / or the second home host according to the dynamic allocation policy, including: When the first resource usage is the network bandwidth occupancy rate, when the first network bandwidth occupancy rate in the first home host is greater than the first network bandwidth occupancy rate threshold and the second network bandwidth occupancy rate in the second home host is less than the second network bandwidth occupancy rate, it is determined to trigger a preset dynamic allocation policy; Determine the fifth task from the first home host according to the network bandwidth occupancy rate of each task in the first home host; In accordance with the dynamic allocation policy, migrate the fifth task to the second home host for processing.

10. The method according to claim 1, wherein The method further includes: obtaining a to-be-allocated fifth task, and when the fifth task meets a preset task decomposition condition, decomposing the fifth task into a first subtask and a second subtask; Allocate the first subtask to the first home host and allocate the second subtask to the second home host.

11. A task scheduling device for a home host, characterized in that, Applied to a main host, the device includes: A new host detection module, configured to control the first home host and the second home host to perform protocol authentication when a second home host is detected in the network environment of the first home host, and the first home host and the second home host are slave hosts under the main host; A host connection module, configured to control the first home host and the second home host to be connected when the protocol authentication is passed; A task scheduling module, configured to perform task scheduling on a first task to be processed currently based on the first home host and the second home host.

12. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the task scheduling method of the home host according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, it implements the task scheduling method of the home host according to any one of claims 1 to 10.