Dynamic clustering and role adjustment networking method, device, equipment, medium and product
By building an information model and dynamically adjusting the device role, the load imbalance caused by changes in device status and location in the Internet of Things environment is solved, and resource allocation efficiency and system response speed are improved.
Patent Information
- Application Number
- CN202411637400.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-03-21
AI Technical Summary
Traditional static clustering methods cannot adapt to real-time changes in device status and location in the IoT environment, resulting in load imbalance and inefficient resource allocation.
By obtaining the device information of multiple terminal devices, clustering processing is carried out based on the position matrix, and device roles are determined according to the state matrix, and device roles are dynamically adjusted.
It realizes the accuracy and timeliness of the system, optimizes resource configuration and fault warning capabilities, improves the overall operating efficiency of the system, enhances the collaborative working ability between equipment, reduces communication overhead, and improves the system's adaptability and response speed.
Smart Images

Figure CN119676794A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment, medium and product for dynamic clustering and role adjustment networking. Background Art
[0002] In the IoT environment, there are a large number of devices and they are widely distributed. The dynamic changes in their status and location are crucial to network performance and stability. Traditional static clustering methods cannot adapt to real-time changes in device status and location due to their inherent fixed structure and lack of flexibility. These changes may be caused by environmental factors, device mobility, task dynamics, device failure and maintenance, and network scalability. For example, changes in device location may cause communication paths to become longer, increase communication delays and energy consumption; device failure or maintenance may cause changes in network topology. Static clustering methods cannot allocate tasks according to the actual needs and capabilities of devices, resulting in load imbalance and poor adaptability, especially when there are many devices, and inefficient resource allocation. Summary of the invention
[0003] The main purpose of the present application is to provide a dynamic clustering and role adjustment networking method, device, equipment, medium and product, aiming to solve the technical problem of low efficiency of resource allocation among multiple devices.
[0004] To achieve the above objectives, the present application proposes a dynamic clustering and role adjustment networking method, including:
[0005] Acquire device information of multiple terminal devices, and construct an information model based on the device information of the multiple terminal devices, wherein the device information includes hardware characteristics, location information, and status information of the terminal devices, and the information model includes a location matrix and a status matrix;
[0006] Based on the position matrix, multiple terminal devices are clustered to obtain at least one cluster, and the device role of each terminal device in each cluster is determined according to the state matrix, wherein the device role includes a core device and an auxiliary device, and the auxiliary device in each cluster is used to assist the core device in the cluster to perform task processing;
[0007] If an update of the information model is detected, the device role of each terminal device in the cluster is dynamically adjusted according to the updated information model, wherein the update conditions of the information model include updates to any of the device status parameters, load status, location matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster.
[0008] In one embodiment, the step of determining the device role of each terminal device in each cluster according to the state matrix includes:
[0009] For any cluster, real-time detection is performed to determine whether the device status parameters of the core devices in the cluster are updated. The device status parameters include CPU load value, network delay value, and remaining power value.
[0010] If the device state parameter of the core device is updated, then detect whether the updated device state parameter of the core device meets the preset first adjustment strategy condition, wherein the first adjustment strategy condition includes that the CPU load value of the core device is greater than the preset CPU load threshold, or the network delay value of the core device is greater than the preset network delay threshold, or the remaining power value of the core device is less than the preset power threshold. If the preset first adjustment strategy condition is met, update the state matrix according to the updated device state parameter of the core device;
[0011] The steps of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model include:
[0012] The core device in the cluster is downgraded to an auxiliary device according to the updated state matrix, and an auxiliary device is selected from all the auxiliary devices in the cluster to be upgraded to a core device.
[0013] In one embodiment, the step of determining the device role of each terminal device in each cluster according to the state matrix includes:
[0014] For any cluster, the load status of all terminal devices in the cluster is detected in real time, wherein the load status includes a first load status of a core device and a second load status of an auxiliary device;
[0015] If it is detected that the first load state is a load imbalance state, or the second load state is a load imbalance state, updating the state matrix according to the load imbalance state;
[0016] The steps of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model include:
[0017] The core devices and auxiliary devices are load-balanced according to the updated state matrix, and the device roles of each terminal device in the cluster are dynamically adjusted.
[0018] In one embodiment, if it is detected that the information model is updated, the step of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model includes:
[0019] If it is detected that the position matrix in the information model is updated, and there is a terminal device in each terminal device whose position update value exceeds a preset distance threshold, the multiple terminal devices are clustered based on the information model according to the latest position matrix execution step, wherein the position update value is the displacement value of the terminal device when the position is updated.
[0020] In one embodiment, the environmental change parameter includes a change in the number of terminal devices in the cluster, and the step of determining the device role of each terminal device in each cluster according to the state matrix includes:
[0021] For any cluster, if it is detected that the number of terminal devices in the cluster is updated, the state matrix is updated according to the updated terminal devices in the cluster;
[0022] The steps of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model include:
[0023] The device roles of the core devices and auxiliary devices in the cluster are readjusted according to the updated state matrix to redefine new core devices and new auxiliary devices in the cluster.
[0024] In one embodiment, the steps of clustering a plurality of terminal devices based on a position matrix to obtain at least one cluster, and determining a device role of each terminal device in each cluster according to a state matrix include:
[0025] Based on the position matrix, terminal devices whose spatial positions are smaller than a preset cluster radius are grouped into the same cluster according to a preset clustering algorithm to obtain at least one cluster;
[0026] For each cluster, the load score of each terminal device in the cluster is determined according to the state matrix, the device role of the terminal device with the smallest load score is determined as the core device, and the device roles of other terminal devices in the cluster except the core device are determined as auxiliary devices.
[0027] In addition, to achieve the above purpose, the present application also proposes a dynamic clustering and role adjustment networking device, the dynamic clustering and role adjustment networking device comprising:
[0028] A data acquisition module is used to acquire device information of multiple terminal devices, and to construct an information model based on the device information of the multiple terminal devices, wherein the device information includes hardware characteristics, location information, and status information of the terminal devices, and the information model includes a location matrix and a status matrix;
[0029] The device clustering module performs clustering processing on multiple terminal devices based on the position matrix to obtain at least one cluster, and determines the device role of each terminal device in each cluster according to the state matrix, wherein the device role includes a core device and an auxiliary device, and the auxiliary device in each cluster is used to assist the core device in the cluster to perform task processing;
[0030] The dynamic adjustment module dynamically adjusts the device role of each terminal device in the cluster according to the updated information model if it detects that the information model has been updated, wherein the update conditions of the information model include any update of the device status parameters, load status, position matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a dynamic clustering and role adjustment networking device, the device including: a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the dynamic clustering and role adjustment networking method as described above.
[0032] In addition, to achieve the above purpose, the present application also proposes a medium, which is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the dynamic clustering and role adjustment networking method as described above are implemented.
[0033] In addition, to achieve the above-mentioned purpose, the present application also provides a product, which is a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, the steps of the dynamic clustering and role adjustment networking method as described above are implemented.
[0034] One or more technical solutions proposed in this application have at least the following technical effects:
[0035] The present application obtains device information of multiple terminal devices and constructs an information model based on the device information of multiple terminal devices, wherein the device information includes hardware characteristics, location information, and state information of the terminal devices, and the information model includes a location matrix and a state matrix, thereby ensuring the accuracy and timeliness of the system and optimizing resource allocation and fault warning capabilities; clustering multiple terminal devices based on the location matrix to obtain at least one cluster, and determining the device role of each terminal device in each cluster based on the state matrix, wherein the device role includes a core device and an auxiliary device, and the auxiliary device in each cluster is used to assist the core device in the cluster to perform task processing. Through reasonable clustering and role allocation, the overall operation efficiency of the system can be improved, the collaborative working ability between devices can be enhanced, and the communication overhead can be reduced; the update of the information model is monitored, and if it is detected that the information model is updated, the device role of each terminal device in the cluster is dynamically adjusted according to the updated information model, wherein the update condition of the information model includes the update of any one of the device state parameters, load state, location matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster, so that it can dynamically adapt to device status and environmental changes, maintain the flexibility and stability of the system, further enhance the system's adaptive ability and response speed, and improve the resource allocation efficiency between multiple devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[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 or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 A flowchart of the first embodiment of the dynamic clustering and role adjustment networking method of the present application;
[0039] Figure 2 This is a flow chart of Embodiment 2 of the dynamic clustering and role adjustment networking method of the present application;
[0040] Figure 3 This is a flow chart of Embodiment 3 of the dynamic clustering and role adjustment networking method of the present application;
[0041] Figure 4 This is a schematic diagram of the module structure of the dynamic clustering and role adjustment networking device according to an embodiment of the present application;
[0042] Figure 5 The device structure diagram of the hardware operating environment involved in the dynamic clustering and role adjustment networking method in the embodiment of the present application is shown.
[0043] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0044] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0045] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0046] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, a terminal system, etc. The following takes the dynamic clustering and role adjustment system (hereinafter referred to as the system) as an example to illustrate this embodiment and the following embodiments.
[0047] Based on this, this embodiment provides a dynamic clustering and role adjustment networking method, referring to Figure 1 , Figure 1 The flowchart of the dynamic clustering and role adjustment networking method of the present application is shown in FIG. The dynamic clustering and role adjustment networking method includes steps S10 to S30:
[0048] Step S10, obtaining device information of multiple terminal devices, and constructing an information model based on the device information of the multiple terminal devices, wherein the device information includes hardware characteristics, location information, and state information of the terminal devices, and the information model includes a location matrix and a state matrix;
[0049] It should be noted that device information refers to various attribute data of IoT devices, including hardware characteristics (such as CPU load, memory usage, energy status), location information (such as GPS coordinates or relative position), status information (such as network latency, bandwidth usage, real-time operation status), etc. The information model is a model obtained after a standardized description of device information. It unifies the semantics of device information so that information from different devices can be understood and interacted with each other. The model will be updated according to real-time changes in device information.
[0050] The system obtains the hardware characteristics, location information, status information and other device information of the terminal device through the Internet of Things technology. Then, the super object model is used to standardize the description of these device information to form a unified information model. The super object model is a model that describes the device capabilities in a standardized manner. It includes the physical characteristics, status information and spatial attributes of the device, and can dynamically reflect the current capabilities of the device. Through the super object model, the system can uniformly process and understand the information of different devices. The obtained information model is a dynamically updated model, which will be updated according to the real-time changes in the device information, thereby ensuring that the system accurately grasps the device status.
[0051] Exemplarily, first, information of all devices s_i in the device set S is collected, including hardware characteristics, geographic location information, and real-time status data. This information is used to construct a state matrix X and a location matrix L, where X records m types of state information of n devices, such as CPU load, memory, bandwidth, and energy status, and L records the two-dimensional location information of the device, such as GPS coordinates. For each device s_i, its state vector is represented as X_i and its location vector is represented as L_i. Next, the state matrix X is standardized to obtain a standardized state matrix X^{std}. The purpose of standardization is to convert the state information of different devices into a unified scale, usually between 0 and 1. This can eliminate the influence of different state information dimensions, so that the state information between different devices can be compared fairly. The standardization process involves subtracting the minimum value of each state information x_{ij} and then dividing it by the difference between its maximum and minimum values to eliminate the influence of different state information dimensions, so that the state information between different devices can be compared fairly.
[0052] Step S20, clustering the multiple terminal devices based on the position matrix to obtain at least one cluster, and determining the device role of each terminal device in each cluster according to the state matrix, wherein the device role includes a core device and an auxiliary device, and the auxiliary device in each cluster is used to assist the core device in the cluster to perform task processing;
[0053] It should be noted that clustering is to divide devices into several groups (clusters) according to certain rules or algorithms. The devices in each group have certain similarities in geographical location, status or function, so as to facilitate management and resource allocation. Device roles refer to the different responsibilities and functions assigned to devices in the device networking after clustering, which are divided into core devices and auxiliary devices. Core devices are the main devices in the cluster, responsible for managing the communication coordination, data processing and task allocation of other devices in the cluster. They have strong computing power, high bandwidth and relatively low energy consumption. They are responsible for processing the raw data uploaded by the devices in the cluster and performing computing tasks such as data preprocessing and edge computing. They manage the communication traffic of devices in the cluster to ensure the orderly transmission of data streams, reasonably allocate tasks according to the status and capabilities of other devices in the cluster, prevent individual devices from being overloaded, and perform real-time scheduling and optimization of resources in the cluster to ensure system load balancing. Auxiliary devices are responsible for assisting the core devices in completing tasks in the cluster, mainly performing data collection, transmission and simple computing tasks. They usually have lower computing power and bandwidth requirements, and are responsible for acquiring data from the environment or sensors and transmitting the data to the core devices, acting as relay nodes in the data flow, ensuring the stability of the communication network within the cluster, assisting the core devices in performing some computing tasks, and reducing the load on the core devices.
[0054] The system performs preliminary clustering based on the geographical location information of the device. Then, the role of the device in the cluster is dynamically adjusted according to the real-time status of the device (such as CPU load, energy consumption, etc.). The core device is a device in good condition to ensure the reasonable allocation of computing resources and communication resources in the cluster. At the same time, the system will dynamically assign tasks to different devices based on the status and capabilities of the device. The clustered device network and the role and task allocation of the devices in the cluster are obtained. This networking structure is dynamically changing and will be adjusted according to the real-time changes in the device status.
[0055] Step S30, if it is detected that the information model is updated, the device role of each terminal device in the cluster is dynamically adjusted according to the updated information model, wherein the update condition of the information model includes any update of the device status parameters, load status, position matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster.
[0056] The system will continuously monitor the update of the information model. When the update level of the information model is higher than the preset update threshold, the system will consider that the device status has changed significantly. At this time, the system will re-cluster and adjust the roles to ensure the optimization of the network structure and the load balancing of the system. When the device status changes significantly, such as any update of the device status parameters, load status, location matrix, and environmental change parameters of the core devices and / or auxiliary devices in any cluster, re-clustering and re-adjusting the roles can ensure the stability and efficiency of the system. In this process, the system will re-perform clustering analysis and role assignment based on the updated information model. Obtain an updated network structure and device role assignment. This result is based on the latest device status information and can ensure the optimized operation and load balancing of the system.
[0057] For example, the role adjustment and task assignment of devices whose information model update degree is higher than the update threshold can be performed by marking abnormal devices. First, the device status is monitored using the standardized state matrix X^{std} and the preset state threshold T. If any state information x_{ij}^{std} of device s_i exceeds the threshold t_j, the device s_i is marked as abnormal, forming an abnormal device marking matrix A.
[0058] According to the abnormal marking matrix A and the core device marking matrix M, the role of the core device is adjusted. If the core device s_i is marked as abnormal, it is downgraded to an auxiliary device, and a new lowest-scoring device is selected from the same cluster as the core device to obtain the updated core device label M' and task load matrix R, and the task allocation is dynamically adjusted according to M' and R. If the task load r_i of the core device s_i is lower than the maximum task volume, its task volume is increased; if the task load r_i of the auxiliary device s_i is higher than the minimum task volume, its task volume is reduced. According to the standardized state matrix X^{std} and the updated task load matrix R', resources are dynamically scheduled to form a resource allocation matrix P. The resource allocation amount P(s_i) is weightedly allocated according to the computing power C_i of the device and the total task volume T.
[0059] This embodiment obtains device information of multiple terminal devices and constructs an information model based on the device information of the multiple terminal devices, wherein the device information includes hardware characteristics, location information, and state information of the terminal devices, and the information model includes a location matrix and a state matrix, thereby ensuring the accuracy and timeliness of the system and optimizing resource allocation and fault warning capabilities; clustering the multiple terminal devices based on the location matrix to obtain at least one cluster, and determining the device role of each terminal device in each cluster based on the state matrix, wherein the device role includes a core device and an auxiliary device, and the auxiliary device in each cluster is used to assist the core device in the cluster to perform task processing. Through reasonable clustering and role allocation, the overall operation efficiency of the system can be improved, the collaborative working ability between devices can be enhanced, and the communication overhead can be reduced; the update of the information model is monitored, and if it is detected that the information model is updated, the device role of each terminal device in the cluster is dynamically adjusted according to the updated information model, wherein the update condition of the information model includes the update of any one of the device state parameters, load state, location matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster, so that it can dynamically adapt to device status and environmental changes, maintain the flexibility and stability of the system, further improve the adaptive ability and response speed of the system, and improve the resource allocation efficiency between multiple devices.
[0060] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction, and will not be repeated in the following. Figure 2 The step S40 further includes steps A10 to A20:
[0061] Step A10, based on the position matrix, terminal devices whose spatial positions are smaller than a preset cluster radius are grouped into the same cluster according to a preset clustering algorithm to obtain at least one cluster;
[0062] It should be noted that the location matrix is a two-dimensional array used to represent the geographic location information of the device in space. The location of each device is represented by its corresponding row vector, which contains the location data such as the latitude and longitude or relative coordinates of the device. Clustering algorithm is a data analysis technique used to divide a data set into multiple groups or clusters so that the data points within the same cluster are similar to each other, while the data points between different clusters are quite different. In this case, the clustering algorithm is used to group the devices based on their location information. The cluster radius is a parameter in the clustering algorithm that is used to define the maximum distance between devices that are considered to be in the same cluster. When the distance between two devices is less than the cluster radius, they are classified as the same cluster.
[0063] Get the location matrix containing the location information of all devices, and then apply the preset clustering algorithm (such as DBSCAN algorithm) to divide them into multiple clusters according to the spatial distance between the devices. During the clustering process, we set a cluster radius parameter, and only when the distance between two devices is less than this radius will they be divided into the same cluster. The clustering algorithm calculates the distance between devices to identify close relationships in space, thereby grouping similar devices together. This helps reduce the communication delay between devices and improve the overall performance of the system.
[0064] Step A20, for each cluster, determine the load score of each terminal device in the cluster according to the state matrix, determine the device role of the terminal device with the smallest load score as the core device, and determine the device roles of other terminal devices in the cluster except the core device as auxiliary devices.
[0065] It should be noted that the load score is a numerical indicator used to evaluate the current load status of the device. It is usually calculated based on multiple factors such as the device's CPU usage, memory usage, network bandwidth, etc., and reflects the device's ability to handle tasks.
[0066] For each device in a cluster, we calculate their load scores based on the state matrix. The load score is a comprehensive indicator that takes into account multiple factors of the device, such as CPU usage, memory usage, etc. Then, we compare the load scores of these devices and identify the device with the smallest load score as the core device of the cluster. The device with the smallest load score is selected as the core device to ensure that the computing resources and communication resources within the cluster can be reasonably allocated. The core device needs to handle all tasks within the cluster, so it should have sufficient computing power and a low load level to ensure the stability and efficiency of the system.
[0067] When the core device is determined, it becomes responsible for task allocation within the cluster. The core device dynamically allocates tasks to other devices within the cluster based on the device status and capability descriptions in the information model, as well as the task requirements within the cluster. This includes tasks such as data processing and communication coordination. The core device understands the status and capabilities of each device through the information model, so it can make reasonable task allocation decisions. This dynamic task allocation mechanism helps ensure load balancing and efficient operation of the system. At the same time, since the core device is the communication and computing center within the cluster, it can quickly respond to task requirements and coordinate device collaboration within the cluster.
[0068] Exemplarily, the position matrix L and the DBSCAN algorithm parameters (cluster radius ε and minimum number of points MinPts) are used to group devices with similar spatial positions into the same cluster to form a cluster set C. At the same time, the core devices are marked to form a core device marking matrix M. In each cluster, the score S(s_i) of the device s_i is weightedly calculated based on the standardized status information and weight w_j of the device, and the device with the lowest score is selected as the core device.
[0069] This embodiment divides devices into multiple clusters through a clustering algorithm, and then selects a core device for each cluster to be responsible for task allocation and intra-cluster coordination. This improves the flexibility and responsiveness of the system, especially in a large-scale distributed Internet of Things environment. It can effectively reduce system bottlenecks caused by overload of a single device and improve overall network performance and stability.
[0070] Based on the first or second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first or second embodiment can be referred to the above introduction, and will not be described in detail later. Figure 3 , the steps of step S30 may include steps B10 to B30:
[0071] Step B10, for any cluster, real-time detection of whether the device status parameters of the core devices in the cluster are updated, wherein the device status parameters include CPU load value, network delay value and remaining power value;
[0072] It should be noted that status parameters refer to various indicators used to describe the current operating status of the device, such as CPU load, network latency, power status, etc.
[0073] Step B20, if the device state parameter of the core device is updated, then detect whether the updated device state parameter of the core device meets the preset first adjustment strategy condition, wherein the first adjustment strategy condition includes that the CPU load value of the core device is greater than the preset CPU load threshold, or the network delay value of the core device is greater than the preset network delay threshold, or the remaining power value of the core device is less than the preset power threshold. If the preset first adjustment strategy condition is met, the state matrix is updated according to the updated device state parameter of the core device;
[0074] Step B30: Downgrade the core device in the cluster to an auxiliary device according to the updated state matrix, and select an auxiliary device from all the auxiliary devices in the cluster to upgrade to a core device.
[0075] The system collects the status information of IoT devices in real time through the Super Object Model, including CPU load, network delay, power status, etc., and compares this information with the preset status threshold. The status parameters are collected in real time through the device's sensors or internal monitoring system, and then standardized by the Super Object Model to form a unified data format and semantic description.
[0076] When the system detects that the status parameters of a device (assuming it is the first device) reach or exceed the corresponding preset status threshold, the system will further check the role of the device. If the device is currently a core device and its status parameters (such as high CPU load, high network latency, or low power) indicate that it can no longer effectively assume the responsibilities of a core device, the system will trigger the role adjustment mechanism.
[0077] The system downgrades the first device from a core device to an auxiliary device, which means that the device will no longer be responsible for the core duties of communication coordination, data processing, and task allocation within the cluster. The downgrade operation can be achieved by updating the device role marking matrix, which records the current role of each device (core device or auxiliary device). After the core device is downgraded, the system needs to reallocate tasks and resources within the cluster to ensure efficient operation and load balancing of the network. This may include transferring tasks originally undertaken by the downgraded core device to the reselected core device (upgraded from other auxiliary devices in good condition), and readjusting the cluster structure and role allocation according to the real-time status and capabilities of the device. The system will continuously monitor the status parameters of the device and the operation of the cluster, and make further adjustments and optimizations as needed. This includes regularly updating status thresholds, optimizing clustering algorithms, adjusting task allocation strategies, etc., to ensure that the network can adapt to the changing environment and device status.
[0078] Through the above steps, this embodiment can dynamically adjust the role and networking structure of the device to adapt to the state changes and demand changes of the device in the Internet of Things environment, thereby achieving efficient use of resources and stable operation of the network.
[0079] In a feasible implementation manner, step S30 may further include steps C10 to C30:
[0080] Step C10, for any cluster, detecting the load status of all terminal devices in the cluster in real time, wherein the load status includes a first load status of the core device and a second load status of the auxiliary device;
[0081] Step C20, if it is detected that the first load state is a load imbalance state, or the second load state is a load imbalance state, then the state matrix is updated according to the load imbalance state;
[0082] Step C30 performs load balancing adjustment on the core device and the auxiliary device according to the updated state matrix, and dynamically adjusts the device role of each terminal device in the cluster.
[0083] It should be noted that the system will regularly evaluate the load situation. During a certain measurement period, the system will collect the status information of the device and calculate its load score. When the load score of the device reaches or exceeds the load threshold, the device is considered to be overloaded; otherwise, it is considered to be underloaded. These are all load imbalance states.
[0084] The system collects the status information of each device in real time or periodically through the information model, including CPU usage, memory usage, network bandwidth, etc. Based on the collected status information, the system calculates the load score of each device and stores it in the information model. The system continuously monitors the load score of each device to detect devices with abnormal load in a timely manner.
[0085] If a core device has a load score greater than or equal to the preset load threshold for multiple consecutive measurement cycles, the system determines that the device is overloaded. To reduce the load on the core device, the system transfers some of its tasks to auxiliary devices in the same cluster as the core device. The specific number and type of task transfers are determined based on the remaining capacity and task priority of the auxiliary device. After the task is transferred, the system updates the task allocation information in the information model and monitors the load scores of each device after the transfer to ensure the overall load balance of the system.
[0086] If there is an auxiliary device whose load score is less than the preset load threshold in multiple consecutive measurement cycles, the system determines that the load of the device is too low. To improve the utilization of auxiliary devices, the system increases their task volume. The added tasks can be tasks from other auxiliary devices or core devices in the same cluster, or they can be newly assigned tasks by the system. After the tasks are added, the system also updates the task allocation information in the information model and monitors the load scores of auxiliary devices to ensure that they operate within a reasonable range.
[0087] If a core device has performance degradation due to long-term load (such as hardware failure, software anomaly, etc.), the system detects the abnormal load score or status information change of the device through the information model. To ensure stable operation of the system, the system downgrades the core device to an auxiliary device. After the downgrade, the core device will no longer assume the responsibilities of the core device, but will participate in network communication and task execution as an auxiliary device. After the downgrade process, the system needs to reallocate the tasks originally undertaken by the core device to other core devices or auxiliary devices, and update the device role and task allocation information in the information model.
[0088] Through the above steps, this embodiment realizes dynamic load balancing and role adjustment of devices in the Internet of Things network, and improves the stability and efficiency of the system.
[0089] In a feasible implementation manner, step S30 further includes step D10:
[0090] Step D10, if it is detected that the position matrix in the information model is updated, and there is a terminal device in each terminal device whose position update value exceeds the preset distance threshold, then the step of clustering the multiple terminal devices based on the information model is executed according to the latest position matrix, wherein the position update value is the displacement value of the terminal device when the position is updated.
[0091] It should be noted that when a device moves, its location coordinates will change, and this change is the location update value. The location update value can be obtained by calculating the coordinate difference before and after the device moves. The distance threshold is a preset value used to determine whether the distance the device moves is large enough to trigger re-clustering and role adjustment. When the location update value of a device exceeds this threshold, it is considered that the device has moved to a new location and its position and role in the network need to be reconsidered.
[0092] The system monitors the location matrix in real time or periodically to obtain the latest location information of the device. The location matrix is updated through the device's location sensor or network communication, and the device will periodically report its current location to the system. The system calculates the location update value of each device, that is, the coordinate difference before and after the device moves. The location update value is compared with the preset distance threshold. If the location update value is greater than or equal to the distance threshold, the device is considered to have moved to a new location. When it is found that the device has moved to a new location, the system may redefine the cluster structure based on the new location of the device to ensure that the communication efficiency of the devices in the cluster is maximized. After re-clustering, the system will readjust the roles and task allocation of the devices in the cluster based on factors such as the latest location, computing power, and communication capacity of the device. The selection of core devices should give priority to devices that are geographically close to other devices in the cluster to ensure the minimum communication delay. If the existing core device is far away from other devices, the system will select a device closer to the center as the new core device. The role of the auxiliary device will also be adjusted according to the new cluster structure to ensure communication and task collaboration between devices in the cluster. The system will update its internal state information to the information model, including the latest location matrix, clustering results, and role task allocation information. This updated information will be used for subsequent network communication and task execution.
[0093] Through the above steps, this embodiment realizes the dynamic clustering and role task allocation adjustment of devices in the Internet of Things to adapt to the changes in device locations and network performance requirements. This dynamic adjustment mechanism helps to improve the stability and efficiency of the network and optimize resource utilization.
[0094] In a feasible implementation manner, step S30 further includes steps E10 to E20:
[0095] Step E10, for any cluster, if it is detected that the number of terminal devices in the cluster is updated, the state matrix is updated according to the updated terminal devices in the cluster;
[0096] Step E20: re-adjust the device roles of the core devices and auxiliary devices in the cluster according to the updated state matrix to re-determine new core devices and new auxiliary devices in the cluster.
[0097] It should be noted that the addition of new terminal devices refers to the addition of new physical devices or virtual devices to the IoT system, which need to be identified, configured and integrated by the system. When a new terminal device is added, its status parameters (such as device type, function, location, etc.) will be captured by the system and updated to the information model.
[0098] The system monitors the real-time update of the information model through regular scanning or event triggering. When the information model changes (such as new devices joining, device status changes, device exits, etc.), the system will capture these changes and trigger the corresponding processing flow. When a new device is detected, the system first reads the status parameters of the new device. Based on the status parameters (such as computing power, network bandwidth), the new device is dynamically assigned as a core device or auxiliary device, or participates in existing cluster tasks. After the role assignment is completed, the system will update the information model, record the role information of the new device, and notify other related devices or components in the system.
[0099] Accordingly, when a device exits the cluster, the device role must be readjusted. Device exit refers to a device in the IoT system being removed from the system or no longer participating in the normal operation of the system due to failure, maintenance, upgrade, or user request. When a device exits, the tasks and roles it undertakes need to be reallocated or processed by the system. When a device exits, the system first identifies the identity of the exiting device and the current tasks it undertakes. Then, the system will reallocate the tasks of the exiting device to other devices in the same cluster based on the capabilities, status, and task load of the devices in the same cluster. After the task reallocation is completed, the system will update the information model, record the results of the task transfer, and notify the relevant devices to perform the new tasks.
[0100] Furthermore, when the external network environment changes (such as bandwidth reduction or signal interference increase), the system will dynamically adjust the device role according to the status of the device and environmental conditions to ensure the efficiency of system operation.
[0101] Exemplarily, when it is detected that a new device joins or an existing device exits the device set S', clustering is performed again according to the latest position matrix L' and DBSCAN algorithm parameters to form an updated cluster structure C'.
[0102] Through the above steps, this embodiment realizes the dynamic management and task allocation of devices in the Internet of Things system. When a new device joins, the system can automatically identify and assign a suitable role to it; when a device exits, the system can quickly adjust the task allocation to ensure the stability and continuity of the system. This dynamic management mechanism helps to improve the flexibility and scalability of the Internet of Things system.
[0103] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the dynamic clustering and role adjustment networking method of the present application. More simple transformations based on this technical concept are all within the protection scope of the present application.
[0104] This application also provides a dynamic clustering and role adjustment networking device, please refer to Figure 4 , the dynamic clustering and role adjustment networking device includes:
[0105] A data acquisition module 10 acquires device information of a plurality of terminal devices, and constructs an information model according to the device information of the plurality of terminal devices, wherein the device information includes hardware characteristics, location information, and status information of the terminal devices, and the information model includes a location matrix and a status matrix;
[0106] The device clustering module 20 performs clustering processing on multiple terminal devices based on the position matrix to obtain at least one cluster, and determines the device role of each terminal device in each cluster according to the state matrix, wherein the device role includes a core device and an auxiliary device, and the auxiliary device in each cluster is used to assist the core device in the cluster to perform task processing;
[0107] The dynamic adjustment module 30 dynamically adjusts the device role of each terminal device in the cluster according to the updated information model if it detects that the information model is updated, wherein the update condition of the information model includes any update of the device status parameters, load status, position matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster.
[0108] The dynamic clustering and role adjustment networking device provided by the present application adopts the dynamic clustering and role adjustment networking method in the above embodiment, which can solve the technical problem of low resource allocation efficiency among multiple devices. Compared with the prior art, the beneficial effects of the dynamic clustering and role adjustment networking device provided by the present application are the same as the beneficial effects of the dynamic clustering and role adjustment networking method provided by the above embodiment, and other technical features in the dynamic clustering and role adjustment networking device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0109] The present application provides a dynamic clustering and role adjustment networking device, which includes: at least one processor; and a memory that is communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the dynamic clustering and role adjustment networking method in the above-mentioned embodiment 1.
[0110] Reference below Figure 5 , which shows a schematic diagram of the structure of a dynamic clustering and role adjustment networking device suitable for implementing the embodiment of the present application. The dynamic clustering and role adjustment networking device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The dynamic clustering and role adjustment networking device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0111] like Figure 5As shown, the dynamic clustering and role adjustment networking device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. Various programs and data required for the operation of the dynamic clustering and role adjustment networking device are also stored in the RAM 1004. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems may be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 may allow the dynamic clustering and role adjustment networking device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a dynamic clustering and role adjustment networking device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have instead.
[0112] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0113] The dynamic clustering and role adjustment networking device provided by the present application adopts the dynamic clustering and role adjustment networking method in the above embodiment, which can solve the technical problem of low resource allocation efficiency among multiple devices. Compared with the prior art, the beneficial effects of the dynamic clustering and role adjustment networking device provided by the present application are the same as the beneficial effects of the dynamic clustering and role adjustment networking method provided by the above embodiment, and other technical features in the dynamic clustering and role adjustment networking device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0114] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0115] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0116] The present application provides a medium, which is a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the dynamic clustering and role adjustment networking method in the above-mentioned embodiment.
[0117] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0118] The computer-readable storage medium may be included in the dynamic clustering and role adjustment networking device; or may exist independently without being assembled into the dynamic clustering and role adjustment networking device.
[0119] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the dynamic clustering and role adjustment networking device, the dynamic clustering and role adjustment networking device:
[0120] Acquire device information of multiple terminal devices, and construct an information model based on the device information of the multiple terminal devices, wherein the device information includes hardware characteristics, location information, and status information of the terminal devices, and the information model includes a location matrix and a status matrix;
[0121] Based on the position matrix, multiple terminal devices are clustered to obtain at least one cluster, and the device role of each terminal device in each cluster is determined according to the state matrix, wherein the device role includes a core device and an auxiliary device, and the auxiliary device in each cluster is used to assist the core device in the cluster to perform task processing;
[0122] If an update of the information model is detected, the device role of each terminal device in the cluster is dynamically adjusted according to the updated information model, wherein the update conditions of the information model include updates to any of the device status parameters, load status, location matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster.
[0123] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0124] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0126] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned dynamic clustering and role adjustment networking method, and can solve the technical problem of low resource allocation efficiency among multiple devices. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the dynamic clustering and role adjustment networking method provided by the above-mentioned embodiment, and will not be repeated here.
[0127] The present application also provides a product, which is a computer program product, including a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned dynamic clustering and role adjustment networking method are implemented.
[0128] The computer program product provided by the present application can solve the technical problem of low resource allocation efficiency among multiple devices. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the dynamic clustering and role adjustment networking method provided by the above embodiment, which will not be repeated here.
[0129] The above are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A dynamic clustering and role adjustment networking method, characterized in that: The dynamic clustering and role adjustment networking method comprises: Acquire device information of multiple terminal devices, and construct an information model based on the device information of the multiple terminal devices, wherein the device information includes hardware characteristics, location information, and state information of the terminal devices, and the information model includes a location matrix and a state matrix; Based on the position matrix, the plurality of terminal devices are clustered to obtain at least one cluster, and the device role of each terminal device in each cluster is determined according to the state matrix, wherein the device role includes a core device and an auxiliary device, and each auxiliary device in the cluster is used to assist the core device in the cluster in performing task processing; If it is detected that the information model is updated, the device role of each terminal device in the cluster is dynamically adjusted according to the updated information model, wherein the update condition of the information model includes the update of any one of the device status parameters, load status, position matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster.
2. The dynamic clustering and role adjustment networking method according to claim 1, characterized in that: The step of determining the device role of each terminal device in each cluster according to the state matrix includes: For any cluster, real-time detection of whether the device status parameters of the core devices in the cluster are updated, wherein the device status parameters include CPU load value, network delay value and remaining power value; If the device state parameter of the core device is updated, then detect whether the updated device state parameter of the core device meets the preset first adjustment strategy condition, wherein the first adjustment strategy condition includes that the CPU load value of the core device is greater than the preset CPU load threshold, or, the network delay value of the core device is greater than the preset network delay threshold, or, the remaining power value of the core device is less than the preset power threshold. If the preset first adjustment strategy condition is met, update the state matrix according to the updated device state parameter of the core device; The step of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model includes: The core device in the cluster is downgraded to an auxiliary device according to the updated state matrix, and an auxiliary device is selected from all the auxiliary devices in the cluster to be upgraded to a core device.
3. The dynamic clustering and role adjustment networking method according to claim 1, characterized in that: The step of determining the device role of each terminal device in each cluster according to the state matrix includes: For any cluster, detecting the load status of all terminal devices in the cluster in real time, wherein the load status includes a first load status of a core device and a second load status of an auxiliary device; If it is detected that the first load state is a load imbalance state, or the second load state is a load imbalance state, updating the state matrix according to the load imbalance state; The step of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model includes: The core device and the auxiliary device are load-balanced adjusted according to the updated state matrix, and the device role of each terminal device in the cluster is dynamically adjusted.
4. The dynamic clustering and role adjustment networking method according to claim 1, characterized in that: If it is detected that the information model is updated, the step of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model includes: If it is detected that the position matrix in the information model is updated, and there is a terminal device in each of the terminal devices whose position update value exceeds a preset distance threshold, the step of clustering the multiple terminal devices based on the information model is executed according to the latest position matrix, wherein the position update value is the displacement value of the terminal device when the position is updated.
5. The dynamic clustering and role adjustment networking method according to claim 1, characterized in that: The environmental change parameter includes an update of the number of terminal devices in the cluster, and the step of determining the device role of each terminal device in each cluster according to the state matrix includes: For any cluster, if it is detected that the number of terminal devices in the cluster is updated, the state matrix is updated according to the updated terminal devices in the cluster; The step of dynamically adjusting the device role of each terminal device in the cluster according to the updated information model includes: The device roles of the core devices and the auxiliary devices in the cluster are readjusted according to the updated state matrix to redefine new core devices and new auxiliary devices in the cluster.
6. The dynamic clustering and role adjustment networking method according to claim 1, characterized in that: The step of clustering the plurality of terminal devices based on the position matrix to obtain at least one cluster, and determining the device role of each terminal device in each cluster according to the state matrix includes: Based on the position matrix, terminal devices whose spatial positions are smaller than a preset cluster radius are grouped into the same cluster according to a preset clustering algorithm to obtain at least one cluster; For each cluster, the load score of each terminal device in the cluster is determined according to the state matrix, the device role of the terminal device with the smallest load score is determined as the core device, and the device roles of other terminal devices in the cluster except the core device are determined as the auxiliary devices.
7. A dynamic clustering and role adjustment networking device, characterized in that: The dynamic clustering and role adjustment networking device comprises: A data acquisition module is used to acquire device information of multiple terminal devices, and to construct an information model based on the device information of the multiple terminal devices, wherein the device information includes hardware characteristics, location information, and status information of the terminal devices, and the information model includes a location matrix and a status matrix; A device clustering module, which performs clustering processing on the multiple terminal devices based on the position matrix to obtain at least one cluster, and determines the device role of each terminal device in each cluster according to the state matrix, wherein the device role includes a core device and an auxiliary device, and each auxiliary device in the cluster is used to assist the core device in the cluster to perform task processing; A dynamic adjustment module dynamically adjusts the device role of each terminal device in the cluster according to the updated information model if it detects that the information model is updated, wherein the update condition of the information model includes any update of the device status parameters, load status, position matrix, and environmental change parameters of any core device and / or auxiliary device in the cluster.
8. A dynamic clustering and role adjustment networking device, characterized in that: The dynamic clustering and role adjustment networking device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the dynamic clustering and role adjustment networking method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the dynamic clustering and role adjustment networking method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of the dynamic clustering and role adjustment networking method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Self-adaptive clustering method and device for wireless sensor network
CN111405634A
Rapid exclusion-contained wireless sensor network clustering routing method and system
CN112055394A
Method and system for realizing connection management of Internet of Things equipment
CN114281905A
Method for calculating radius of cluster and group cooperative communication method using the same
KR1020120076772A
Cited By
Integrated control method and system for Bluetooth smart home
CN120165992A