Intelligent task distribution method and system with lightweight knowledge base and storage medium
By constructing a task intelligent distribution method with a lightweight knowledge base, the problem of unified parsing of QoS mechanisms in mobile swarm computing is solved, enabling efficient communication and task completion in heterogeneous network environments, and improving device performance and network adaptability.
Patent Information
- Application Number
- CN202511569038.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-02-13
AI Technical Summary
In the heterogeneous network environment of mobile swarm computing, traditional QoS mechanisms make it difficult for agents to uniformly acquire and parse packet semantics and system behavior. Furthermore, the dimension of the state space expands linearly with the increase in the number of communication devices, resulting in excessive consumption of model training resources and difficulty in convergence and generalization.
A task intelligent distribution method using a lightweight knowledge base is adopted. By constructing a rule-driven distributed processing flow, including neighbor nodes judging execution conditions and relaying tasks, and combining state space compression, modular generation of action space and reward function design, the policy function is optimized using the policy gradient method.
It improves the smoothness of operation on resource-constrained devices, increases the task completion rate, reduces communication latency and packet loss rate, and enables rapid adaptation and efficient communication in complex network environments.
Smart Images

Figure CN121530899A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile group task distribution technology, and in particular to a task intelligent distribution method, system, and storage medium with a lightweight knowledge base. Background Technology
[0002] In the dynamically changing communication environment of mobile swarm computing, traditional QoS mechanisms suffer from several drawbacks. In heterogeneous network environments (such as Wi-Fi, LTE, LoRa, 5G, DTN, etc.), QoS fields are scattered across different protocol stack layers, making it difficult for agents to uniformly acquire and parse them. They also lack the ability to describe packet semantics and system behavior, such as "whether latency tolerance is required" or "whether it is used for synchronization control." Furthermore, they incur excessive overhead in resource-constrained environments like mobile swarm computing. Moreover, the state space dimension expands linearly with the number of communication devices N. Directly inputting the high-dimensional state vector st into the policy network would lead to excessive model training resource consumption and difficulty in convergence and generalization.
[0003] Therefore, there is an urgent need to develop a highly flexible and adaptable task intelligent distribution method, system, and storage medium with a lightweight knowledge base, which can address the contradiction between concise expression and reasoning usability in intelligent decision-making. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a highly flexible and adaptable intelligent task distribution method, system, and storage medium with a lightweight knowledge base; to address the contradiction between concise expression and inference usability in intelligent decision-making; and to provide structured information to assist the system in selecting paths, controlling forwarding, and making caching decisions, thereby improving smooth operation on resource-limited devices.
[0005] The technical solution adopted by this invention to solve the above-mentioned technical problems is: a task intelligent distribution method with a lightweight knowledge base, comprising: a source node broadcasting the task packet to neighboring nodes within the communication range; after receiving the task packet, the neighboring nodes determine whether they meet the execution conditions according to the rules of the knowledge base through the task intelligent distribution model; if the execution conditions are met, the task is executed directly; if the execution conditions are not met, it is determined whether the task can be relayed to other neighboring nodes for distribution and calculation, thereby constructing a rule-driven distributed processing flow.
[0006] Preferably, the knowledge base structure includes: a communication node entity, and data transmission entities, descriptor entities, perception task entities, network environment entities, and behavior log entities interconnected with the communication node entities; and the entity relationships and basic rules of the knowledge base are stored in an analysis-oriented columnar in-memory database.
[0007] Preferred intelligent task distribution models include: The policy function, and the state space, action space, and reward function interconnected with the policy function; The state space includes: modeling the environmental state as a multi-dimensional feature vector, where the environmental state includes device attributes, communication statistics, and local network features; constructing the acquired multi-dimensional feature vector into a state space with continuous and discrete variables; the state space S includes: device attribute vector, device communication summary, and local network communication summary; the system state vector is... , , , is the combination of the attributes and communication digest of the i-th device. Represents communication characteristics; continuous dimension With discrete dimension The algorithm is as follows: ; ; The action space includes: selecting appropriate actions based on the current state to update the rules within the action space, thereby optimizing the scheduling efficiency of communication and computing resources and obtaining a hybrid action space with both discrete and continuous characteristics; the actions are... , ; Represents the action space. ; Represents a power set. Let represent a continuous real-valued vector space of no more than M dimensions; The specific rule update strategy chosen by the agent at time step t represents the action; each action is formalized as a tuple: ; This represents the currently selected set of condition indices, corresponding to the set of candidate rule sub-conditions. It is a discrete subset; The reward function is: ,in, For delayed reward backtracking terms based on n-step return; For combined reward sharing items; α1, α2, and α3 are sparse reward mitigation terms; α1, α2, and α3 are weighting coefficients used to adjust the influence of the three types of reward terms. The policy function is: , Generate policy functions for structured actions; I t φ represents the set of activated subconditions; t Its corresponding threshold vector; structured action generation strategy function This network is used to simultaneously perform multi-label selection of rule sub-conditions and the generation of corresponding continuous thresholds; the policy network is state-driven and outputs structured actions. .
[0008] Preferably, a state compression mechanism is introduced into the state space to embed the original state into a low-dimensional continuous space through dimensionality reduction mapping; Dimensionality reduction mapping uses principal component analysis as a linear dimensionality reduction method to perform eigenvalue decomposition on the covariance matrix of the state samples, extracting the eigenvalues of the samples. Each principal component constitutes a new input representation: ; For the dimensionality-reduced state embedding, Principal component transformation matrix, The mean of the state samples. To reduce the dimensionality of the target dimension, it is usually set to 1. .
[0009] Preferably, each action in the action space It is parsed into a formal rule, containing a three-layer structure. The first layer is: combining rule sub-conditions, letting... This represents a predefined set of rule sub-conditions, each sub-condition... Corresponding to the network state vector One-dimensional features in the action; set of indices in the action This represents the set of currently active subconditions; each activation condition... Corresponding to a continuous threshold Used as a criterion for judgment; The second layer structure consists of linear mapping of condition combinations and rule classification. To achieve joint modeling of sub-condition judgments, a weight coefficient vector is introduced. This indicates the importance of each sub-condition, which can be output by the policy network when generating actions; the current rule matching score. ;based on A fixed threshold segmentation mechanism is used to map continuous scores to discrete communication behavior types; based on The range of values the value falls into determines the type of behavior; The third layer of the structure consists of: finally, rule logic generation and knowledge base storage, where rules are selected. Then, the system will set the sub-conditions. Threshold The symbol mappings are filled into the template logic structure; the final generated rule structure is stored in the knowledge base database in the form of key-value pairs.
[0010] Preferred, in, This is a summary of the state before the rules are deployed. To assess the summary status after the evaluation window ends; = ; Among them, g loss For packet loss rate, g succFor task success rate, g latency For communication delay; , For rules The confidence level, i.e., the success rate of task completion according to this rule; This indicates the actual application frequency in task distribution, that is, the number of times the above rules are used per unit of time, which is used to measure the universality and practicality of the rules. These are adjustable weighting parameters for confidence level and actual application frequency, used to balance the importance of the two factors.
[0011] Preferably, the strategy function adopts a modular action generation mechanism, which divides the rule selection process into a condition selection module and a threshold generation module; The sub-condition selection module includes: a multi-label classifier, which accepts the current environment state. As input, the output is a real vector of dimension M. Each dimension corresponds to a candidate sub-condition. The probability vector is obtained after sigmoid activation. And a discrete selection vector is constructed by hard thresholding: , Sub-condition combinations are ; The threshold generation module includes: for each activated sub-condition The policy network outputs the corresponding continuous threshold. Output using a parameterized Gaussian strategy: , ; and Each condition is given by the output branch of the policy network for the i-th condition, and each branch of the network shares the underlying state feature extractor. The overall policy function maximizes the following objective function: Training is performed; the REINFORCE policy gradient method is used to update the parameters θ, enabling the generation rule combination and its threshold structure to maximize task reward in long-term interactions. The REINFORCE algorithm is a Monte Carlo sampling-based policy gradient method that maximizes the expected cumulative reward by directly optimizing the policy parameters, and is suitable for policy optimization problems in reinforcement learning.
[0012] Preferably, the online reinforcement learning system includes a state encoding module, a structured policy function module, an environment interaction module, and a policy optimization module; the state awareness module receives state input at each time step. This state encoding includes key information such as device attributes, communication digests, and topology characteristics; Structured policy function module: Policy Network Output Action This refers to a set of activated rule sub-conditions and their corresponding thresholds; Environment interaction module: Actions The policy is mapped to a communication strategy and executed in the system; the environment returns a reward r. t Reflecting the effect of rule combinations; Strategy optimization module: Through the REINFORCE algorithm, the system optimizes the strategy based on the cumulative reward R after each round of interaction. t Calculate the gradient and update the parameter θ; The reinforcement learning problem is formalized as a Markov decision process: ; Where S is the state space and A is the action space. γ is the transfer function, determined by the communication protocol and network evolution; r is the reward function, reflecting the performance gain or penalty brought about by rule execution; γ is the discount factor, measuring long-term returns.
[0013] Preferably, a task intelligent distribution system with a lightweight knowledge base in mobile swarm computing includes: The acquisition module is used to acquire task packages; The task broadcast module is used by the source node to broadcast the task packet to neighboring nodes within the communication range; The intelligent task distribution module is used by neighboring nodes to determine whether they meet the execution conditions based on the rules of the knowledge base after receiving the task package. If the execution conditions are met, the task is executed directly; if the execution conditions are not met, it is determined whether the task can be relayed to the updated neighboring node for distribution and computation, thereby constructing a rule-driven distributed processing flow. Steps for implementing a task intelligent distribution method with a lightweight knowledge base.
[0014] Preferably, a computer-readable storage medium stores a computer program / instructions thereon, which, when executed by a processor, implements the steps of a task intelligent distribution method with a lightweight knowledge base.
[0015] The beneficial effects of this invention are: This invention proposes a task intelligent distribution method, system, and storage medium with a lightweight knowledge base; This invention models key participating elements in a network based on the principles of subject-object abstraction and attribute expansion, and defines initial semantic rules as guidance for reasoning. It not only supports state-action abstract modeling in reinforcement learning but also provides structured knowledge support for rule-based reasoning. To support multi-source intelligent perception and communication behavior optimization, this invention divides the knowledge base into six core entity types, corresponding to factors such as device nodes, information units, task objectives, environmental context, and behavioral trajectories in the network system. Each entity has an independent set of attributes, which can form a heterogeneous graph node structure in the knowledge graph, supporting semantic querying and policy reasoning. Attached Figure Description
[0016] Figure 1 This is the knowledge base entity and its attribute definition table of the present invention; Figure 2 This is a schematic diagram of the structure between the main entities in the knowledge base of this invention; Figure 3 This is the QEPD message structure and semantic table of the present invention; Figure 4 This is a comparison table of the lightweight database features of this invention; Figure 5 This is the training process algorithm with parameters given in the strategy function of this invention; Figure 6 This is the overall training process algorithm of the reinforcement learning system of the present invention; Figure 7 This is an average distribution map of the nodes of this invention in geographic space; Figure 8 This is a diagram showing the distribution of the number of nodes of the present invention on the time axis; Figure 9 This is the intelligent device node attribute description table of the present invention; Figure 10 This is the experimental evaluation index definition table of the present invention; Figure 11 This is a graph showing the trend of the task completion rate over time according to the present invention; Figure 12 This is a graph showing the communication delay over time according to the present invention; Figure 13 This is a graph showing the change in packet loss rate over time according to the present invention; Figure 14 This is a diagram showing the variation of node load distribution according to the present invention; Figure 15 This is the cumulative energy consumption curve of the system according to the present invention. Detailed Implementation
[0017] The present invention will now be described in further detail with reference to the accompanying drawings and preferred embodiments. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0018] Example 1: A task intelligent distribution method with a lightweight knowledge base includes: a source node broadcasting the task package to neighboring nodes within its communication range; after receiving the task package, the neighboring nodes determine whether they meet the execution conditions according to the rules of the knowledge base through a task intelligent distribution model; if the execution conditions are met, the task is executed directly; if the execution conditions are not met, it is determined whether the task can be relayed to other neighboring nodes for distribution and computation, thereby constructing a rule-driven distributed processing flow.
[0019] Example 2, building upon Example 1, employs an embedded database, resulting in smoother operation even on resource-constrained devices. Upon system startup, it uses manually defined communication rules as a starting point.
[0020] Among them, the subject relationship and rule definition are as follows: Specifically, to achieve intelligent management of communication behavior in mobile swarm computing environments, this invention constructs a structured knowledge base entity relationship. It models key participating elements in the network based on the principles of subject-object abstraction and attribute expansion, and defines initial semantic rules as guidance for reasoning. This system not only supports state-action abstract modeling in reinforcement learning but also provides structured knowledge support for rule-based reasoning. To support multi-source intelligent perception and communication behavior optimization, this invention divides the knowledge base into six core entity types, corresponding to factors such as device nodes, information units, task objectives, environmental context, and behavioral trajectories in the network system. Each entity has an independent set of attributes, which can form a heterogeneous graph node structure in the knowledge graph, supporting semantic querying and policy reasoning. Figure 1 It summarizes the definitions of key entities and their attributes.
[0021] Specifically, semantic relationships between entities characterize the structural and functional connections between subjects, forming the edge set of the knowledge graph. Typical semantic relationships between six core entities include: Device reading QEPD: Devices primarily read QEPDs to obtain information instead of parsing packet bytes. Device receiving / forwarding Packets: The flow of data packets in the network is achieved through device relay transmission. Packet containing QEPD: Each packet embeds a set of service constraint description fields to indicate scheduling requirements. Device undertaking ServiceTask: Devices execute specific sensing or communication tasks based on their capabilities and task allocation logic to determine the task information they are performing. Device recording EventLog: State changes or behavioral results generated by the device during operation are recorded as event logs. Environment influencing Device: Current global network environment parameters, such as link quality and load status, dynamically affect device behavior and task scheduling strategies. ServiceTask depending on Environment: The feasibility and priority of task execution need to be determined in conjunction with the current environmental state. Figure 2 This illustrates the structural relationships between subjects in the knowledge base.
[0022] Among them, the QoS-Enhanced Packet Descriptor (QEPD) provides a lightweight, structured identifier with data support. Specifically, QEPD's main purpose is to accurately express the network environment, packet behavior, and communication context through a small number of fields, unifying semantic representation in heterogeneous network conditions and improving the adaptability and generalization ability of decision-making systems. Traditional QoS mechanisms in heterogeneous network environments (such as Wi-Fi, LTE, LoRa, 5G, DTN, etc.) suffer from the following problems: QoS fields are scattered across different protocol stack layers, making it difficult for agents to uniformly acquire and parse them; they lack the ability to describe packet semantics and system behavior, such as "whether latency tolerance is required" or "whether it is used for synchronization control"; and they incur excessive overhead in resource-constrained environments such as mobile swarm computing. Therefore, this invention introduces a unified data packet structure, QEPD, for intelligent decision-making to resolve the contradiction between concise expression and inference usability. Specific advantages include: lightweight expression (each field should concisely express semantics, with the total structure size controlled between 24 and 32 bytes), non-redundancy (avoiding the repetitive expression of existing QoS fields in traditional protocol headers, focusing on behavioral attributes), heterogeneous adaptation (supporting unified numbering and scalability for common communication protocols), and inference-oriented design (can be directly used for path scoring and embedding mapping). Assuming support for the following N heterogeneous communication protocols, such as Wi-Fi, LTE, LoRa, 5G, DTN (delay-tolerant network), Bluetooth, etc., QEPD uses 2 bytes (8 bits) to represent the protocol type code, which can be extended to... (Type of encoding). The specific content of QEPD is shown in Figure 3: This structure can independently provide the context information required for intelligent behavior decision-making without relying on traditional protocol stack fields.
[0023] In this invention, RocksDB is chosen for knowledge storage: entity relationships and basic rules are stored in RocksDB. Below is a detailed comparison of several embedded knowledge bases, such as... Figure 4As shown. RocksDB is a key-value database, where each knowledge unit is encoded and stored in the form of key:string → value:bytes / JSON. This invention adopts a unified naming and structure encoding method, supporting fast access and rule-driven reasoning execution. The following section presents its design examples in RocksDB according to entity category, entity relationship, and reasoning rules. First, the entity storage structure: each type of entity uses a type prefix + instance ID as the key, and the value uses JSON to represent entity attributes. Storage example: To improve the matching efficiency and reconfigurability of rules, a structured key-value pair method is used to store rules. Each rule is uniquely determined by the set of activation sub-conditions I and its corresponding set of parameter thresholds φ. The knowledge storage method of this invention is compatible with the action output format of structured policy functions, facilitating rule generation, invocation, matching, and update operations, and can be efficiently integrated into the knowledge base system to participate in the reasoning and policy generation process.
[0024] The creation and updating of the distribution strategy of this invention includes: First, the establishment of the state space: The definition of the state space includes: To effectively characterize the dynamics of the communication environment and the heterogeneity between devices in mobile crowdsourcing computing, this invention models the environmental state as a multi-dimensional feature vector, which integrates device attributes, communication statistics, and local network characteristics, forming a state space with continuous and discrete variables. Formally, the system state st∈S⊂Rm×Zn, where Rm represents the space of continuous variables in the state vector, and Zn represents the subspace composed of discrete variables in the state vector, reflecting the mixed characteristics of the state space. The state space S specifically includes the following three components: Device attribute vector: Based on the defined knowledge base storage structure, the static attributes and dynamic states (such as remaining energy, power level, etc.) of each device are extracted. Device communication summary: To enhance the state representation capability, a communication performance summary index of the device within a recent time window (average packet loss rate, average communication delay, average retransmission count, etc.) is further introduced. All indexes are normalized real numbers, forming a continuous subspace. Local network communication summary: Used to describe the network communication status, including global indicators such as packet loss rate, average link bandwidth availability, and average delay, represented as a set of continuous real-valued variables. System state vector Composed of the above three parts, it can be represented as: ,in For the i-th device, the attribute and communication digest are combined. This represents the communication characteristics. The formulas for calculating the continuous dimension dc and the discrete dimension dd are as follows: ; .
[0025] State space dimensionality reduction includes: considering that the dimensionality of the state space expands linearly with the number of communication devices N, if the high-dimensional state vector is directly reduced... Inputting these values into the policy network leads to excessive model training resource consumption and difficulty in convergence and generalization. To alleviate the dimensionality problem, this invention introduces a state compression mechanism, embedding the original states into a low-dimensional continuous space through dimensionality reduction mapping. Specifically, Principal Component Analysis (PCA) is used as a linear dimensionality reduction method to perform eigenvalue decomposition on the covariance matrix of the state samples, extracting the eigenvalues of the original states. Each principal component constitutes a new input representation: ;in For the dimensionality-reduced state embedding, Principal component transformation matrix, The mean of the state samples. To reduce the dimensionality of the target dimension, it is usually set to 1. Dimensionally reduced embedding vectors It retains the main variation information of the original state and significantly reduces the computational complexity in policy learning, which is beneficial to the convergence and generalization of the model.
[0026] Secondly, the action space includes: The definition of action space includes: the core decision-making task of an agent is to select an appropriate action based on the current state to update its internal rules, thereby optimizing the scheduling efficiency of communication and computing resources. Therefore, action space modeling needs to consider both rule structure and threshold setting, forming a hybrid action space with both discrete and continuous characteristics. Let action be denoted as... ,in Represents the action space. The specific rule update strategy chosen by the agent at time step t represents the action. Each action can be formalized as the following binary tuple: ; This represents the currently selected set of condition indices, corresponding to the set of candidate rule sub-conditions. is a discrete subset. The threshold vector set for the corresponding conditions is represented as a sequence of real continuous variables, corresponding to the specific decision threshold for each activated condition. Therefore, the action space is represented as follows: ,in, This represents the power set (excluding the empty set). Let represent a continuous real-valued vector space of no more than M dimensions. The dimension of the action space is limited by the number of subconditions.
[0027] Action space modeling includes: employing a modular action generation mechanism, dividing the rule selection process into a condition selection module and a threshold generation module. Specifically, it includes: a condition selection module (Discrete RuleSelector): processing all candidate conditions... Perform evaluations one by one and output multi-label selection vectors. , indicating the currently active combination of rule sub-conditions. Threshold generation module (ContinuousParameterGenerator): For each activated rule condition... Output a real-valued threshold. , forming a continuous threshold vector ActionComposer: Constructs the final action based on the outputs of the two modules mentioned above. This refers to the agent's response strategy to the current state.
[0028] Rules and mappings include: when creating or updating a rule by selecting an action, the rule is searched from the key stored in the database by the condition selection module, and the corresponding rule is then created or updated. The following example uses rule creation; each action... It is parsed into a formal rule, which contains the following three-layer structure: First, combine the rule sub-conditions, let This represents a predefined set of rule sub-conditions, each sub-condition... Corresponding to the network state vector One-dimensional features in the data, such as current packet loss rate, queue length, and channel quality. A set of indices in the action. This represents the set of currently active sub-conditions. Each activation condition... Corresponding to a continuous threshold This is used as the judgment criterion. The logical output of each sub-condition is defined as follows: .
[0029] Next is the linear mapping of condition combinations and rule classification. To achieve joint modeling of sub-condition judgments, a weight coefficient vector is introduced. This indicates the importance of each sub-condition, which can be output by the policy network when generating actions. Current rule matching score. Defined as: ;based on A fixed-threshold segmentation mechanism is used to map continuous scores to discrete communication behavior types. This mechanism does not rely on complex classifier structures, but rather on... The range of values that the value falls into directly determines the type of behavior. The following example demonstrates the correspondence between the M value and the decision behavior using three simple knowledge base decision behaviors. The segmented logic embodies the semantic representation of each sub-condition and its weighting coefficient. For example, when a device faces unrecoverable factors such as impending disconnection from the network or energy depletion, its corresponding sub-rule has a higher weight, causing... Reaching a high value range triggers a DROP operation; however, in scenarios with high resource availability, As the threshold decreases, behavioral choices naturally tend towards FORWARD or QUEUE. Specific threshold settings will be adjusted in subsequent experiments based on experience and system feedback.
[0030] Finally, there's the rule logic generation and knowledge base storage; rules are selected. Then, the system will set the sub-conditions. Threshold The symbol mappings are filled into the template logic structure to form the final rules: The final generated rule structure is stored in the knowledge base database in the form of key-value pairs, where the "key" is the set of activated rule sub-conditions I. t "Value" refers to the continuous threshold value for each corresponding sub-condition. with weighting coefficients The binary pair formed And add the final calculated decision behavior type. This structure supports efficient indexing and logical reasoning, facilitating decision backtracking and updates based on historical rules, and further promoting the adaptive and automated execution of communication behaviors.
[0031] Third, the reward function includes: ,in, For delayed reward backtracking terms based on n-step return; For combined reward sharing items; α1, α2, and α3 are sparse reward mitigation terms; α1, α2, and α3 are weighting coefficients used to adjust the influence of the three types of reward terms. in, This is a summary of the state before the rules are deployed. To assess the summary status after the evaluation window ends; = ; Among them, g loss For packet loss rate, g succ For task success rate, g latency For communication delay; , For rules The confidence level, i.e., the success rate of task completion according to this rule; This indicates the actual application frequency in task distribution, that is, the number of times the above rules are used per unit of time, which is used to measure the universality and practicality of the rules. These are adjustable weighting parameters for confidence level and actual application frequency, used to balance the importance of the two factors.
[0032] Fourth, the policy function includes: Inspired by parameterized reinforcement learning frameworks, a structured action generation policy function was designed. This is used to simultaneously perform multi-label selection for rule sub-conditions and the generation of corresponding continuous thresholds. The policy network is state-driven and outputs structured action pairs. ,in This represents the set of activated subconditions. This corresponds to its threshold vector. Specifically, the policy function is defined as follows: Sub-condition selection module: This module consists of a multi-label classifier that accepts the current environment state. As input, the output is a real vector of dimension M. Each dimension corresponds to a candidate sub-condition. After sigmoid activation, a probability vector is obtained. And a discrete selection vector is constructed by hard thresholding: , The final combination of subconditions is: Threshold generation module: For each activated sub-condition The policy network outputs its corresponding continuous threshold. To enhance flexibility, this module employs a parameterized Gaussian strategy for output: , . and The outputs for the i-th condition are given by the policy network, and each branch of the network shares the underlying state feature extractor.
[0033] Since it is necessary to simultaneously optimize the discrete combination of rule sub-conditions and the corresponding continuous threshold output, the overall policy function is trained by maximizing the following objective function: The REINFORCE method is used to update parameters θ, ensuring that the generated rule combinations and their threshold structures maximize task rewards in long-term interactions. Finally, the parameter training process is given, as follows: Figure 5 As shown.
[0034] Working principle: This invention discloses a knowledge-based intelligent task information distribution method that improves the communication efficiency of mobile swarm intelligence networks. First, a context-aware mechanism based on QEPD descriptors enables multi-dimensional representation of communication states, thereby improving the accuracy of rule matching and demonstrating a significant advantage over traditional knowledge bases. Second, the dynamic knowledge base architecture employs a high-efficiency storage engine, supporting fast triple queries and providing millisecond-level response capabilities for real-time decision-making. This knowledge-based intelligent task information distribution method ensures that the system can quickly adapt to complex and changing network environments.
[0035] Example 3, building upon Example 2, introduces reinforcement learning, enabling the system to generate and optimize new rules on its own. This makes the rule base more flexible and adaptable over time.
[0036] To achieve adaptive generation of structured rules in communication systems, an online reinforcement learning system based on policy gradients was constructed. This system is based on state-action-reward interactions and employs the REINFORCE algorithm as its learning core to implement the generation of structured policy functions. End-to-end training.
[0037] The reinforcement learning problem is formalized into a Markov decision process. Where: State space S: Environmental observations of the device, including communication digests, resource indicators, and neighbor states; Action space A: Combination of structured rules. ; transfer function Determined by communication protocols and network evolution; reward function : Reflects the performance gain or penalty resulting from rule execution; discount factor : Measures long-term returns; the goal is to maximize expected cumulative returns.
[0038] This embodiment constructs a structured rule-driven online reinforcement learning system for automatically generating adaptive logical rules in dynamic communication environments. The system consists of four core modules: state encoding, structured policy functions, environment interaction, and policy optimization. State awareness: The system receives state input at each time step. This state encoding includes key information such as device attributes, communication digests, and topology characteristics; structured policy functions: policy network. Output Action That is, a set of activated rule sub-conditions and their corresponding thresholds; environment interaction: the action 'at' is mapped to a communication strategy and executed in the system, and the environment returns a reward. Reflects the effect of rule combination; Strategy optimization: Through the REINFORCE algorithm, the system calculates the gradient based on the cumulative reward Rt and updates the parameter θ after each round of interaction.
[0039] This embodiment, through continuous interaction and optimization, enables the policy function to dynamically adjust the activated rule sub-conditions and their judgment thresholds according to the environmental state, thereby achieving "automatic generation of structured rules". Ultimately, each policy outputs (It, φ) t This can be interpreted as a conditional rule structure in a communication system, injected into the knowledge base in the form of key-value pairs to improve the communication efficiency of the network. The overall training process of the reinforcement learning system is shown in Figure 6.
[0040] Analysis shows that the overhead and memory usage of this embodiment are controllable and reasonable. Its resource consumption is mainly proportional to the number of devices in the network and the duration of a single training session. This means that as the network scale expands, the computational cost of the algorithm will increase smoothly without an exponential explosive growth, and it has good scalability and practical feasibility for conventional-scale swarm intelligence computing scenarios. At the same time, it has excellent convergence performance, which is ensured by two key designs: (1) a structured action space design, which guides the algorithm to make meaningful decisions more effectively than blind exploration; (2) a carefully designed shaping reward mechanism, which significantly reduces the variance of gradient estimation by providing immediate and information-rich feedback signals, providing clear guidance for policy optimization, thereby greatly improving the stability and speed of training.
[0041] The proposed combination of rule tracking caching, usage frequency attribution, and shaped reward mechanism effectively overcomes the challenges of latency, combination, and sparse rewards in knowledge base-driven scheduling scenarios, providing an effective method for rule optimization in wireless communication. The structured reinforcement learning strategy achieves collaborative optimization of rule conditions and thresholds in a hybrid action space, enabling dynamic creation and updating of knowledge base rules to meet the communication needs of mobile swarm intelligence networks.
[0042] Example 4: A computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps of the task intelligent distribution method with a lightweight knowledge base in Example 1.
[0043] Example 5: A computer system, comprising: a memory for storing computer programs / instructions; and a processor for executing the computer programs / instructions to implement the steps of a task intelligent distribution method with a lightweight knowledge base as described in Example 1 or Example 2.
[0044] Example 6: Any one of Examples 1 to 5 was used for testing and analysis. The experimental results and analysis are as follows: First, the experimental procedure includes: This experiment utilizes the open urban traffic trajectory dataset CologneTrace, which covers over 700,000 real mobile device trajectories. This dataset is widely used for mobile network and group behavior modeling, providing a realistic foundation for modeling state transitions and interactions of reinforcement learning agents in multi-scale, high-density urban communication environments. The trajectory data records the mobile behavior of devices throughout a 24-hour period, encompassing the following spatial and temporal parameters: Spatial range: The unit is meters; Speed range: It covers scenarios ranging from low speed (such as pedestrians) to high speed (such as motor vehicles); Time range: Seconds, fully covering daytime peaks and nighttime troughs; Figure 7 and Figure 8 It shows the distribution characteristics of nodes in the geographic space and time dimensions.
[0045] Geographically, the areas with the most concentrated device activity are located in the intervals x∈[3000,6000] and y∈[12000,15000], reflecting the core communication load hotspots in the city. Temporally, the device density is mainly concentrated in the peak periods of 8–9 am and 12–1 pm, providing a basis for selecting strategies for generalization experiments under different data densities.
[0046] To build ubiquitous heterogeneous connectivity scenarios, each mobile node is represented as a type of intelligent device with a set of attributes. Including multiple network communication and system resource parameters, such as Figure 9 As shown.
[0047] Each node is assigned the above attributes, and its spatiotemporal location is replayed based on the trajectory data to form... A structured state description.
[0048] The experiment first initialized the heterogeneous devices based on the aforementioned movement trajectory data. After each node was assigned attributes such as communication protocol, energy consumption model, and communication range, the system entered the task simulation phase. Within the simulation time period, each node randomly generated task allocation data packets with a certain probability, and all communication behaviors were abstracted as "task allocation" requests. Each task packet was accompanied by a QEPD (Quick Estimated Processing Dependency).
[0049] The task data packet is broadcast by the source node to all neighboring nodes within its communication range. After receiving the packet, the neighboring nodes determine whether they meet the execution conditions based on the rules embedded in their local knowledge base. If they do, they execute the task directly; otherwise, they determine whether the task can be relayed to other neighboring nodes for distribution and computation, thus constructing a rule-driven distributed task processing flow.
[0050] Communication distance and energy consumption model: The calculation method for the communication range and energy consumption between nodes is as follows: Energy consumption for transmission during communication between nodes Based on distance threshold Segmentation is defined as: .
[0051] To comprehensively evaluate the performance of task distribution strategies in ubiquitous heterogeneous connectivity environments, this invention sets five core evaluation indicators from four dimensions: task completion efficiency, communication quality, resource allocation, and energy consumption. The specific definitions are as follows: Figure 9 , Figure 10 As shown.
[0052] Second, the experimental parameters include: To ensure the representativeness of the experimental data in geospatial space and the heterogeneity of self-organizing networks, this invention constructs multiple spatial sub-networks based on the CologneTrace dataset. The original coverage area of this dataset is divided into 10×10 grid regions, with each grid cell corresponding to a geographic space of 3km×3km. By statistically analyzing the node record density in each region, significant non-uniformity in node distribution is found, with some regions having a node density exceeding 3.5×10⁷, while most peripheral regions are sparsely populated.
[0053] Based on this, the present invention selects five typical regions, and the nodes in each region constitute an independent mobile swarm intelligence network (net). i Each region was sorted from low to high according to its node density, and different numbers of nodes were selected for experimental simulation, as follows: net1 (x=7, y=9), lowest node density, 10 nodes selected; net2 (x=3, y=7), 50 nodes selected; net3 (x=4, y=5), 80 nodes selected; net4 (x=6, y=3), 120 nodes selected; net5 (x=2, y=3), highest node density, 200 nodes selected. Each net i Each is an independent, self-organizing heterogeneous network sub-environment, with nodes communicating and building networks based on their protocol capabilities and geographical distance.
[0054] In the subsequent experiments, to support the state score calculation during the rule generation process, fixed weighting coefficients were assigned to multiple entity attributes of the device. Specifically, the weights of the five attributes—remaining energy, protocol matching degree, idle level, historical relay success rate, and communication bandwidth—were set as follows: The parameters are 0.35, 0.25, 0.15, 0.15, and 0.10. These parameters are used to construct the device's comprehensive scoring function φ(x), which serves as the basis for subsequent rule generation and behavior judgment. The learning rate is set to 0.01, the discount factor is 0.95, and the initial exploration rate of the ε-greedy policy is set to 0.3, gradually decreasing at a rate of 0.99.
[0055] Third, explanation and analysis of the effects of use, including: Based on the experimental setup of the aforementioned reinforcement learning system and rule generation mechanism, a time period from 08:00 to 08:30 (a total of 1800 seconds) was selected from the simulation dataset as the simulation period, and 1800 reinforcement learning iterations were completed. The experimental results are described below.
[0056] like Figure 11 As shown, in the initial exploration phase (0-300 seconds), the overall task completion rate was low (μ=0.32±0.07), and the network size had little impact on the results. After entering the rule-based optimization phase (300-1200 seconds), the completion rate of the large-scale network net5 (200 nodes) significantly improved, with a growth rate of 0.083±0.004 / s, compared to only 0.041±0.006 / s for net1 (10 nodes). This indicates that in networks with more nodes, rule evolution unfolds faster, and the system can continuously optimize through a positive feedback mechanism. By 1200 seconds, the completion rate of net5 reached 0.83, far exceeding net1's 0.57, further demonstrating that the more nodes there are, the more efficient the rule optimization becomes.
[0057] Entering the system decay phase (1200-1800 seconds), the task completion rate begins to decline as device energy gradually depletes. The decline rate for net5 is 0.097 / s, faster than net1's 0.032 / s, indicating that devices under high load are more prone to failure due to insufficient energy. According to monitoring data, 62.3% of high-load nodes have battery levels below the 20% threshold, directly impacting the execution of knowledge base rules and increasing the failure rate.
[0058] like Figure 12 As shown, in the initial stage (0-300 seconds), the communication latency fluctuated significantly (μ=683±112ms), with net5 reaching a maximum latency of 921ms, approximately 38.7% higher than net1. As the rules were gradually optimized (300-1200 seconds), the communication latency of net5 decreased significantly, dropping to a minimum of 156ms, a reduction of 83.1%, indicating that the introduction of QEPD effectively reduced redundant transmission. After 1500 seconds, the latency began to rise again, especially for net5, with an increase rate of 0.18ms / s. This was because some critical relay nodes went offline due to power depletion, causing an increase in the average path hop count and thus a significant increase in latency.
[0059] like Figure 13As shown, the evolution of network packet loss rate clearly reflects the effect of rule optimization. In the initial exploration phase (0-300 seconds), networks of all sizes exhibited high packet loss rates and instability, and the system had not yet formed an effective communication scheduling strategy. After entering the rule optimization phase (approximately 300-1200 seconds), the packet loss rate began to decrease significantly. In particular, for the large-scale network net5, its packet loss rate decreased most rapidly around 300 seconds, eventually decreasing by 82.4% overall, which perfectly matches the trend of tasks concentrating on high-load nodes. By around 1200 seconds, net5's packet loss rate had stabilized at an extremely low level of 0.031±0.004, and showed a significant negative correlation with the peak of task completion rate, demonstrating a significant improvement in link stability. However, during the system decay phase (1200-1800 seconds), as critical nodes went offline due to energy depletion, the network topology was disrupted, causing the packet loss rate to rebound rapidly. Its rate of increase was 4.2 times the rate of decrease during the optimization phase, and the system communication quality deteriorated accordingly.
[0060] Figure 14 The dynamic changes in node load distribution are demonstrated, revealing the process and scale effect of load optimization in the system. In the initial stage (0-300 seconds), tasks are randomly distributed, and the proportion of high-load nodes is generally low. After entering the optimization stage, this strategy drives tasks to concentrate on advantageous nodes, and the proportion of high-load nodes in net5 rapidly increases from 0.37 to 0.68, peaking at approximately 900 seconds. This process also significantly reduces the load Gini coefficient of net5, indicating that large-scale networks can more effectively integrate resources and achieve a higher degree of load balancing under rule guidance. However, in the system decay stage (after 1200 seconds), this highly concentrated load distribution also becomes a weakness of the system. Once these high-load nodes, which are the "main force," fail due to energy depletion, network performance drops sharply, and tasks cannot be processed effectively, verifying the vulnerability caused by over-concentration.
[0061] Finally, as Figure 15As shown, the cumulative energy consumption curve reflects the efficiency cost of rule optimization. In the initial stage (0-600 seconds), the energy consumption growth rate exhibits a non-linear relationship with the number of network nodes N. The system is exploring and building efficient communication links, and the energy consumption growth is relatively slow. Entering the middle stage (600-1200 seconds), as the load ratio reaches its peak and the network fully guarantees communication quality, the energy consumption growth slope of all networks becomes significantly steeper. The system uses higher energy consumption to maintain a low packet loss rate and a high task completion rate. It is worth noting that although net5 performs better in terms of performance, its energy consumption per unit load is about 37.5% higher than that of net1, indicating that the performance improvement is accompanied by a higher energy cost. After entering the system decay period, the cumulative energy consumption of net5 is the first to exceed the 35kJ threshold, which indicates that the energy reserves of a large number of nodes in the network have reached the critical point. Subsequently, the successive offline of key nodes leads to system performance collapse, which also shows that this balance of high energy consumption for high performance is temporary and cannot be maintained in the long term.
[0062] In summary, the proposed rule-optimization and reinforcement learning-based scheme achieves significant results across several key metrics. First, regarding task completion rate, the large-scale network net5 exhibits faster improvement speed and higher stability, demonstrating that the rule optimization mechanism can effectively tap into the network's potential when the number of nodes is sufficient. Second, communication latency decreases significantly as rules converge, especially between 300 and 1200 seconds, indicating that policy adjustment effectively reduces invalid transmissions and improves overall response efficiency.
[0063] Regarding network operational stability, the packet loss rate decreased significantly during the rule optimization phase and eventually stabilized at a low level, further validating the positive effect of load centralization on link stability. Simultaneously, load distribution also exhibited better balance, especially in large-scale networks, where task allocation among nodes was more rational, reducing the risk of localized congestion.
[0064] However, the energy cost of the system also needs to be considered. Although the network can maintain low latency and high task completion rate during the optimization phase, these performance improvements are accompanied by a certain degree of energy consumption, especially in the later stages of the system when some critical nodes experience performance decline due to energy depletion.
[0065] Overall, this solution demonstrates significant improvements in task efficiency, communication latency, and network stability, making it suitable for deployment in resource-constrained but task-intensive environments. Further optimization of the energy allocation strategy could potentially extend the system's effective uptime while simultaneously improving performance.
[0066] The above description is merely a specific embodiment of the present invention. Various examples and illustrations do not constitute a limitation on the substantive content of the present invention. Those skilled in the art can modify or transform the specific embodiments described above after reading the specification without departing from the essence and scope of the invention.
Claims
1. A task intelligent distribution method with a lightweight knowledge base, characterized in that, include: The source node broadcasts the task packet to neighboring nodes within its communication range; After receiving the task packet, the neighboring node uses the intelligent task distribution model to determine whether it meets the execution conditions according to the rules of the knowledge base. If the execution conditions are met, the task is executed directly. If the execution conditions are not met, it is determined whether the task relay can be forwarded to other neighboring nodes for distribution and computation, thereby constructing a rule-driven distributed processing flow.
2. The task intelligent distribution method with a lightweight knowledge base according to claim 1, characterized in that: The knowledge base structure includes: communication node entities, and data transmission entities, descriptor entities, perception task entities, network environment entities, and behavior log entities interconnected with the communication node entities; and the entity relationships and basic rules of the knowledge base are stored in an analysis-oriented columnar in-memory database.
3. The task intelligent distribution method with a lightweight knowledge base according to claim 1, characterized in that: The intelligent task distribution model includes: The policy function, and the state space, action space, and reward function interconnected with the policy function; The state space includes: modeling the environmental state as a multi-dimensional feature vector, where the environmental state includes device attributes, communication statistics, and local network features; constructing the acquired multi-dimensional feature vector into a state space with continuous and discrete variables; the state space S includes: device attribute vector, device communication summary, and local network communication summary; the system state vector is... , , , is the combination of the attributes and communication digest of the i-th device. Represents communication characteristics; continuous dimension With discrete dimension The algorithm is as follows: ; ; The action space includes: selecting appropriate actions based on the current state to update the rules within the action space, thereby optimizing the scheduling efficiency of communication and computing resources and obtaining a hybrid action space with both discrete and continuous characteristics; the actions are... , ; Represents the action space. ; Represents a power set. Let represent a continuous real-valued vector space of no more than M dimensions; The specific rule update strategy chosen by the agent at time step t represents the action; each action is formalized as a tuple: ; This represents the currently selected set of condition indices, corresponding to the set of candidate rule sub-conditions. It is a discrete subset; The reward function is: ,in, For delayed reward backtracking terms based on n-step return; For combined reward sharing items; α1, α2, and α3 are sparse reward mitigation terms; α1, α2, and α3 are weighting coefficients used to adjust the influence of the three types of reward terms. The policy function is: , Generate policy functions for structured actions; I t φ represents the set of activated subconditions; t Its corresponding threshold vector; structured action generation strategy function This network is used to simultaneously perform multi-label selection of rule sub-conditions and the generation of corresponding continuous thresholds; the policy network is state-driven and outputs structured actions. .
4. The task intelligent distribution method with a lightweight knowledge base according to claim 3, characterized in that: A state compression mechanism is introduced into the state space to embed the original state into a low-dimensional continuous space through dimensionality reduction mapping. Dimensionality reduction mapping uses principal component analysis as a linear dimensionality reduction method to perform eigenvalue decomposition on the covariance matrix of the state samples, extracting the eigenvalues of the samples. Each principal component constitutes a new input representation: ; For the dimensionality-reduced state embedding, Principal component transformation matrix, The mean of the state samples. To reduce the dimensionality of the target dimension, it is usually set to 1. .
5. The task intelligent distribution method with a lightweight knowledge base according to claim 4, characterized in that: Each action in the action space It is parsed into a formal rule, containing a three-layer structure. The first layer is: combining rule sub-conditions, letting... This represents a predefined set of rule sub-conditions, each sub-condition... Corresponding to the network state vector One-dimensional features in; set of indices in an action This represents the set of currently active subconditions; each activation condition... Corresponding to a continuous threshold Used as a criterion for judgment; The second layer structure consists of linear mapping of condition combinations and rule classification. To achieve joint modeling of sub-condition judgments, a weight coefficient vector is introduced. This indicates the importance of each sub-condition, which can be output by the policy network when generating actions; the current rule matching score. ;based on A fixed threshold segmentation mechanism is used to map continuous scores to discrete communication behavior types; based on The range of values the value falls into determines the type of behavior; The third layer of the structure consists of: finally, rule logic generation and knowledge base storage, where rules are selected. Then, the system will set the sub-conditions. Threshold The symbol mappings are filled into the template logic structure; the final generated rule structure is stored in the knowledge base database in the form of key-value pairs.
6. The task intelligent distribution method with a lightweight knowledge base according to claim 4, characterized in that: in, This is a summary of the state before the rules are deployed. To assess the summary status after the evaluation window ends; = ; Among them, g loss For packet loss rate, g succ For task success rate, g latency For communication delay; , For rules The confidence level, i.e., the success rate of task completion according to this rule; This indicates the actual application frequency in task distribution, that is, the number of times the above rules are used per unit of time, which is used to measure the universality and practicality of the rules. These are adjustable weighting parameters for confidence level and actual application frequency, used to balance the importance of the two factors.
7. The task intelligent distribution method with a lightweight knowledge base according to claim 4, characterized in that: The strategy function adopts a modular action generation mechanism, dividing the rule selection process into a condition selection module and a threshold generation module; The sub-condition selection module includes: a multi-label classifier, which accepts the current environment state. As input, the output is a real vector of dimension M. Each dimension corresponds to a candidate sub-condition. The probability vector is obtained after sigmoid activation. And a discrete selection vector is constructed by hard thresholding: , Sub-condition combinations are ; The threshold generation module includes: for each activated sub-condition The policy network outputs the corresponding continuous threshold. Output using a parameterized Gaussian strategy: , ; and Each condition is given by the output branch of the policy network for the i-th condition, and each branch of the network shares the underlying state feature extractor. The overall policy function maximizes the following objective function: Training is performed; the REINFORCE policy gradient method is used to update the parameters θ, enabling the generation rule combination and its threshold structure to maximize task reward in long-term interactions. The REINFORCE algorithm is a Monte Carlo sampling-based policy gradient method that maximizes the expected cumulative reward by directly optimizing the policy parameters, and is suitable for policy optimization problems in reinforcement learning.
8. The task intelligent distribution method with a lightweight knowledge base according to claim 1, characterized in that: The intelligent task distribution model is also connected to an online reinforcement learning system based on policy gradients. This online reinforcement learning system is based on the interaction of state, action, and reward, and uses the REINFORCE algorithm as its learning core to implement the structured policy function. End-to-end training; The online reinforcement learning system includes a state encoding module, a structured policy function module, an environment interaction module, and a policy optimization module; the state awareness module receives state input at each time step. This status code encodes key information such as device attributes, communication summary, and topology characteristics; Structured policy function module: Policy network Output Action This refers to a set of activated rule sub-conditions and their corresponding thresholds; Environment interaction module: Actions The policy is mapped to a communication strategy and executed in the system; the environment returns a reward r. t Reflecting the effect of rule combinations; Strategy optimization module: Through the REINFORCE algorithm, the system optimizes the strategy based on the cumulative reward R after each round of interaction. t Calculate the gradient and update the parameter θ; The reinforcement learning problem is formalized as a Markov decision process: ; Where S is the state space and A is the action space. γ is the transfer function, determined by the communication protocol and network evolution; r is the reward function, reflecting the performance gain or penalty brought about by rule execution; γ is the discount factor, measuring long-term returns.
9. A task intelligent distribution system with a lightweight knowledge base in mobile crowdsourcing computing, characterized in that: include; The acquisition module is used to acquire task packages; The task broadcast module is used by the source node to broadcast the task packet to neighboring nodes within the communication range; The task intelligent distribution module is used by neighboring nodes to determine whether they meet the execution conditions based on the rules of the knowledge base after receiving the task packet. If the execution conditions are met, the task is executed directly. If the execution conditions are not met, it is determined whether the task relay can be forwarded to the updated neighbor node for distribution and computation, thereby constructing a rule-driven distributed processing flow. The steps are for implementing the task intelligent distribution method with a lightweight knowledge base as described in any one of claims 1-8.
10. A computer-readable storage medium having a computer program / instructions stored thereon, characterized in that: When the computer program / instruction is executed by the processor, it implements the steps of the task intelligent distribution method with a lightweight knowledge base as described in any one of claims 1-8.