A home agent service method and system based on user behavior prediction
By constructing a user behavior topology map and extracting features to generate behavior feature vectors, the continuity problem of behavior feature recognition in smart homes is solved, improving the accuracy and response efficiency of service prediction and decision-making.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUTURE MAN (XIAMEN) ARTIFICIAL INTELLIGENCE CO LTD
- Filing Date
- 2026-04-17
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies in the smart home field lack the ability to continuously process multi-source behavioral data, making it difficult for behavioral feature recognition to reflect the evolution of user behavior and affecting the accuracy of service prediction and decision-making.
By collecting behavioral data in the home IoT environment, generating behavioral event sequence data, constructing a user behavior topology map and extracting features, generating behavioral feature vectors, combining home environment status information to predict demand and make service decisions, and generating target service instructions to control home devices.
It enables the identification of behavioral features in continuous behavioral scenarios, improving the accuracy of behavioral feature identification and the scenario adaptability and response effectiveness in the service generation process.
Smart Images

Figure CN122496341A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of behavioral feature recognition technology, and in particular to a method and system for providing home intelligent agent services based on user behavior prediction. Background Technology
[0002] With the continuous development of home IoT, smart home control, and home intelligent agent services technologies, the data interconnection, status awareness, and automatic control capabilities among home devices are constantly improving. The technical approach of service prediction and proactive response based on user behavior data is gradually becoming an important development direction in the smart home field. Existing solutions typically analyze user behavior by collecting device status information, environmental perception information, and user interaction information, and combine this with model reasoning to achieve service recommendation or device linkage control. Among these, behavioral feature recognition has become a crucial technological foundation for improving the accuracy and scenario adaptability of home intelligent agent services.
[0003] While existing technologies can trigger services to some extent based on device status information or environmental parameters, in complex home scenarios, multi-source behavioral data typically exhibits discrete, temporal, and correlated characteristics simultaneously. Current solutions often process behavioral data at the level of single-event matching or simple temporal judgment, lacking the ability to perform structured modeling for continuous behavioral paths. This results in behavioral feature recognition failing to fully reflect the evolution of user behavior, thus affecting the accuracy of subsequent demand prediction and service decisions. Therefore, improving the effectiveness of behavioral feature recognition in continuous behavioral scenarios within the smart home field has become a critical technical problem that urgently needs to be solved. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a home intelligent agent service method based on user behavior prediction to solve the problem of insufficient accuracy in behavioral feature recognition in continuous behavior scenarios in the field of smart homes.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for providing a home intelligent agent service based on user behavior prediction, comprising, Collect and encode user behavior data in the home IoT environment to generate behavioral event sequence data; A user behavior topology map is constructed based on behavioral event sequence data, and features are extracted to generate behavioral feature vectors. The behavioral feature vectors are input into the demand prediction model to predict demand, and combined with the information on the state of the household environment for screening to generate a set of candidate services. The behavioral feature vector, candidate service set, and home environment status information are input into the service decision model to make service trigger decisions and generate target service instructions. Control home devices to perform corresponding operations according to the target service instructions.
[0007] As the home intelligent agent service method based on user behavior prediction according to the present invention, the process of acquiring the behavior event sequence data specifically includes: Collect user behavior data in the home IoT environment. The behavior data includes device status data, environmental perception data, and user interaction data. The behavioral data is synchronized over time, and data alignment, outlier removal and normalization are performed sequentially to form standardized time series data. User behavior events are extracted from normalized time series data using a behavior recognition model; User behavior events are encoded and arranged in chronological order to generate behavior event sequence data.
[0008] As the family intelligent agent service method based on user behavior prediction according to the present invention, the process of constructing a user behavior topology graph and extracting features specifically includes: The behavioral event sequence data is divided into behavioral event sets according to the time order; Based on the set of behavioral events, each behavioral event is mapped to a corresponding node, and node data is generated. Based on the chronological order of behavioral events in the behavioral event sequence data, connections are established between node data, and the number of connections between nodes is counted to obtain node connection data. The node connection data is normalized, and a user behavior topology graph is constructed based on the normalized node connection data. Feature calculations are performed on node data and node connection data in the user behavior topology graph to generate behavior feature vectors.
[0009] As the home intelligent agent service method based on user behavior prediction described in this invention, the step of inputting the behavior feature vector into the demand prediction model for demand prediction specifically includes: Verify the data format of the behavioral feature vector to obtain valid feature data; Construct effective feature data based on the input requirements of the demand forecasting model, and generate model input feature data; The model inputs feature data into the demand prediction model for inference, and the demand prediction results are obtained. The demand forecast results are analyzed to obtain user demand information containing service identifiers.
[0010] As the home intelligent agent service method based on user behavior prediction described in this invention, the step of filtering by combining home environment status information to generate a candidate service set specifically includes: Obtain and parse the home environment status information to obtain the current environmental status parameters; Extract the service identifier from the user's request information to obtain the initial service result; The initial service results are filtered based on the current environmental status parameters to obtain the filtered service results. The results of the service screening are organized into structured data to generate a candidate service set.
[0011] As the home intelligent agent service method based on user behavior prediction described in this invention, the step of obtaining home environment status information specifically includes: Collect environmental sensing data and device operating status data in the home IoT environment; The environmental perception data and equipment operation status data are synchronized in time to obtain aligned status data. The aligned state data is processed to remove abnormal data, resulting in valid state data; State parameters are extracted from valid state data to generate home environment state information.
[0012] As the home intelligent agent service method based on user behavior prediction according to the present invention, the generation of target service instructions specifically includes: Integrate behavioral feature vectors, candidate service sets, and home environment status information into the model input data for the service decision model; The model input data is fed into the service decision model for inference and calculation processing to determine the target service item from the candidate service set; Determine the target home appliances based on the target service items; Based on the target service item and the home environment status information, determine the service parameters corresponding to the target service item and generate service parameter data; Based on the target home devices, target service items, and service parameter data, the target service instructions are generated by mapping fields and encapsulating instructions according to the device control protocol corresponding to the target home devices.
[0013] As the home intelligent agent service method based on user behavior prediction described in this invention, the step of integrating and processing the behavioral feature vector, candidate service set, and home environment status information specifically includes: Convert behavioral feature vectors into standardized feature data; Extract the service identifier information of each service item from the candidate service set, and encode the service identifier information into service code data; Map the status parameters in the home environment status information to environmental status coded data; Standardized feature data, service coding data, and environmental state coding data are concatenated to generate model input data.
[0014] As the home intelligent agent service method based on user behavior prediction described in this invention, the step of controlling home devices to perform corresponding operations according to target service instructions specifically includes: Parse the instruction fields in the target service instruction to extract device identification information and control parameter information; Based on the device identification information, locate the device and identify the target household device; Based on the control parameter information, encapsulate the device control instructions according to the device control protocol corresponding to the target home device, and generate device control data; The device control data is sent to the target home device, and the target home device performs the corresponding operation.
[0015] Secondly, the present invention provides a home intelligent agent service system based on user behavior prediction, comprising, The data processing module is used to collect user behavior data in the home IoT environment, encode the behavior data, and generate behavior event sequence data. The behavior modeling module is used to construct a user behavior topology map based on behavior event sequence data, and to extract features to generate behavior feature vectors. The demand forecasting module is used to input behavioral feature vectors into the demand forecasting model to predict demand, and to filter them in combination with household environment status information to generate a set of candidate services. The service decision module is used to input behavioral feature vectors, candidate service sets, and home environment status information into the service decision model to make service trigger decisions and generate target service instructions. The device execution module is used to control home devices to perform corresponding operations based on the target service instructions.
[0016] The beneficial effects of this invention are as follows: By constructing a user behavior topology map based on behavioral event sequence data and extracting features to generate behavioral feature vectors, discrete user behavior events are further transformed into structured behavioral association information containing behavioral sequence relationships, behavioral transition relationships, and behavioral path relationships. Based on node data and node connection data, behavioral feature recognition for continuous behavioral processes is completed, enabling the behavioral feature recognition results to not only characterize a single behavioral event itself, but also reflect the continuous evolution law and correlation strength between multiple behavioral events. The behavioral feature vectors formed on this basis can provide a more complete and stable input basis for subsequent demand prediction, thereby enhancing the ability to depict the real service needs of users in the home IoT environment and improving the scenario adaptability and service response effectiveness in the subsequent service generation process. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a home intelligent agent service method based on user behavior prediction.
[0019] Figure 2 This is a module diagram of a home intelligent agent service system based on user behavior prediction.
[0020] Figure 3 A flowchart for generating target service instructions.
[0021] Figure 4 A flowchart for controlling home devices to perform corresponding operations based on target service instructions. Detailed Implementation
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0025] Reference Figures 1-4 As one embodiment of the present invention, this embodiment provides a method for providing home intelligent agent services based on user behavior prediction, including the following steps: S1. Collect user behavior data in the home IoT environment and encode it to generate behavior event sequence data.
[0026] S1.1. Collect user behavior data in the home IoT environment. The behavior data includes device status data, environmental perception data, and user interaction data. It should be explained that the operation records of home devices are obtained through the device communication interface corresponding to the home devices, and the switch status, operation mode and running time are extracted from the operation records to form device status data; environmental sensing records are obtained through the data acquisition interface corresponding to the environmental sensors, and temperature, humidity, light intensity and air quality parameters are extracted from the environmental sensing records to form environmental perception data; operation logs are obtained through the log recording interface corresponding to the user interaction terminal, and control commands, trigger time, operation type are extracted from the operation logs to form user interaction data; the device status data, environmental perception data and user interaction data are summarized to obtain user behavior data in the home IoT environment.
[0027] S1.2. Synchronize the behavioral data over time, and sequentially complete data alignment, outlier data removal, and normalization to form standardized time series data; It should be explained that the timestamp information corresponding to the device status data, environmental perception data, and user interaction data in the behavioral data is extracted, and the device status data, environmental perception data, and user interaction data are arranged on the same time axis according to a unified time base; based on the timestamp correspondence, the device status data, environmental perception data, and user interaction data at the same sampling time are matched to form aligned behavioral data; abnormal records in the aligned behavioral data are identified based on the device range, the reasonable range of environmental parameters, and the range of user interaction record formats. The device range comes from the device operating parameter information corresponding to the device status data, the reasonable range of environmental parameters comes from the sensor acquisition range and historical acquisition record statistical results corresponding to the environmental perception data, and the user interaction record format range comes from the control command field format definition and operation log field format definition generated by the user interaction terminal; after deleting abnormal records, valid behavioral data is formed; the numerical fields in the valid behavioral data are extracted, and normalization calculations are performed according to the minimum and maximum values of each numerical field in the valid behavioral data, where the minimum and maximum values come from the statistical results of each numerical field in the valid behavioral data, forming standardized time series data.
[0028] S1.3. Extract user behavior events from normalized time series data using a behavior recognition model; It should be noted that the normalized time series data is divided according to chronological order. Based on a unified time axis, the normalized time series data is divided into continuous time segments. The length of each continuous time segment is determined based on the statistical results of the time intervals between adjacent behavioral change records in the historical normalized time series data. The device status change information, environmental perception change information, and user interaction change information in each continuous time segment are sequentially connected according to the order of input features to form the input data for the behavior recognition model. The behavior recognition model is a recurrent neural network structure, including an input layer, a first long short-term memory network layer, a second long short-term memory network layer, and an output layer. The input layer dimension corresponds to the number of feature terms for device status change information, environmental perception change information, and user interaction change information. The short-term memory network layer has a dimension of 64, the second long short-term memory network layer has a dimension of 32, and the output layer dimension corresponds to the number of user behavior categories. Network connections are established from the input layer to the output layer, and a one-to-one correspondence is established between each output node and a user behavior category. Historical normalized time-series data is divided into continuous time segments. Device status change information, environmental perception change information, and user interaction change information in each time segment are connected in order of input features to form training input data. Labeled user behavior categories are used as training labels. The training input data is input into the behavior recognition model, and network parameters are adjusted based on the difference between the output result and the training label until the output node result corresponding to the training label is maximized, thus completing the behavior recognition model training. The recognition results corresponding to each user behavior category are compared, and the user behavior category with the largest recognition result is determined as the user behavior category corresponding to the current continuous time segment, obtaining the behavior category result. The behavior category result is associated with the start and end times of the current continuous time segment to generate a user behavior event.
[0029] S1.4. Encode user behavior events and arrange them in chronological order to generate behavior event sequence data; It should be explained that the process involves reading the behavior category results, start time, and end time from user behavior events, and converting the behavior category results into corresponding event code values based on the correspondence between the behavior category results and event code values. The correspondence between the behavior category results and event code values is the encoding mapping relationship corresponding to each behavior category result. The event code values are associated with the corresponding start time and end time to form encoded user behavior events. All encoded user behavior events are arranged in chronological order according to their start times, and then all the arranged encoded user behavior events are organized into a continuous sequence to generate behavior event sequence data.
[0030] S2. Construct a user behavior topology map based on behavioral event sequence data and extract features to generate behavioral feature vectors.
[0031] S2.1. Divide the behavioral event sequence data into behavioral event sets according to the time order; It should be noted that each coded user behavior event in the behavioral event sequence data is sequentially split, and the start and end times recorded in each coded user behavior event are extracted. The user behavior events are then traversed sequentially according to the order of their start times. During the traversal, consecutive user behavior events are segmented according to the time window length. User behavior events within the same time window are grouped together. The time window length is determined based on the statistical results of the time interval distribution of user behavior events in the historical normalized time series data. The time window range is formed with the start time of the current user behavior event as the starting point and the end time corresponding to the time window length as the ending point. After traversing all user behavior events, multiple grouping results are obtained, and each group of user behavior events is determined as a set of behavior events.
[0032] S2.2. Based on the set of behavioral events, map each behavioral event to a corresponding node and generate node data; It should be noted that the process involves reading each behavior event from the set of behavior events and extracting the behavior category result and time interval information corresponding to each behavior event. The time interval information includes the start and end times of each behavior event. Each behavior event is then mapped to a corresponding node. The mapping method involves generating a graph structure node for each behavior event in the user behavior topology graph, ensuring a one-to-one correspondence between each behavior event and a graph structure node. The graph structure node is used to represent each behavior event. The behavior category result and time interval information are then written into the corresponding node to generate node data.
[0033] S2.3. Based on the chronological order of behavioral events in the behavioral event sequence data, establish connections between node data and count the number of connections between nodes to obtain node connection data; It should be noted that the node data is arranged sequentially according to the time order in the behavioral event sequence data, and adjacent node data is read in turn. For each pair of adjacent node data, the connection relationship between the previous node data and the next node data is determined. The previous node data is recorded as the starting node data and the next node data as the ending node data to form a directed connection relationship. After completing the traversal of all adjacent node data, all directed connection relationships are classified and summarized according to the same starting node data and ending node data, and the occurrence count of each type of directed connection relationship is accumulated to generate node connection data containing connection relationships and corresponding connection counts.
[0034] S2.4. Normalize the node connection data and construct a user behavior topology graph based on the normalized node connection data; It should be noted that the connection counts for each connection relationship in the node connection data are extracted to determine the maximum and minimum connection counts for all connections. Based on the maximum and minimum connection counts, the connection counts for each connection relationship are normalized to map them to a unified numerical range. This unified numerical range is the same range of values used for the connection counts of each connection relationship after normalization. After normalizing the node connection data, node identification information is extracted from the node data, and the starting and ending nodes for each normalized connection relationship are determined based on the node identification information. The node data is then identified as nodes in the user behavior topology graph, and the normalized connection relationships are identified as edges in the user behavior topology graph used to represent the sequential relationships between nodes. The normalized connection counts are recorded as the edge weights of the corresponding edges to generate the user behavior topology graph.
[0035] S2.5. Perform feature calculations based on node data and node connection data in the user behavior topology graph to generate behavior feature vectors; It should be noted that when performing feature calculation based on the user behavior topology graph, node data and node connection data are extracted from the user behavior topology graph, and these node data and node connection data are used as the feature calculation objects. Node data is used to represent each behavioral event node in the user behavior topology graph, and node connection data is used to represent the sequential connection relationships between each behavioral event node. The number of connections each behavioral event node participates in is counted based on the node connection data, the number of connections formed between each behavioral event node and other behavioral event nodes is counted based on the node connection data, and the number of nodes traversed from the starting node to the ending node in the user behavior topology graph is counted to obtain the structural feature results corresponding to each behavioral event node. The number of connections, the number of connections, and the number of nodes traversed from the starting node to the ending node corresponding to each behavioral event node are arranged sequentially according to the feature item type to form a feature set used to represent the structural features of the user behavior topology graph. The feature set is then organized according to the order of connection count, the number of connections, and the number of nodes traversed from the starting node to the ending node to generate a behavioral feature vector.
[0036] S3. Input the behavioral feature vector into the demand prediction model to predict demand, and combine it with the family environment status information for screening to generate a set of candidate services.
[0037] S3.1. Verify the data format of the behavioral feature vector to obtain valid feature data; It should be noted that when validating the data format of the behavioral feature vector, the feature items are checked sequentially according to their order of appearance within the vector. The check proceeds from the first feature item to the last. During the check, it is determined whether any feature item contains null values, missing values, abnormal characters, or abnormal values. A null value indicates that no numerical content was written to the corresponding position of the feature item; a missing value indicates that the corresponding position of the feature item lacks the expected numerical value; an abnormal character indicates that the corresponding position of the feature item contains non-numerical characters; and an abnormal value indicates that the corresponding position of the feature item exceeds the normal value range formed by historical behavioral feature vector statistics. If a feature item cannot be completed, it is removed. If a feature item can be completed, it is replaced with the value of the same type of feature item in an adjacent position. After completing all feature item checks, the number and order of feature items in the behavioral feature vector are checked for consistency to generate valid feature data.
[0038] S3.2. Construct effective feature data based on the input requirements of the demand forecasting model, and generate model input feature data; It should be noted that the effective feature data is constructed according to the input requirements of the demand prediction model. The input requirements of the demand prediction model refer to the arrangement order of feature terms when receiving the behavioral feature vector. This arrangement order is the order in which each feature term in the behavioral feature vector is arranged in the input layer of the demand prediction model. Based on the input requirements of the demand prediction model, the feature terms in the effective feature data are rearranged, and the rearranged feature terms are then connected sequentially according to the receiving order of the demand prediction model's input layer to form the model input feature data. The number of feature terms in the model input feature data is consistent with the dimension of the demand prediction model's input layer. The demand prediction model is a multi-layer fully connected neural network structure, including an input layer, a first fully connected layer, a second fully connected layer, and an output layer. The dimension of the input layer is the number of feature terms in the behavioral feature vector. The dimension of the first fully connected layer is 128, and the dimension of the second fully connected layer is... 64. The output layer dimension is the number of demand categories. When constructing the demand prediction model, network connections are established in the order of input layer, first fully connected layer, second fully connected layer, and output layer, and a one-to-one correspondence is established between each output node of the output layer and each demand category. When training the demand prediction model, historical behavior feature vectors are arranged according to the order received by the input layer of the demand prediction model, and the arranged feature items are connected sequentially to form historical model input feature data. The demand categories in the historical user demand information are used as training labels. The historical model input feature data is input into the input layer of the demand prediction model. The historical model input feature data is processed sequentially through the input layer, first fully connected layer, second fully connected layer, and output layer. The network parameters are adjusted according to the difference between the output layer results and the training labels until the output node results corresponding to the demand categories corresponding to the training labels in the output layer are maximized, thus completing the demand prediction model training.
[0039] S3.3. Input the model input feature data into the demand forecasting model for inference to obtain the demand forecasting results; It should be noted that the input feature data is fed into the input layer of the demand forecasting model. The input feature data is processed sequentially through the input layer, the first fully connected layer, the second fully connected layer, and the output layer. The output layer outputs the predicted values corresponding to each demand category in the order of demand categories. The order of demand categories is the same as the order used when establishing a one-to-one correspondence between each output node of the output layer and each demand category during the construction of the demand forecasting model. Each demand category and its corresponding predicted value are recorded one-to-one to form the demand forecasting result.
[0040] S3.4. Parse the demand forecast results to obtain user demand information containing service identifiers; It should be noted that the demand forecasting results are analyzed, and the demand forecasting results are corresponding records of each demand category and its corresponding output results. The output results corresponding to each demand category are extracted, and each output result is compared item by item according to its numerical value. The item-by-item comparison is to compare the numerical values of the output results corresponding to each demand category in turn and retain the demand category corresponding to the current largest output result. After completing the comparison of the output results corresponding to all demand categories, the demand category with the largest output result is determined as the target demand category. The target demand category is the type of service demand that users may generate in the home IoT environment. According to the target demand category, the corresponding service identifier is found in the service rule configuration data, and the target demand category and service identifier are associated and recorded to generate user demand information containing the service identifier.
[0041] S3.5. Obtain and parse the home environment status information to obtain the current environment status parameters; It should be noted that after obtaining the home environment status information, the home environment status information is parsed to extract the environmental parameters and device status parameters. The environmental parameters are environmental sensing parameters such as temperature, humidity and light intensity in the home IoT environment, and the device status parameters are the operating status parameters of each home device in the home IoT environment. The environmental parameters are written into the environmental parameter field, and the device status parameters are written into the device status parameter field to form the current environmental status parameters.
[0042] S3.6. Extract the service identifier from the user's request information to obtain the initial service result; It should be noted that when extracting service identifiers from user demand information, the target demand category is extracted first; then, the target demand category and service identifier are matched according to the correspondence between the target demand category and the service identifier in the service rule configuration data, which records the service identifiers corresponding to different demand categories; the matched service identifier information is then summarized to form the initial service result.
[0043] S3.7. Filter the initial service results based on the current environment status parameters to obtain the filtered service results; It should be noted that when filtering the initial service results based on the current environmental state parameters, each service identifier in the initial service results is extracted, and the environmental constraint information corresponding to each service identifier is obtained. The environmental constraint information consists of the environmental restrictions that are retained for each service identifier during the formation of the candidate service set. The range of environmental parameter values is the allowable range of environmental parameters such as temperature, humidity, and light intensity defined in the environmental constraint information. The temperature, humidity, and light intensity in the current environmental state parameters are compared with the range of environmental parameter values corresponding to each service identifier, and the equipment status parameters are matched with the equipment status conditions defined in the environmental constraint information. When the environmental parameters fall within the corresponding range of environmental parameter values and the equipment status parameters meet the corresponding equipment status conditions, the corresponding service identifier is retained; otherwise, the corresponding service identifier is removed. The retained service identifiers are summarized to obtain the filtered service results.
[0044] S3.8. Organize the filtered service results into structured data and generate a candidate service set; It should be noted that the service identifiers in the filtered service results are structured according to a unified field structure, which includes service identifier information, service name, device identifier information, and control parameter information for each service identifier. Based on each service identifier, the corresponding service identifier information is extracted from the filtered service results, and the service name, device identifier information, and control parameter information corresponding to each service identifier are determined. The service identifier information, service name, device identifier information, and control parameter information are written into the corresponding fields to form each service item. The service items are then grouped according to the order of the service identifiers in the filtered service results to generate a candidate service set.
[0045] S4. Input the behavioral feature vector, candidate service set, and home environment status information into the service decision model to make service trigger decisions and generate target service instructions.
[0046] S4.1. Integrate behavioral feature vectors, candidate service sets, and home environment status information into the model input data for the service decision model; It should be noted that the behavioral feature vector is converted into standardized feature data, the service identification information in the candidate service set is converted into service coding data, and the status parameters in the home environment status information are converted into environment status coding data. The standardized feature data is arranged first, the service coding data is arranged in the middle, and the environment status coding data is arranged last. They are then connected in the above order to form the model input data of the service decision model.
[0047] S4.2. Input the model input data into the service decision model for inference and calculation processing, and determine the target service item from the candidate service set; It should be noted that the model input data formed in S4.1 is input into the input layer of the service decision model. The model input data is processed sequentially through the input layer, the first fully connected layer, the second fully connected layer, and the output layer. The output layer outputs the service trigger results corresponding to each service item according to the order of service items in the candidate service set. The service trigger results are the output results corresponding to each service item under the current behavior feature vector, the current candidate service set, and the current home environment status information. The service decision model is a multi-layer fully connected neural network structure, including an input layer, a first fully connected layer, a second fully connected layer, and an output layer. The dimension of the input layer is the total number of input items in the model input data, the dimension of the first fully connected layer is 128, the dimension of the second fully connected layer is 64, and the dimension of the output layer is the number of service items in the candidate service set. When constructing the service decision model, the standardized feature data is arranged first, the service coding data is arranged in the middle, and the environmental status coding data is arranged last, forming the order of the input layer fields. The network connection relationship is established according to the order of the input layer, the first fully connected layer, the second fully connected layer, and the output layer, and each output node of the output layer is connected to the candidate service set. Each service item in the service set is established with a one-to-one correspondence according to its order. During service decision model training, historical behavioral feature vectors are converted into historical standardized feature data, service identifier information in the historical candidate service set is converted into historical service coding data, and state parameters in historical home environment status information are converted into historical environment status coding data. The historical standardized feature data is arranged first, followed by the historical service coding data, and then the historical environment status coding data, and these are connected sequentially in the above order to form the historical model input data. The service items actually executed in the historical candidate service set are used as training labels. The historical model input data is input into the input layer of the service decision model, and the historical model input data is processed sequentially through the input layer, the first fully connected layer, the second fully connected layer, and the output layer. The network parameters are adjusted based on the difference between the output layer results and the training labels until the output node result corresponding to the service item corresponding to the training label in the output layer is maximized, thus completing the service decision model training. The service trigger results corresponding to each service item are compared, and the service item with the largest service trigger result is determined as the target service item.
[0048] S4.3. Determine the target home appliances based on the target service items; It should be noted that when determining the target home device based on the target service item, the service identifier information in the target service item is matched with the service identifier information in the service rule configuration data. The service rule configuration data is formed by correspondingly organizing the device identifier information, device type information, and service control relationships in the device control protocol definition in the home device registration information table. The service control relationship is the association between different service identifier information and the corresponding device identifier information. When the service identifier information matches, the device identifier information corresponding to the service identifier information is determined. The device identifier information is matched with the device identifier information in the home device registration information table. When the match is consistent, the corresponding device record is determined and identified as the target home device.
[0049] S4.4. Based on the target service item and the home environment status information, determine the service parameters corresponding to the target service item and generate service parameter data; It should be noted that when determining the service parameters corresponding to the target service item based on the target service item and the home environment status information, the service identifier information in the target service item is matched with the service identifier information in the service rule configuration data to determine the control parameter definition information corresponding to the service identifier information. The control parameter definition information records the environmental parameter association relationship and parameter value correspondence relationship corresponding to each control parameter. The environmental parameter association relationship is the association relationship between each control parameter and the corresponding environmental parameters in temperature, humidity, and light intensity. The parameter value correspondence relationship is the control parameter value corresponding to different environmental parameter value ranges. The environmental parameter values in the current home environment status information are matched item by item with the environmental parameter value ranges in the control parameter definition information. When the environmental parameter value falls into the corresponding environmental parameter value range, the corresponding control parameter value is determined. After the values of each control parameter are determined, the service parameter data corresponding to the target service item is generated.
[0050] S4.5. Based on the target home device, target service item, and service parameter data, perform field mapping and instruction encapsulation according to the device control protocol corresponding to the target home device to generate the target service instruction; It should be noted that when generating the target service instruction based on the target home device, target service item, and service parameter data, the device type and device identification information corresponding to the target home device are read, the service identification information in the target service item is read, and the values of each control parameter in the service parameter data are read. The instruction field structure corresponding to the target service item is found in the device control protocol definition corresponding to the target home device. According to the field order in the device control protocol definition, the device identification information of the target home device, the control command corresponding to the target service item, and the values of each control parameter are written into the corresponding instruction fields. After completing the writing of each instruction field, the target service instruction is formed by combining them according to the device control protocol definition.
[0051] S4.6. Extract the service identifier information of each service item from the candidate service set, and encode the service identifier information into service code data; It should be noted that when extracting service identifier information for each service item based on the candidate service set and encoding the service identifier information, each service item in the candidate service set is read, and the corresponding service identifier information is extracted from each service item. According to the predefined correspondence between service identifiers and numerical codes in the service rule configuration data, the extracted service identifier information is matched and searched one by one, and each service identifier is converted into a corresponding numerical code. For example, "lighting control service identifier" is encoded as 1, and "air conditioning control service identifier" is encoded as 2. The service rule configuration data is established by organizing and establishing the function definition of home devices, the device control protocol definition, and the user's common service scenarios. During the configuration process, the service identifier, triggering conditions, control parameters, and encoding rules corresponding to each service are uniformly recorded and formed into a structured data table for matching between service identifiers and codes. After all service identifiers are encoded, the encoding results are arranged according to the order of service items in the candidate service set to generate service code data.
[0052] S4.7. Map the status parameters in the home environment status information to environmental status coded data; It should be noted that when mapping the state parameters in the home environment status information, the state parameters corresponding to temperature, humidity, light intensity, and equipment operating status are extracted from the home environment status information. The state parameters corresponding to temperature, humidity, and light intensity are compared with the environmental parameter segment intervals used by the service decision model when receiving the home environment status information, and a corresponding code value is assigned when the state parameter falls into the corresponding environmental parameter segment interval. The environmental parameter segment interval is a series of continuous value intervals formed by dividing different value ranges of the same environmental parameter. The state parameters corresponding to the equipment operating status are mapped according to the one-to-one correspondence between the equipment operating status and the code value. The one-to-one correspondence between the equipment operating status and the code value is a mapping relationship in which different equipment operating statuses are respectively mapped to different code values. The mapped state parameters are combined according to the arrangement order in the home environment status information to generate environmental status code data.
[0053] S4.8. Combine the standardized feature data, service coding data, and environmental status coding data to generate model input data; It should be noted that standardized feature data is used as feature input data, service-coded data as service input data, and environmental state-coded data as environmental input data. Standardized feature data is the data result obtained by transforming behavioral feature vectors, service-coded data is the data result obtained by encoding service identification information in the candidate service set, and environmental state-coded data is the data result obtained by mapping state parameters in the household environmental state information. The feature input data, service input data, and environmental input data are sequentially concatenated in the order of the content corresponding to the behavioral feature vector first, the content corresponding to the candidate service set in the middle, and the content corresponding to the household environmental state information last, forming a concatenated data sequence. The concatenated data sequence is determined as the model input data of the service decision model.
[0054] S5. Control home devices to perform corresponding operations according to the target service instructions.
[0055] S5.1. Parse the instruction field in the target service instruction and extract the device identification information and control parameter information; It should be noted that the target service instruction is split according to the instruction fields contained in the target service instruction. The instruction fields are the fields in the target service instruction used to represent device identification information and control parameter information, respectively. The field used to uniquely identify the target home device is parsed from the instruction field used to represent device identification information, which serves as the device identification information. The parameter content used to control the target home device to perform the operation corresponding to the target service item is parsed from the instruction field used to represent control parameter information, which serves as the control parameter information, thus obtaining the device identification information and control parameter information.
[0056] S5.2. Locate the device based on its identification information to determine the target household device; It should be noted that when performing device location processing based on device identification information, the unique identifier field in the device identification information is read and matched against the home device registration information table. The home device registration information table is a data table formed by registering all devices in the home IoT environment, containing the correspondence between device identification information, device network address, and device type. By comparing each piece of device identification information, the record that matches the device identification information is located, and the corresponding device network address and device type information are extracted. The device communication interface is accessed based on the device network address to determine the corresponding target home device. After completing the matching and location process, the target home device is determined.
[0057] S5.3. Based on the control parameter information, encapsulate the device control instructions according to the device control protocol corresponding to the target home device, and generate device control data; It should be noted that when encapsulating device control commands based on control parameter information, the values of each control parameter in the control parameter information are read. The control parameter information originates from the service parameter data generated by determining the service parameters corresponding to the target service item based on the target service item and the home environment status information. The corresponding command field structure is searched in the device control protocol definition, and the values of each control parameter are written into the corresponding command field positions according to the field order and format requirements in the device control protocol definition. After the field filling is completed, the data of each field is combined sequentially according to the device control protocol definition, and format encapsulation processing is performed to generate device control data.
[0058] S5.4. Send the device control data to the target home device, and have the target home device perform the corresponding operation; It should be noted that when sending device control data to the target home device, the communication address information corresponding to the target home device is read, and the device control data is sent through the device communication interface corresponding to the target home device; after receiving the device control data, the target home device parses the control commands and control parameters in the device control data according to the device control protocol, and executes the corresponding operation.
[0059] In summary, this invention constructs a user behavior topology map based on behavioral event sequence data and extracts features to generate behavioral feature vectors. This transforms discrete user behavior events into structured behavioral association information that includes behavioral sequence relationships, behavioral transition relationships, and behavioral path relationships. Based on node data and node connection data, it completes behavioral feature recognition for continuous behavioral processes. This allows the behavioral feature recognition results to not only characterize a single behavioral event but also reflect the continuous evolutionary patterns and correlation strengths between multiple behavioral events. The resulting behavioral feature vectors provide a more complete and stable input basis for subsequent demand prediction, thereby enhancing the ability to depict the real service needs of users in the home IoT environment and improving the scenario adaptability and service response effectiveness in the subsequent service generation process.
[0060] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A home agent service method based on user behavior prediction, characterized in that: include, Collect and encode user behavior data in the home IoT environment to generate behavioral event sequence data; A user behavior topology map is constructed based on behavioral event sequence data, and features are extracted to generate behavioral feature vectors. The behavioral feature vectors are input into the demand prediction model to predict demand, and combined with the information on the state of the household environment for screening to generate a set of candidate services. The behavioral feature vector, candidate service set, and home environment status information are input into the service decision model to make service trigger decisions and generate target service instructions. Control home devices to perform corresponding operations according to the target service instructions.
2. The home intelligent agent service method based on user behavior prediction as described in claim 1, characterized in that: The process of acquiring the behavioral event sequence data specifically includes, Collect user behavior data in the home IoT environment. The behavior data includes device status data, environmental perception data, and user interaction data. The behavioral data is synchronized over time, and data alignment, outlier removal and normalization are performed sequentially to form standardized time series data. User behavior events are extracted from normalized time series data using a behavior recognition model; User behavior events are encoded and arranged in chronological order to generate behavior event sequence data.
3. The home intelligent agent service method based on user behavior prediction as described in claim 1, characterized in that: The process of constructing a user behavior topology map and extracting features specifically includes, The behavioral event sequence data is divided into behavioral event sets according to the time order; Based on the set of behavioral events, each behavioral event is mapped to a corresponding node, and node data is generated. Based on the chronological order of behavioral events in the behavioral event sequence data, connections are established between node data, and the number of connections between nodes is counted to obtain node connection data. The node connection data is normalized, and a user behavior topology graph is constructed based on the normalized node connection data. Feature calculations are performed on node data and node connection data in the user behavior topology graph to generate behavior feature vectors. 4.The home agent service method based on user behavior prediction of claim 1, wherein: The step of inputting behavioral feature vectors into the demand prediction model for demand prediction specifically includes: Verify the data format of the behavioral feature vector to obtain valid feature data; Construct effective feature data based on the input requirements of the demand forecasting model, and generate model input feature data; The model inputs feature data into the demand prediction model for inference, and the demand prediction results are obtained. The demand forecast results are analyzed to obtain user demand information containing service identifiers.
5. The home intelligent agent service method based on user behavior prediction as described in claim 4, characterized in that: The process of filtering based on home environment information to generate a candidate service set specifically includes... Obtain and parse the home environment status information to obtain the current environmental status parameters; Extract the service identifier from the user's request information to obtain the initial service result; The initial service results are filtered based on the current environmental status parameters to obtain the filtered service results; The results of the service screening are organized into structured data to generate a candidate service set. 6.The home agent service method based on user behavior prediction according to claim 5, wherein: The acquisition of home environment status information specifically includes... Collect environmental sensing data and device operating status data in the home IoT environment; The environmental perception data and equipment operation status data are synchronized in time to obtain aligned status data. The aligned state data is processed to remove abnormal data, resulting in valid state data; State parameters are extracted from valid state data to generate home environment state information. 7.The home agent service method based on user behavior prediction of claim 1, wherein: The generated target service instruction specifically includes, Integrate behavioral feature vectors, candidate service sets, and home environment status information into the model input data for the service decision model; The model input data is fed into the service decision model for inference and calculation processing to determine the target service item from the candidate service set; Determine the target home appliances based on the target service items; Based on the target service item and the home environment status information, determine the service parameters corresponding to the target service item and generate service parameter data; Based on the target home devices, target service items, and service parameter data, the target service instructions are generated by mapping fields and encapsulating instructions according to the device control protocol corresponding to the target home devices. 8.The home agent service method based on user behavior prediction of claim 7, wherein: The process of integrating behavioral feature vectors, candidate service sets, and home environment status information specifically includes: Convert behavioral feature vectors into standardized feature data; Extract the service identifier information of each service item from the candidate service set, and encode the service identifier information into service code data; Map the status parameters in the home environment status information to environmental status coded data; Standardized feature data, service coding data, and environmental state coding data are concatenated to generate model input data. 9.The home agent service method based on user behavior prediction of claim 1, wherein: The step of controlling home devices to perform corresponding operations according to the target service command specifically includes: Parse the instruction fields in the target service instruction to extract device identification information and control parameter information; Based on the device identification information, locate the device and identify the target household device; Based on the control parameter information, encapsulate the device control instructions according to the device control protocol corresponding to the target home device, and generate device control data; The device control data is sent to the target home device, and the target home device performs the corresponding operation.
10. A home agent service system based on user behavior prediction, based on the home agent service method based on user behavior prediction according to any one of claims 1 to 9, characterized in that, include, The data processing module is used to collect user behavior data in the home IoT environment, encode the behavior data, and generate behavior event sequence data. The behavior modeling module is used to construct a user behavior topology map based on behavior event sequence data, and to extract features to generate behavior feature vectors. The demand forecasting module is used to input behavioral feature vectors into the demand forecasting model to predict demand, and to filter them in combination with household environment status information to generate a set of candidate services. The service decision module is used to input behavioral feature vectors, candidate service sets, and home environment status information into the service decision model to make service trigger decisions and generate target service instructions. The device execution module is used to control home devices to perform corresponding operations based on the target service instructions.