A data processing method, device, equipment and storage medium

By exchanging scenario rule libraries in smart homes and combining the advantages of the cloud and gateway, the problem of data processing delay and stability in smart homes is solved, efficient device data processing is achieved, and home comfort and security are improved.

CN115514659BActive Publication Date: 2024-09-24CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110698725.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-23
Publication Date
2024-09-24
Estimated Expiration
2041-06-23

AI Technical Summary

Technical Problem

In the field of smart homes, existing technologies are difficult to effectively process massive amounts of data, resulting in delays, congestion and unstable connections. Cloud computing and edge computing have their own limitations and cannot meet the efficient data processing needs of smart homes.

Method used

By exchanging the scenario rule library between the gateway and the cloud server, the gateway receives device data for preliminary processing and sends it to the cloud. The cloud trains the prediction model to update the scenario rule library and returns it to the gateway for further processing. Combined with cloud mass processing and gateway End efficiency and stability.

Benefits of technology

It achieves efficient processing of device data in smart homes, improves home comfort and security, provides feedback suitable for user context, reduces cloud pressure, and improves service quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115514659B
    Figure CN115514659B
Patent Text Reader

Abstract

The present application discloses a data processing method, apparatus, device and storage medium, including: receiving first data reported by at least one device; processing the first data through a scenario rule library to obtain a processing result; the scenario rule library includes at least two scenario rules; sending the first data to the cloud service end; the first data is used by the cloud service end to obtain an updated scenario rule library; receiving the updated scenario rule library sent by the cloud service end, and receiving second data reported by at least one device to process the second data through the updated scenario rule library; combining the cloud service end's ability to process massive amounts of data with the gateway's high efficiency in processing near-end data and the advantages of the stability of the connection between the gateway and the device, to improve home comfort and safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and relates to but is not limited to a data processing method, device, equipment and storage medium. Background Art

[0002] With the development of Internet of Things technology, smart home, as an important application field, has increasingly penetrated into daily life and gradually become a reality. In the application field of smart home, people have put forward higher requirements for the situational perception ability of smart home, including intelligent linkage, home hidden dangers, illegal intrusion, and intelligent energy saving.

[0003] With the large-scale access of smart home devices to the Internet of Things, the growth in the number of terminal devices and the diversification of user business needs, problems such as massive data processing, bandwidth consumption, network delay, and congestion are becoming more and more prominent. Cloud computing alone can no longer meet the development trend of smart homes in the future. To this end, edge computing is introduced to bring services closer to end users by concentrating available computing, storage, and network resources on the edge of the network. Edge computing can achieve high-efficiency real-time processing of edge data without uploading all data to the cloud for processing, thereby reducing the pressure on cloud computing, data delay, and bandwidth pressure. However, the computing resources and storage capacity of edge computing are limited. When the amount of data is too large, it is also necessary to upload the data to the cloud service for processing. Combining cloud computing and edge computing (cloud-edge collaboration) and making full use of the joint advantages of cloud computing and edge computing can provide users with better services.

[0004] In related technologies, solutions for device data processing include cloud computing or edge computing.

[0005] The data processing of cloud computing is as follows: the cloud server collects a large amount of data uploaded by devices, and forms inference rules through big data, machine learning and other related technologies. After obtaining the situational information in the target situation, the cloud processes it according to the inference rules, thereby completing the autonomous inference service, controlling the relevant equipment or giving the user corresponding feedback. However, as more and more sensor devices upload data to the cloud, the processing of rules by the cloud may cause delays and blocking problems, and the connection between the device and the cloud may be unstable, resulting in the inability to perform the corresponding processing. The data processing of edge computing is as follows: the scene rules are placed on the gateway side, and the gateway side processes the device data to realize the scene associated with the rule scene data; the gateway uses edge computing to efficiently process the near-end data, and the connection between the gateway side and the smart device is relatively stable; however, due to the limited computing power of the gateway and the lack of certain inference capabilities, it can only complete the processing of data in specific preset scenes. Summary of the invention

[0006] The embodiments of the present application provide a data processing method, apparatus, device and storage medium, which can combine the cloud service end's ability to process massive amounts of data with the gateway end's high efficiency in processing near-end data and the advantages of the stability of the connection between the gateway end and the device to improve home comfort and safety.

[0007] The technical solution of the embodiment of the present application is implemented as follows:

[0008] The present application embodiment provides a data processing method, which is applied to a gateway end connected to a cloud service end and at least one device respectively; the method comprises:

[0009] Receiving first data reported by the at least one device;

[0010] Processing the first data through a scenario rule library to obtain a processing result; the scenario rule library includes at least two scenario rules;

[0011] Sending the first data to a cloud server; the first data is used by the cloud server to obtain an updated scene rule library;

[0012] The updated scenario rule library sent by the cloud server is received, and second data reported by the at least one device is received, so as to process the second data through the updated scenario rule library.

[0013] The present application provides a data processing method, which is applied to a cloud service end, wherein the cloud service end is connected to a gateway end, and the gateway end is connected to at least one device, and the method includes:

[0014] Receiving first data sent by the gateway; the first data is data reported to the gateway by the at least one device;

[0015] Training a prediction model using the first data and historical data of the at least one device to obtain a converged prediction model;

[0016] Converting the converged prediction model into an updated scenario rule base;

[0017] The updated scenario rule base is sent to the gateway end, and the updated scenario rule base is used to update the scenario rule base in the gateway end.

[0018] The present application provides a data processing device, which is applied to a gateway, and the device includes:

[0019] A first receiving module, configured to receive first data reported by the at least one device;

[0020] A first processing module, configured to process the first data through a scenario rule library to obtain a processing result; the scenario rule library includes at least two scenario rules;

[0021] A first sending module, used to send the first data to a cloud server; the first data is used by the cloud server to obtain an updated scene rule library;

[0022] The first receiving module is further configured to receive the updated scenario rule library sent by the cloud server, and receive the second data reported by the first device, so as to process the second data through the updated scenario rule library.

[0023] The present application provides a data processing device, which is applied to a cloud service end and includes:

[0024] A second receiving module is used to receive first data sent by the gateway; the first data is data reported to the gateway by the at least one device;

[0025] A training module, configured to train a prediction model using the first data and historical data of the at least one device to obtain a converged prediction model;

[0026] An updating module, used for converting the converged prediction model into an updated scenario rule library;

[0027] The second sending module is used to send the updated scenario rule library to the gateway end, and the updated scenario rule library is used to update the scenario rule library in the gateway end.

[0028] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the data processing method of the above-mentioned gateway or cloud service end when executing the computer program.

[0029] An embodiment of the present application also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the data processing method on the gateway side or the cloud service side is implemented.

[0030] The data processing method, apparatus, device and storage medium provided in the embodiments of the present application receive the first data reported by the at least one device; process the first data through the scene rule library to obtain a processing result; the scene rule library includes at least two scene rules; send the first data to the cloud service end; the first data is used by the cloud service end to obtain an updated scene rule library; receive the updated scene rule library sent by the cloud service end, and receive the second data reported by the at least one device to process the second data through the updated scene rule library; the near-end gateway of the device processes the device data through the scene rules, and the cloud service end updates the scene rules used by the gateway end, thereby combining the cloud service end's ability to process massive data and the gateway end's high efficiency in processing near-end data and the advantages of the stability of the connection between the gateway end and the device, so as to achieve appropriate feedback suitable for the user's current context according to the data transmitted by the device in the smart home, thereby improving home comfort and safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 An optional structural diagram of a data processing system provided in an embodiment of the present application;

[0032] Figure 2 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0033] Figure 3 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0034] Figure 4 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0035] Figure 5 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0036] Figure 6 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0037] Figure 7 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0038] Figure 8 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0039] Fig. 9 An optional flowchart of a data processing method provided in an embodiment of the present application;

[0040] Fig.10 An optional structural diagram of a data processing device provided in an embodiment of the present application;

[0041] Fig.11 An optional structural diagram of a data processing device provided in an embodiment of the present application;

[0042] Fig.12 An optional structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the specific technical solution of the application will be further described in detail below in conjunction with the drawings in the embodiments of the present application. The following embodiments are used to illustrate the present application, but are not used to limit the scope of the present application.

[0044] The embodiments of the present application can be provided as a data processing method, device, and storage medium. In practical applications, the data processing method can be implemented in electronic devices, and each functional entity in the electronic device can be collaboratively implemented by hardware resources of the electronic device (such as terminal devices, gateways, and servers), such as computing resources such as processors, and communication resources (such as for supporting various communication methods such as optical cables and cellular).

[0045] The data processing method provided in the embodiment of the present application is applied to a data processing system.

[0046] As an example, the structure of the data processing system can be as follows Figure 1 As shown, it includes: a cloud service end 101, a gateway end 102 and multiple devices 103, wherein the device 103 is connected to the gateway end 102, and the gateway end 102 is connected to the cloud service end 101. Optionally, the device 103 may include an IoT device such as a sensor, and the gateway end 102 may be an edge gateway. The cloud service end 101 may be a cloud IoT platform, and in this case, the data processing system may constitute an IoT system.

[0047] The gateway 102 receives data from the device 103, caches the data, and uploads it to the cloud service 101. The device 103 may support various types of devices, such as air conditioners, televisions, washing machines, smart door locks, lighting equipment, smoke sensors, water inlet sensors, temperature and humidity sensors, air purifiers, and other devices in smart furniture.

[0048] In the embodiment of the present application, the device 103 is directly connected to the gateway end 103, and can also be connected to the gateway end 103 through a terminal gateway.

[0049] The gateway end 102 receives the first data reported by the at least one device 103; processes the first data through the scenario rule library to obtain a processing result; the scenario rule library includes at least two scenario rules; sends the first data to the cloud service end 101; the first data is used by the cloud service end to obtain an updated scenario rule library;

[0050] The cloud service end 101 receives the first data sent by the gateway end 102; trains the prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model; converts the converged prediction model into an updated scenario rule library; sends the updated scenario rule library to the gateway end 102, and the updated scenario rule library is used to update the scenario rule library in the gateway end 102.

[0051] The gateway 102 receives the updated scenario rule library sent by the cloud service end, and receives the second data reported by the at least one device, so as to process the second data through the updated scenario rule library.

[0052] Combination Figure 1 The data processing system shown in this embodiment proposes a data processing method, which combines the cloud service end's ability to process massive amounts of data with the gateway's high efficiency in near-end data processing and the advantages of the stability of the connection between the gateway and the device, so as to achieve appropriate feedback suitable for the user's current context based on the data transmitted by the device in a smart home, thereby improving home comfort and safety.

[0053] Next, combine Figure 1 The schematic diagram of the data processing system shown illustrates various embodiments of the data processing method and device, and storage medium provided in the embodiments of the present application.

[0054] This embodiment provides a data processing method, which is applied to an electronic device. The function implemented by the method can be implemented by calling a program code by a processor in the electronic device. Of course, the program code can be stored in a computer storage medium. It can be seen that the electronic device at least includes a processor and a storage medium. Among them, the electronic device is implemented as a gateway end or a cloud service end.

[0055] Of course, the embodiments of the present application are not limited to being provided as methods and hardware, and there may be a variety of implementation methods, such as being provided as a storage medium (storing instructions for executing the data processing method provided by the embodiments of the present application).

[0056] Figure 2 Schematic diagram of the implementation flow of the data processing method of the embodiment of the present application, such as Figure 2 As shown, the method comprises the following steps:

[0057] S201: A gateway receives first data reported by at least one device.

[0058] In the embodiment of the present application, the first data may include data reported by some or all of the at least one device within a period of time. The gateway may receive multiple pieces of first data.

[0059] In an example, at least one device accessing the gateway includes: device 1, device 2, device 3, device 4, and device 5, and the first data includes data reported by device 1 and device 2 to the gateway.

[0060] In one example, at least one device accessing the gateway includes: device 1, device 2, device 3, device 4 and device 5, and the first data includes data reported by device 1, device 2, device 3, device 4 and device 5 to the gateway.

[0061] In the embodiment of the present application, the first data received by the gateway may be data generated by the device based on the user's operation behavior, or may be data generated by the device based on the control instruction of the gateway.

[0062] In the embodiment of the present application, the gateway stores a scenario rule library, and the data reported by the device received before the scenario rule library is updated is referred to as the first data. In actual applications, the gateway periodically updates the scenario rule library, and the data of at least one device received during the period from when the current scenario rule library is obtained to before the current scenario rule library is updated is referred to as the first data. The cycle for updating the scenario rule library can be one day, 5 days, 15 days, one month, etc.

[0063] In the embodiment of the present application, the data uploaded by different devices may be different. For example, the data reported by the temperature and humidity sensor includes: temperature and humidity, the data reported by the smoke sensor includes: smoke volume, and the data reported by the air purifier is air quality.

[0064] S202: The gateway processes the first data through a scenario rule library corresponding to the first device to obtain a processing result.

[0065] The scenario rule library includes at least two scenario rules.

[0066] After the gateway receives the first data, it processes the first data through the scenario rules in the scenario rule library to obtain a processing result. Here, the processing result is a processing method for processing the current first data, which may include: no processing, a function supported by a device in at least one device, an alarm, etc. When the processing result is no processing, the gateway does not perform any next step of processing; when the processing result is a function, a control instruction is sent to a device that supports the action, instructing the device that supports the function to perform the function; when the processing result is an alarm, an alarm device can be determined, and an alarm instruction is sent to the alarm device, instructing the alarm device to perform alarm processing based on the alarm instruction. In an embodiment of the present application, the processing result may also include other forms of processing methods, and the embodiment of the present application does not impose any limitation on the processing form of the processing result.

[0067] It should be noted that, when the processing result is an action, the device that reports the first data and the device that supports the action may be the same device or different devices.

[0068] In one example, when the first data includes: the temperature of the current environment reported by the air conditioner, and the action determined based on the scene rule is to lower the cooling temperature of the air conditioner, the air conditioner is instructed to lower the cooling temperature. At this time, the device to which the first data belongs and the device that supports the action are both air conditioners.

[0069] In one example, when the first data includes: the door lock status detected by the smart door lock, and the action determined based on the scene rule is to turn on the light, then an instruction is given to turn on the light. At this time, the device to which the first data belongs is the door lock, and the device that supports the action is the light.

[0070] It should be noted that, in an embodiment of the present application, when the processing result is to instruct the device to perform an action, the device supporting the action will generate data and report the data generated based on the processing result to the gateway. At this time, if the reporting time of the data generated based on the processing result is before the update of the scenario rule library, the data generated based on the processing result can be used as the new first data, and the gateway processes the first data generated based on the processing result through the scenario rule library.

[0071] S203: The gateway sends the first data to the cloud service end.

[0072] The first data is used by the cloud server to obtain an updated scenario rule library;

[0073] In the embodiment of the present application, the gateway processes the first data and sends the first data to the cloud service end. When the connection between the gateway and the cloud service end is established, the gateway directly sends the first data to the cloud service end. When the connection between the gateway and the cloud service end is disconnected, the gateway caches the first data, waits for the connection between the gateway and the cloud service end to be established, and then sends the cached first data to the cloud service end through the established connection.

[0074] After receiving the first data, the cloud server obtains the updated scenario rule through the first data and the historical data of at least one device, wherein the historical data is the data reported by at least one device before the first data sent by the gateway to the cloud server, and optionally, the historical data may be the historical data within a period of time.

[0075] In some embodiments, the scenario rules in the gateway may be obtained based on historical data. Here, before receiving the first data, the cloud service may obtain a scenario rule library based on historical data, and send the scenario rule library to the gateway, so that the gateway processes the first data based on the scenario rule library.

[0076] After the cloud server obtains the updated scenario rule library, it sends the updated scenario rule library to the gateway.

[0077] S204: The gateway receives the updated scenario rule library sent by the cloud server, and receives the second data reported by the first device, so as to process the second data through the updated scenario rule library.

[0078] Here, the data reported by the device after receiving the updated scenario rule library is referred to as the second data. After receiving the updated scenario rule library, the gateway device processes the second data through the updated scenario rule library.

[0079] It should be noted that before receiving the updated scene rules, the gateway device processes the data reported by the device using the unupdated scene rules.

[0080] The data processing method provided in the embodiment of the present application can be applied to the following scenarios:

[0081] Scenario 1: On January 2, the gateway processes the data reported by the device through the scenario rules in the scenario rule library 1, and sends the received data to the cloud server. In the early morning of January 3, the cloud server obtains the scenario rule library 2 through the data sent by the gateway on January 2 and the data sent before January 2, and sends the scenario rule library 2 to the gateway. The gateway receives the scenario rule library 2 and processes the data reported by the device through the scenario rules in the scenario rule library 2 on January 3.

[0082] Scenario 2: When the gateway is disconnected from the cloud server, it processes the data reported by the device through scenario rule library 1 and caches the data reported by the device. When the connection with the cloud server is established, the cached data is sent to the cloud server. The cloud server obtains an updated scenario rule library based on the received data and historical data: scenario rule library 2, and sends scenario rule library 2 to the gateway. After receiving scenario rule library 2, gateway 2 processes the data reported by the device after receiving scenario rule library 2 based on scenario rule library 2.

[0083] The data processing method provided in the embodiment of the present application is as follows: the gateway receives the first data reported by the at least one device; the first data is processed through the scene rule library to obtain a processing result; the scene rule library includes at least two scene rules; the first data is sent to the cloud service end; the first data is used by the cloud service end to obtain an updated scene rule library; the updated scene rule library sent by the cloud service end is received, and the second data reported by the at least one device is received to process the second data through the updated scene rule library; the near-end gateway of the device processes the data of the device through the scene rules, and the cloud service end updates the scene rules used by the gateway end, thereby combining the cloud service end's ability to process massive data and the gateway's high efficiency in processing near-end data and the advantages of the stability of the connection between the gateway and the device, so as to achieve appropriate feedback suitable for the user's current context according to the data transmitted by the device in the smart home, improve home comfort and safety, and provide high-quality home services.

[0084] In some embodiments, the scenario rule includes function data and an action corresponding to the function data; the implementation of S202 includes the following steps:

[0085] S2021. Match the first data with each scenario rule in the scenario rule library;

[0086] The scenario rule library includes multiple scenario rules, each of which includes function data and actions corresponding to the function data, wherein the function data is used as a trigger condition and the action is used as an execution action, so that when the trigger condition is met, the corresponding execution action is executed. In one example, the scenario rule is: if the temperature is higher than the temperature threshold and someone moves, then turn on the air conditioner. In this scenario rule, the trigger condition is: the temperature is higher than the temperature threshold, the state condition is that someone moves, and the execution action is to turn on the air conditioner. In one example, the scenario rule is: if a gas leak status is received, then notify the user. In this scenario rule, the trigger condition is: if a gas leak status is received, then the execution action is: notify the user.

[0087] For the first data, the gateway matches the first data with the functional data of each scenario rule in the scenario rule library, and calls the rule in the scenario rule library that matches the first data a target scenario rule.

[0088] In one example, the first data includes: temperature 30 and smoke volume 40. When the scene library includes scene rules: scene rule 1, turn on the air conditioner when the temperature is greater than 25, scene rule 2, when the temperature is between 25 and 20, increase the temperature of the air conditioner by one step, scene rule 3, turn off the air conditioner when the temperature is less than 20, when the current temperature 30 matches scene rule 1, scene rule 1 is the target scene rule corresponding to temperature 30.

[0089] Here, when the target scene rule of the current first data is matched in the scene rule library, it indicates that the scene rule library specifies the processing method for the current first data. When the target scene rule of the current first data is not matched in the scene rule library, it indicates that the scene rule library does not specify the processing method for the current first data.

[0090] S2022: When the first data matches the function data of the target scenario rule in the scenario rule library, determining an action of the target scenario rule;

[0091] When there is a target scenario rule corresponding to the first data, the corresponding processing is performed based on the action in the target scenario rule. The action here may be a function or an alarm supported by a device in at least one device. When the action is a function, a control instruction is sent to a device supporting the action to instruct the device supporting the function to perform the function; when the processing result is an alarm, an alarm device may be determined, and an alarm instruction may be sent to the alarm device to instruct the alarm device to perform alarm processing based on the alarm instruction.

[0092] S2023: When the first data does not match the functional data in any scenario rule in the scenario rule library, determine a processing method corresponding to the first data based on the similarity between the first data and the user behavior model.

[0093] When there is no target scene corresponding to the first data in the scene rule library, the similarity between the first data and the user behavior model is determined, and a processing method corresponding to the first data is determined according to the similarity between the first data and the user behavior model.

[0094] Here, the higher the similarity between the first data and the user behavior model, the more the first data conforms to the user's behavior habits, and the lower the similarity between the first data and the user behavior model, the less the first data conforms to the user's behavior habits. When the first data conforms to the user's behavior habits, the corresponding processing method of the first data is no processing, and when the first data does not conform to the user's behavior habits, the corresponding processing method of the first data is alarm.

[0095] In some embodiments, the scenario rule library includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model; before determining the processing method corresponding to the first data based on the similarity between the first data and the user behavior model in S2022, the following steps are also included:

[0096] S2023. Determine the functional data included in the at least one behavior rule;

[0097] S2024. Determine a first similarity between the first data and the functional data in the at least one behavior rule.

[0098] The functional data in at least one behavior rule can characterize the normal behavior profile of the user, that is, the normal behavior habits of the user. The gateway determines the first similarity between the first data and the functional data in at least one behavior rule, that is, determines the similarity between the first data and the normal behavior profile of the user.

[0099] In the embodiment of the present application, the scenario rule library includes two types of scenario rules: behavior rules and alarm rules. Behavior rules represent the normal operation of the device. Therefore, behavior rules can represent the user behavior model that reflects the user's behavior habits. Alarm rules are rules that can trigger device alarms such as device failures or alarms, and represent abnormal operations of the device. Therefore, alarm rules can represent alarm models that reflect abnormal situation processing. Among them, the behavior rules in the scenario rule library constitute the normal behavior rule library, and the alarm rules in the scenario rule library constitute the alarm rule library.

[0100] The gateway calculates the similarity between the first data and the functional data of the behavior rules in the normal behavior rule library. Here, the functional data of the behavior rules in the normal behavior rule library can be taken as a whole to calculate the similarity between the first data and the whole, or the similarity scores of the first data and the functional data in each behavior rule can be calculated separately, and the similarity is calculated based on all the similarity scores.

[0101] It should be noted that the gateway determines a reference scenario rule related to the first data from a scenario rule library.

[0102] In some embodiments, the implementation of S2024 includes the following steps:

[0103] S2241, obtaining a first coefficient and a second coefficient, wherein the first coefficient is a standard deviation of the functional data included in the at least one behavioral rule, and the second coefficient is a mean of the functional data included in the at least one behavioral rule;

[0104] S2242. Determine at least two data ranges according to the first coefficient and the second coefficient; wherein the probability values ​​of data distribution in different data ranges are different;

[0105] S2243: Determine a probability value corresponding to the data range to which the first data belongs in the at least two data ranges as the first similarity.

[0106] Here, the standard deviation of all functional data in the behavior rule library, i.e., the first coefficient, is expressed as σ, and the mean of all functional data in the behavior rule library, i.e., the second coefficient, is expressed as μ. The gateway determines multiple data ranges based on σ and μ. In the embodiment of the present application, multiple data ranges are determined based on the first data and the second coefficient, and the probability values ​​of data distribution in different data ranges are different.

[0107] Taking the determination of three data ranges as an example, the three data ranges include:

[0108] Data range 1, (μ-σ, μ+σ), the corresponding probability is 0.6826, representing the probability that the value is distributed in (μ-σ, μ+σ) is 0.6826;

[0109] Data range 2, (μ-2σ, μ+2σ), the corresponding probability is 0.9545, and the probability of the representation value being distributed in μ-2σ, μ+2σ) is 0.9545;

[0110] Data range three, (μ-3σ,μ+3σ), the corresponding probability is 0.9973, and the probability of the representation value distribution in (μ-3σ,μ+3σ) is 0.9973.

[0111] The gateway determines the first similarity corresponding to the first data according to the probability corresponding to the data range in which the first data falls.

[0112] In some embodiments, the implementation of determining a processing method corresponding to the first data based on the similarity between the first data and the user behavior model in S2022 includes the following steps:

[0113] When the first similarity is greater than a similarity threshold, it is determined that a processing method corresponding to the first data is an alarm.

[0114] Here, when the first similarity is less than the similarity threshold, it indicates that the current first data conforms to the user behavior model, and the processing method is no processing. When the first similarity is greater than the similarity threshold, it indicates that the current first data does not conform to the user behavior model, which is an abnormal situation, and the processing method is alarm.

[0115] In some embodiments, after S201, the following steps are further implemented:

[0116] Determine whether the scenario rule library exists;

[0117] When the result of the judgment is that the scenario rule library does not exist, the first data is sent to the cloud server, so that the cloud server processes the first data.

[0118] At this time, if Figure 3 As shown,

[0119] S301: A gateway receives first data reported by at least one device.

[0120] S302: The gateway determines whether there is a scene rule library locally.

[0121] If it exists, execute S303; if it does not exist, execute S304.

[0122] S303: The gateway processes the first data according to local scenario rules to obtain a processing result.

[0123] S304: The gateway sends the first data to the cloud service end.

[0124] Here, the first data is processed by the scenario rule library of the cloud server to obtain a processing result.

[0125] After S203, the gateway further performs the following steps:

[0126] Receiving a notification message sent by the cloud server; the notification message is used to instruct the cloud server to obtain the updated scenario rule library;

[0127] A pull message in response to the notification message is sent to the cloud server, where the pull message is used to instruct to pull the updated scenario rule library from the cloud server.

[0128] In the embodiment of the present application, there is no need for the gateway to maintain a continuous connection with the cloud server. When the gateway establishes a connection with the cloud server, it can receive notification messages from the cloud server, thereby pulling the scenario rule library from the cloud, thereby saving wireless resources.

[0129] The embodiment of the present application provides a data processing method, which is applied to a cloud server. The function implemented by the method can be implemented by calling a program code by a processor in the cloud server. Of course, the program code can be stored in a computer storage medium. It can be seen that the cloud server at least includes a processor and a storage medium.

[0130] Of course, the embodiments of the present application are not limited to being provided as methods and hardware, and there may be a variety of implementation methods, such as being provided as a storage medium (storing instructions for executing the data processing method provided by the embodiments of the present application).

[0131] based on Figure 1 The data processing system shown, Figure 4 Schematic diagram of the implementation flow of the data processing method of the embodiment of the present application, such as Figure 4 As shown, the method comprises the following steps:

[0132] S401: The cloud service end receives first data sent by the gateway end.

[0133] The first data is data reported by the at least one device to the gateway.

[0134] In the embodiment of the present application, the first data may include data reported by some or all of the at least one device sent by the gateway to the cloud service end within a period of time.

[0135] In an example, at least one device accessing the gateway includes: device 1, device 2, device 3, device 4, and device 5, and the first data includes data reported by device 1 and device 2 to the gateway.

[0136] In one example, at least one device accessing the gateway includes: device 1, device 2, device 3, device 4 and device 5, and the first data includes data reported by device 1, device 2, device 3, device 4 and device 5 to the gateway.

[0137] In the embodiment of the present application, the first data received by the gateway may be data generated by the device based on the user's operation behavior, or may be data generated by the device based on the control instruction of the gateway.

[0138] In the embodiment of the present application, the gateway stores a scenario rule library, and the data reported by the device received before the scenario rule library is updated is called the first data. In actual applications, the gateway periodically updates the scenario rule library, and the data of at least one device received during the period from the current scenario rule library to the current scenario rule library update is called the first data, and the first data is sent to the cloud service end. The cycle of updating the scenario rule library can be one day, 5 days, 15 days, one month, etc.

[0139] In the embodiment of the present application, the data uploaded by different devices may be different. For example, the data reported by the temperature and humidity sensor includes: temperature and humidity, the data reported by the smoke sensor includes: smoke volume, and the data reported by the air purifier is air quality.

[0140] S402: The cloud server trains a prediction model using the first data and historical data of the at least one device to obtain a converged prediction model.

[0141] After receiving the first data, the cloud service end obtains historical data of at least one device. Here, the historical data may be data within a period of time, or may be historical data of a scenario rule library for processing the first data in the gateway end.

[0142] The cloud server directly uses the first data and the historical data as training data of the prediction model to train the prediction model, and can also filter and extract features of the first data to obtain data features of the first data, and use the data features of the first data and the data features of the historical data as training data to train the prediction model. When the training data includes the first data and the historical data, the cloud server stores the historical data itself; when the training data includes the data features of the first data and the data features of the historical data, the cloud server caches the data features of the historical data.

[0143] In an embodiment of the present application, the prediction model may be a single model using a machine learning algorithm or a combination of multiple single models using a machine learning algorithm. Among them, the single model using a machine learning algorithm may include: Support Vector Machine (SVM), Logistic Regression (LR), Scalable Gradient Boosting Tree Algorithm (eXtreme Gradient Boosting, XGBoost), Light Gradient Boosting Tree Algorithm (Light Gradient Boosting Machine, LightGBM), etc. In one example, the prediction model is XGBoost. In one example, the prediction model is a combination of XGBoost and LightGBM.

[0144] In the embodiment of the present application, the prediction model is trained by training data so that the prediction model can continuously learn the state of the device and the relationship between the devices, so that the converged prediction model can learn the user behavior profile. Here, the first data and historical data may include normal data of each device, and may also include data under alarm conditions. Therefore, the user behavior profile may include a normal behavior profile and an alarm behavior profile.

[0145] S403: The cloud server obtains an updated scenario rule library based on the prediction model.

[0146] The converged prediction model can learn the user behavior profile, which can reflect the user behavior profile. Therefore, the scenario rules obtained by the cloud server based on the prediction model can also reflect the user behavior profile. The user behavior profile includes the normal behavior profile and the alarm behavior profile. Therefore, the scenario rules converted by the prediction model include the behavior rules that reflect the normal behavior profile and the alarm rules that reflect the alarm behavior profile.

[0147] In an embodiment of the present application, the cloud service end may input the device data of each device in at least one device connected to the gateway end into the prediction model, obtain the output obtained by the prediction model, obtain a scenario rule based on an input and an input corresponding to the input, and thus obtain the scenario rule converted by the prediction model based on the device data of each device. Among them, the device data of the device represents the functions supported by the device. The device data may include: function name, function identifier, data type, value range, step size, unit, read-write type (read-write or read-only), etc.

[0148] In the embodiment of the present application, the device data of each device can be represented by the device data model of the device. The device data includes a thing specification language (TSL). TSL includes attributes, services and events. Attributes represent the basic functions supported by the device. The parameters of the attributes may include function name, function identifier, data type, value range, step size, unit, read-write type (read-write or read-only), etc. Services represent services other than the basic functions that the device can provide. The parameters of the services may include: function name, function identifier, calling method, input parameters, output parameters, etc., wherein the sub-parameters of the input parameters and output parameters include: parameter name, parameter identifier, data type, value range, step size, unit, etc. Events represent events that can trigger alarms, such as faults and alarms. The parameters of the events include: function name, function identifier, event type, output parameters, etc., wherein the output parameters are composed of parameter name (fault number), parameter identifier, data type, enumeration value, etc.

[0149] After the cloud server obtains the scenario rules converted by the prediction model, it can directly form an updated scenario rule library based on the scenario rules converted by the prediction model, or update the current scenario rule library in the cloud server based on the scenario rules converted by the prediction model to obtain an updated scenario rule library. The current scenario rule library in the cloud server is the same as the scenario rule library used by the gateway to process the first data.

[0150] S404: The cloud service sends the updated scenario rule library to the gateway.

[0151] The updated scenario rule base is used to update the scenario rule base in the gateway.

[0152] After the cloud server obtains the updated scenario rule library, it sends the updated scenario rule library to the gateway. The gateway receives the updated scenario rule library sent by the cloud server, updates the original scenario rule library, replaces the original scenario rule library, and processes the second data received after receiving the updated scenario rule library through the updated scenario rule library.

[0153] In some embodiments, S402 trains the prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model, and the implementation includes the following steps: filtering the first data according to the device data model of each of the at least one device; the device data model characterizes the functions supported by the device; based on the device type of each of the at least one device, extracting data features from the filtered first data; training the prediction model through the data features and the historical data to obtain a converged prediction model.

[0154] In an embodiment of the present application, before training the prediction model based on the first data, the first data may be filtered and feature extracted, and the prediction model may be trained using the data features extracted by the feature extraction.

[0155] In some embodiments, the scenario rule library includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model; the cloud service end further implements the following steps:

[0156] S405, determining the functional data included in the at least one behavior rule;

[0157] S406, determining a second similarity between the first data and each data in the historical data and the functional data in the at least one behavior rule;

[0158] S407, determining a similarity threshold according to the determined second similarity;

[0159] S408: Send the similarity threshold to the gateway, where the similarity threshold is used to determine a processing result of the first data when the first data does not match the scenario rule.

[0160] In some embodiments, the implementation of S406 includes:

[0161] S4061, obtaining a first coefficient and a second coefficient, wherein the first coefficient is a standard deviation of the functional data included in the at least one behavioral rule, and the second coefficient is a mean of the functional data included in the at least one behavioral rule;

[0162] S4062. Determine at least two data ranges according to the first coefficient and the second coefficient; wherein the probability values ​​of data distribution in different data ranges are different;

[0163] S4063. Take each of the first data and the historical data as target data, and perform the following processing on the target data: determine the probability value corresponding to the data range to which the target data belongs in the at least two data ranges as the second similarity.

[0164] In some embodiments, the implementation of S407 includes:

[0165] S4071, sorting the determined second similarities to obtain a sorting result;

[0166] S4072, determining a split point in the sorting result according to a set ratio;

[0167] S4073: Determine the second similarity corresponding to the segmentation point as the similarity threshold.

[0168] In an embodiment of the present application, the similarity between each training data and the user behavior model in the training data for training the prediction model, i.e., the second similarity, can be calculated, and all the second similarities can be sorted. The segmentation point of the similarity is determined according to the sorting result, and the second similarity of the segmentation point is used as the similarity threshold.

[0169] In one example, all second similarities are sorted in ascending order, and 10% is used as the set ratio. At this time, the second similarity at the 10% position from the highest similarity is determined as the similarity threshold.

[0170] In some embodiments, the cloud service further implements the following steps:

[0171] Determine whether the gateway end pulls the scenario rule from the cloud service end;

[0172] When the result of the judgment is that the gateway has not pulled the scenario rule library from the cloud service end, the first data is processed based on the locally stored scenario rule library to obtain a processing result.

[0173] At this time, if Figure 5 As shown, the cloud server implements the following steps:

[0174] S501: Determine whether the gateway side pulls the scenario rule from the cloud service side.

[0175] If it has not been pulled, execute S502; if it has been pulled, execute S503.

[0176] S502: Process the first data based on the locally stored scenario rule library to obtain a processing result.

[0177] S503: Determine updated scenario rules based on the first data and historical data.

[0178] The description of S503 can refer to the description of S402 and S403, which will not be repeated here.

[0179] In some embodiments, after S403, the cloud service end further implements the following steps:

[0180] Sending a notification message to the gateway; the notification message is used to instruct the cloud server to obtain the updated scenario rule library; receiving a pull message returned by the gateway in response to the notification message; the pull message is used to instruct the gateway to pull the updated scenario rule library from the cloud server.

[0181] At this time, the cloud service end sends the updated scenario rule library to the gateway end in response to the pull message.

[0182] The present application embodiment provides a data processing method, which is applied to a data processing system including a gateway end and a cloud service end, such as Figure 6 As shown, including:

[0183] S601: A gateway receives first data reported by at least one device.

[0184] S602: The gateway processes the first data through a scenario rule library to obtain a processing result.

[0185] The scenario rule library includes at least two scenario rules.

[0186] S603: The gateway sends the first data to the cloud service end.

[0187] S604: The cloud service end receives the first data sent by the gateway end.

[0188] S605: The cloud server trains a prediction model using the first data and historical data of the at least one device to obtain a converged prediction model.

[0189] S606: The cloud server obtains an updated scenario rule library based on the prediction model.

[0190] S607: The cloud service end sends the updated scenario rule library to the gateway end.

[0191] S608: The gateway receives the updated scenario rule library sent by the cloud server, and receives the second data reported by the at least one device, so as to process the second data through the updated scenario rule library.

[0192] Here, the descriptions of S601, S602, S603 and S608 may refer to the descriptions of S201, S202, S203 and S204 respectively; the descriptions of S604, S605, S606 and S607 may refer to the descriptions of S401, S402, S403 and S404 respectively, which will not be repeated here.

[0193] In an embodiment of the present application, the gateway processes the data reported by the device through the scene rule library, and sends the data reported by the device to the cloud server. The cloud server updates the scene rule library based on the data sent by the gateway, obtains the updated scene rule library, and sends the updated scene rule library to the gateway. The gateway processes the data reported by the device based on the updated scene rule library, thereby combining the cloud service end's ability to process massive data and the gateway's high efficiency in near-end data processing and the advantages of the stability of the connection between the gateway and the device, thereby improving home comfort and safety, and providing high-quality smart home services.

[0194] Below, the data processing method provided in the embodiment of the present application is further explained through specific application scenarios.

[0195] The data processing method provided in the embodiment of the present application is applied to Figure 1 The data processing system 100 shown includes: a cloud service end 101, a gateway end 102 and multiple devices 103, wherein the cloud service end 101 is connected to the gateway end 102, and the gateway end 102 is connected to the devices 103.

[0196] The method for executing the initial scene rule in the data processing method provided in the embodiment of the present application is as follows: Figure 7 As shown, including:

[0197] S701. The device reports the functions supported by the device to the cloud based on TSL.

[0198] The device reports the functions supported by the device to the gateway based on TSL, and the gateway sends the functions supported by the device to the cloud.

[0199] In the embodiment of the present application, the functions supported by the device can be defined as TSL. TSL abstracts the functions supported by the device into a data model, namely, the device data model, which includes: attributes, services, and events. Attributes represent the basic functions of the device, and an attribute can be represented by the following information: function name, function identifier, data type, value range, step size, unit, read-write type (read-write or read-only). Services represent the additional functions provided by the device, and a service can be represented by the following information: function name, function identifier, calling method, input parameters, output parameters, etc., wherein the input parameters or output parameters include: parameter name, parameter identifier, data type, value range, step size, unit, etc. Events represent functions such as device alarms and faults, and an event can be represented by the following information: function name, function identifier, event type, output parameters, wherein the output parameters are represented by parameter name (fault number), parameter identifier, data type, and enumeration value.

[0200] In the embodiment of the present application, the complete object model of the device is identified by a JSON file. The device defines the functions supported by the device as data according to TSL and reports the data to the cloud. The cloud parses the reported data of the device according to TSL.

[0201] Here, after the gateway sends the data reported by the device to the cloud, it can disconnect from the cloud.

[0202] S702: The cloud obtains initial scene rules based on TSL.

[0203] The cloud obtains the initial scenario rules based on the TSL custom rules, where the scenario rules include: behavior rules and alarm rules. The behavior rules can constitute the behavior rule library, and the alarm rules can constitute the alarm rule library. The scenario rules may include the following elements: trigger conditions and execution actions. The trigger conditions are the functional data of the scenario rules, and the execution actions are the actions of the scenario rules. The scenario rules may also include the following elements: state conditions. When the scenario rules do not include state conditions, the corresponding execution actions are executed when the scenario rule representation satisfies the trigger conditions. When the scenario rules include state conditions, the corresponding execution actions are executed when the scenario rules meet the trigger conditions and the state conditions. At this time, the functional data includes the trigger conditions and the state conditions.

[0204] In one example, the behavior rule includes: when the temperature is higher than the temperature threshold and someone moving is detected, turn on the air conditioner. In this behavior rule, the trigger condition is: the temperature is higher than the temperature threshold, the state condition is that someone moving is detected, and the execution action is to turn on the air conditioner.

[0205] In one example, the behavior rule includes turning off all lights in the house at a certain time. In this behavior rule, the trigger condition is that the time is a certain time, and the execution action is turning off all lights in the house.

[0206] In one example, the behavior rule includes: if the air conditioner is turned on, then the door is closed. In this behavior rule, the trigger condition is that the air conditioner is turned on, and the execution action is to close the door.

[0207] In one example, the alarm rule includes: upon receiving a gas leakage status, notify the user. In the alarm rule, the trigger condition is: upon receiving a gas leakage status, the execution action is: notify the user.

[0208] In one example, the alarm rule includes: if the indoor temperature is higher than a threshold, notify the user. In the alarm rule, the trigger condition is: the indoor temperature is higher than the temperature threshold, and the execution action is: notify the user.

[0209] In one example, the alarm rule includes: receiving a report from a smoke sensor that a smoke state is detected, and issuing an alarm tone. In the alarm rule, the trigger condition is: receiving a report from a smoke sensor that a smoke state is detected, and the execution action is issuing an alarm.

[0210] In the embodiment of the present application, the difference between the behavior rule and the alarm rule is that the execution action in the alarm rule is used for alarm, and the execution action in the behavior rule is used for non-alarm.

[0211] In the embodiment of the present application, at least one alarm rule may be set in the cloud.

[0212] S703. The gateway pulls the initial scenario rules from the cloud.

[0213] After the cloud determines the scene rules, it notifies the gateway to pull the scene rules. The gateway pulls the scene rules from the cloud. After the gateway pulls the scene rules from the cloud, it stores the pulled scene rules locally.

[0214] After the cloud gateway pulls the scene rules, it processes the data reported by the device by default, and the cloud shields the processing of the device's uplink data to avoid false alarms and unnecessary conflicts.

[0215] When the gateway does not pull the scene rules from the cloud, the cloud processes the data reported by the device based on the scene rules.

[0216] S701 to S703 above describe the formation of scenario rules. The gateway processes the data collected from the device through the scenario rules and can give the user corresponding feedback. However, the scenario rules lack certain reasoning capabilities and cannot correctly deal with the data of the device in the case of abnormal scenarios. The abnormal scenarios include: the temperature is higher than the upper limit of the temperature supported by the air conditioner, a fire occurs, an outsider invades, and other scenarios not included in the scenario rules.

[0217] Here, the data collected by the gateway is analyzed through the cloud to analyze the user behavior profile, forming a continuously optimized rule base to achieve the purpose of situational awareness.

[0218] Methods for tuning rules in the rule base, such as Figure 8 As shown, including:

[0219] S801. The cloud obtains data collected by the gateway and pre-processes the obtained data.

[0220] Remotely obtain various data about the situations reported by the devices collected by the gateway and pre-process the obtained data.

[0221] Here, the preprocessing method includes: the cloud parses and processes the data reported by the device according to the TSL corresponding to the device, and cleans the data not included in the TSL of each device.

[0222] In the embodiment of the present application, the preprocessing method also includes: adding location, date, and time information to the data to form a sample data set for unified storage.

[0223] S802: The cloud extracts data features from the pre-processed data.

[0224] The cloud performs feature extraction on the pre-processed data based on the type of device to extract data features.

[0225] When the preprocessed data includes the data of smart door magnets, the data features extracted from the data of smart door magnets include: door magnet status and power information. When the preprocessed data includes the data of temperature and humidity sensors, the data features extracted from the data of temperature and humidity sensors include: temperature and humidity data and power information. When the preprocessed data includes the data of air purifiers, the features extracted from the data of air purifiers include: the mode of the equipment and the information of fine particulate matter (PM) with a diameter less than 2.5, i.e. PM2.5.

[0226] S803. The cloud trains the prediction model using the extracted data features and historical data features to obtain a converged prediction model.

[0227] The cloud uses structured language to represent the data features of each device, and uses structured language to represent the functions of different types of devices, the current status of the device, the status of each device at each moment, etc. The cloud uses machine learning algorithms to continuously learn the extracted data features and historical feature data, analyze the associations between devices, and derive the normal user behavior profile. Here, the cloud uses the extracted data features and historical feature data to train the prediction model, so that the prediction model analyzes the associations between devices, thereby obtaining a convergent prediction model that can reflect the user behavior profile.

[0228] In the embodiment of the present application, the prediction model used in the cloud can be a single model, such as: SVM, LR, XGB, LightGBM, etc. The prediction model used in the cloud can also be a combination of multiple single models. The prediction model used in the embodiment of the present application can be a combination of XGBoost and LightGBM.

[0229] The cloud trains the training models, optimizes parameters, and compares the results to obtain a trained prediction model.

[0230] S804: The cloud obtains scenario rules based on the converged prediction model and sends the scenario rules to the gateway.

[0231] After the cloud obtains the prediction model, it inputs each function in TSL respectively and obtains the output results of each function. Based on each function and the output results of each function, it obtains the scenario rule library composed of scenario rules, thereby converting the prediction model into a scenario rule library that can be recognized by the gateway. After the cloud obtains the scenario rule library, it notifies the gateway to obtain the scenario rules from the cloud again. The gateway obtains the scenario rules from the cloud and updates the local normal behavior scenario rule library.

[0232] In the present application embodiment, Fig. 9 As shown, devices 903-1, 903-2, 903-3 and 903-4 report data to gateway 902, gateway 902 sends the reported data to cloud 901, cloud 901 performs the following processing on the received data in sequence to obtain a converged prediction model 905: 9041, preprocessing; 9042, feature extraction, 9043, model training, and obtains a scenario rule library 906 based on the prediction model 905, and the cloud sends the scenario rule library 906 to gateway 902, so that gateway 902 processes the data reported by devices 903-1, 903-2, 903-3 and 903-4 through the scenario rule library 906. Among them, the scenario rule library 906 includes: a normal behavior rule library 9061 and an alarm rule library 9062.

[0233] In the embodiment of the present application, the gateway receives data from the device and processes the received data based on the scenario rules in the scenario rule library. The specific processing is as follows:

[0234] The received data is matched with the scene rules in the scene rule library. If the scene rules corresponding to the received data are matched, an action is executed or an alarm is issued based on the description of the matched scene rules. If the scene rules are not matched, the received data and the behavior rules representing the normal behavior profile are judged using the 3Sigma criterion to obtain the similarity between the received data and the normal behavior profile. When the calculated similarity represents that the deviation between the currently received data and the normal behavior profile is too large, an early warning is issued. Among them, after the gateway calculates the similarity, it judges whether the current user's situation is abnormal based on the similarity value Sim. Here, the judgment similarity threshold, that is, the threshold value is k. If Sim>k, the behavior is considered normal. If Sim<=k, it is considered that the user's current environment may be abnormal. The selection of the threshold value k can be adopted as follows: During the training process, after the normal situation profile of the user is established, the similarity of the training data is calculated once, and the segmentation point of the similarity is taken (the first 10% with the lowest similarity), and the similarity of this segmentation point is used as the threshold value k. Then, in the detection process, the threshold value is appropriately adjusted according to the false alarm rate and false alarm rate of the system.

[0235] The cloud continuously trains and optimizes the prediction model through the continuous uplink data from the gateway to form a scenario-aware scenario rule library. After the gateway obtains the optimized scenario rule library from the cloud, the local rule library is updated and the 3Sigma criterion is used to make similarity judgments on the uplink data that does not match the rules to determine whether there are any anomalies. It can comprehensively analyze whether there are any anomalies based on the data behavior of the associated sensor equipment. It efficiently processes the uplink data of the smart sensor and gives appropriate feedback to the user's current context.

[0236] The present application embodiment provides a data processing device 1000, which is applied to a gateway, such as Fig.10 As shown, the data processing device 1000 includes:

[0237] A first receiving module 1001, configured to receive first data reported by the at least one device;

[0238] A first processing module 1002 is used to process the first data through a scenario rule library to obtain a processing result; the scenario rule library includes at least two scenario rules;

[0239] A first sending module 1003 is used to send the first data to a cloud server; the first data is used by the cloud server to obtain an updated scenario rule library;

[0240] The first receiving module 1001 is further configured to receive the updated scenario rule library sent by the cloud server, and receive the second data reported by the first device, so as to process the second data through the updated scenario rule library.

[0241] In some embodiments, the processing module 1002 is further configured to:

[0242] When the first data matches the functional data of the target scenario rule in the scenario rule library, the action of the target scenario rule is determined; when the first data does not match the functional data in any scenario rule in the scenario rule library, based on the similarity between the first data and the user behavior model, the processing method corresponding to the first data is determined.

[0243] In some embodiments, the apparatus 1000 further includes: a determining module, configured to:

[0244] Determine the function data included in at least one behavior rule in the scenario rule base; the scenario rule base includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model;

[0245] A first similarity between the first data and the functional data in the at least one behavior rule is determined.

[0246] In some embodiments, the determination module is further configured to:

[0247] Obtaining a first coefficient and a second coefficient, wherein the first coefficient is a standard deviation of the functional data included in the at least one behavioral rule, and the second coefficient is a mean of the functional data included in the at least one behavioral rule;

[0248] Determine at least two data ranges according to the first coefficient and the second coefficient; wherein the probability values ​​of data distribution in different data ranges are different;

[0249] A probability value corresponding to the data range to which the first data belongs in the at least two data ranges is determined as the first similarity.

[0250] In some embodiments, the first processing module 1002 is further configured to:

[0251] When the first similarity is greater than a similarity threshold, it is determined that a processing method corresponding to the first data is an alarm.

[0252] In some embodiments, the apparatus 1000 further includes:

[0253] A first judgment module is used to judge whether the scenario rule library exists;

[0254] The first sending module 1003 is further configured to send the first data to the cloud server when the result of the judgment is that the scenario rule library does not exist, so that the cloud server processes the first data.

[0255] In some embodiments, the first receiving module 1001 is further used to receive a notification message sent by the cloud server; the notification message is used to instruct the cloud server to obtain the updated scenario rule library;

[0256] The first sending module 1003 is further used to send a pull message in response to the notification message to the cloud server, and the pull message is used to instruct to pull the updated scenario rule library from the cloud server.

[0257] The present application embodiment provides a data processing device 1100, which is applied to a cloud service end, such as Fig.11 As shown, the data processing device 1100 includes:

[0258] The second receiving module 1101 is used to receive first data sent by the gateway; the first data is data reported to the gateway by the at least one device;

[0259] Used to train a prediction model using the first data and historical data of the at least one device to obtain a converged prediction model;

[0260] An updating module 1103, configured to convert the converged prediction model into an updated scenario rule library;

[0261] The second sending module 1104 is configured to send the updated scenario rule library to the gateway, where the updated scenario rule library is used to update the scenario rule library in the gateway.

[0262] In some embodiments, the training module 1102 is further configured to:

[0263] filtering the first data according to a device data model of each of the at least one device, wherein the device data model represents functions supported by the device;

[0264] extracting data features from the filtered first data based on a device type of each of the at least one device;

[0265] The prediction model is trained using the data features and the historical data to obtain a converged prediction model.

[0266] In some embodiments, the apparatus 1100 further includes: a second determining module, configured to:

[0267] Determine the function data included in at least one behavior rule included in the scenario rule base; wherein the scenario rule base includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model;

[0268] determining a second similarity between the first data and each data in the historical data and the functional data in the at least one behavior rule;

[0269] determining a similarity threshold according to the determined second similarity;

[0270] The similarity threshold is sent to the gateway, and the similarity threshold is used to determine a processing result of the first data when the first data does not match the scenario rule.

[0271] In some embodiments, the second determining module is used to:

[0272] Obtaining a first coefficient and a second coefficient, wherein the first coefficient is a standard deviation of the functional data included in the at least one behavioral rule, and the second coefficient is a mean of the functional data included in the at least one behavioral rule;

[0273] Determine at least two data ranges according to the first coefficient and the second coefficient; wherein the probability values ​​of data distribution in different data ranges are different;

[0274] Taking each of the first data and the historical data as target data, the following processing is performed on the target data: determining the probability value corresponding to the data range to which the target data belongs in the at least two data ranges as the second similarity.

[0275] In some embodiments, the second determining module is used to:

[0276] Sorting the determined second similarities to obtain a sorting result;

[0277] Determining a split point in the sorting result according to a set ratio;

[0278] The second similarity corresponding to the segmentation point is determined as the similarity threshold.

[0279] In some embodiments, the apparatus 1100 further includes:

[0280] A second judgment module is used to judge whether the gateway end pulls the scenario rule from the cloud service end;

[0281] The second processing module is used to process the first data based on the locally stored scenario rule library to obtain a processing result when the result of the judgment is that the gateway end has not pulled the scenario rule library from the cloud service end.

[0282] In some embodiments, the second sending module 1103 is further used to send a notification message to the gateway end; the notification message is used to instruct the cloud service end to obtain the updated scenario rule library;

[0283] The second receiving module 1101 is further used to receive a pull message returned by the gateway in response to the notification message, wherein the pull message is used to instruct the gateway to pull the updated scenario rule library from the cloud service end.

[0284] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.

[0285] It should be noted that in the embodiment of the present application, if the above-mentioned data processing method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0286] Correspondingly, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the data processing method provided in the above embodiment are implemented.

[0287] Correspondingly, an embodiment of the present application provides a storage medium, that is, a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data processing method provided in the above embodiment is implemented.

[0288] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0289] It should be noted that Fig.12 A schematic diagram of a hardware entity of an electronic device (gateway or cloud service end) in an embodiment of the present application, such as Fig.12 As shown, the electronic device 1200 includes: a processor 1201, at least one communication bus 1202, at least one external communication interface 1204 and a memory 1205. The communication bus 1202 is configured to realize connection and communication between these components. The external communication interface 1204 may include a standard wired interface and a wireless interface.

[0290] The memory 1205 is configured to store instructions and applications executable by the processor 1201, and can also cache data to be processed or processed by the processor 1201 and various modules in the electronic device (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).

[0291] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in some embodiments" appearing throughout the specification may not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The above-mentioned sequence numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.

[0292] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0293] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0294] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0295] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0296] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0297] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can be essentially or partly embodied in the form of a software product that contributes to the relevant technology. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0298] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data processing method, It is characterized in that Applied to a gateway end connected to a cloud service end and at least one device respectively; the method comprises: Receiving first data reported by the at least one device; Matching the first data with each scenario rule in a scenario rule library; the scenario rule library includes at least two scenario rules, the scenario rule library includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model; the scenario rule includes function data and an action corresponding to the function data; When the first data matches the function data of the target scenario rule in the scenario rule library, determining the action of the target scenario rule; When the first data does not match the functional data in any scenario rule in the scenario rule library, determine the functional data included in the at least one behavior rule; determine a first similarity between the first data and the functional data in the at least one behavior rule; based on the first similarity, determine a processing method corresponding to the first data, the processing method including no processing or alarm; Sending the first data to the cloud server; the first data is used by the cloud server to obtain an updated scene rule library; The updated scenario rule library sent by the cloud server is received, and second data reported by the at least one device is received, so as to process the second data through the updated scenario rule library.

2. The method according to claim 1, It is characterized in that The determining a first similarity between the first data and the functional data in the at least one behavior rule includes: Obtaining a first coefficient and a second coefficient, wherein the first coefficient is a standard deviation of the functional data included in the at least one behavioral rule, and the second coefficient is a mean of the functional data included in the at least one behavioral rule; Determine at least two data ranges according to the first coefficient and the second coefficient; wherein the probability values ​​of data distribution in different data ranges are different; A probability value corresponding to the data range to which the first data belongs in the at least two data ranges is determined as the first similarity.

3. The method according to claim 1, It is characterized in that The determining, based on the first similarity, a processing method corresponding to the first data includes: When the first similarity is greater than a similarity threshold, it is determined that a processing method corresponding to the first data is an alarm.

4. The method according to claim 1, It is characterized in that After receiving the first data reported by the at least one device, the method further includes: Determine whether the scenario rule library exists; When the result of the judgment is that the scenario rule library does not exist, the first data is sent to the cloud server, so that the cloud server processes the first data.

5. The method according to claim 1, It is characterized in that After sending the first data to the cloud service end, the method further includes: Receiving a notification message sent by the cloud server; the notification message is used to instruct the cloud server to obtain the updated scenario rule library; A pull message in response to the notification message is sent to the cloud server, where the pull message is used to instruct to pull the updated scenario rule library from the cloud server.

6. A data processing method, It is characterized in that Applied to a cloud service end, the cloud service end is connected to a gateway end, the gateway end is connected to at least one device, and the method includes: Receiving first data sent by the gateway; the first data is data reported to the gateway by the at least one device; Training a prediction model using the first data and historical data of the at least one device to obtain a converged prediction model; Obtaining an updated scenario rule library based on the prediction model; The updated scenario rule library is sent to the gateway end, and the updated scenario rule library is used to update the scenario rule library in the gateway end; wherein the gateway end is used to receive the first data reported by the at least one device; match the first data with each scenario rule in the scenario rule library; when the first data matches the functional data of the target scenario rule in the scenario rule library, determine the action of the target scenario rule; when the first data does not match the functional data in any scenario rule in the scenario rule library, determine the functional data included in at least one behavior rule; determine the first similarity between the first data and the functional data in the at least one behavior rule; based on the first similarity, determine the processing method corresponding to the first data, and the processing method includes no processing or alarm; wherein the scenario rule library includes at least two scenario rules, and the scenario rule library includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model; the scenario rule includes functional data and actions corresponding to the functional data.

7. The method according to claim 6, It is characterized in that The step of training the prediction model by using the first data and the historical data of the at least one device to obtain a converged prediction model includes: filtering the first data according to a device data model of each of the at least one device, wherein the device data model represents functions supported by the device; extracting data features from the filtered first data based on a device type of each of the at least one device; The prediction model is trained using the data features and the historical data to obtain a converged prediction model.

8. The method according to claim 6, It is characterized in that The method further comprises: determining functional data included in the at least one behavior rule; determining a second similarity between the first data and each data in the historical data and the functional data in the at least one behavior rule; determining a similarity threshold according to the determined second similarity; The similarity threshold is sent to the gateway end; the similarity threshold is used to determine the processing result of the first data when the first data does not match the scenario rule.

9. The method according to claim 8, It is characterized in that The determining of the second similarity between the first data and each data in the historical data and the functional data in the at least one behavior rule includes: Obtaining a first coefficient and a second coefficient, wherein the first coefficient is a standard deviation of the functional data included in the at least one behavioral rule, and the second coefficient is a mean of the functional data included in the at least one behavioral rule; Determine at least two data ranges according to the first coefficient and the second coefficient; wherein the probability values ​​of data distribution in different data ranges are different; Taking each of the first data and the historical data as target data, the following processing is performed on the target data: determining a probability value corresponding to the data range to which the target data belongs in the at least two data ranges as the second similarity.

10. The method according to claim 8, It is characterized in that The determining of the similarity threshold according to the determined second similarity comprises: Sorting the determined second similarities to obtain a sorting result; Determining a split point in the sorting result according to a set ratio; The second similarity corresponding to the segmentation point is determined as the similarity threshold.

11. The method according to claim 6, It is characterized in that After receiving the first data sent by the gateway, the method further includes: Determine whether the gateway end pulls the scenario rule from the cloud service end; When the result of the judgment is that the gateway has not pulled the scenario rule library from the cloud service end, the first data is processed based on the locally stored scenario rule library to obtain a processing result.

12. The method according to claim 6, It is characterized in that After obtaining an updated scenario rule library based on the prediction model, the method further includes: Sending a notification message to the gateway end; the notification message is used to instruct the cloud service end to obtain the updated scenario rule library; Receive a pull message returned by the gateway in response to the notification message; the pull message is used to instruct the gateway to pull the updated scenario rule library from the cloud service end.

13. A data processing device, It is characterized in that Applied to the gateway end, the device comprises: A first receiving module, configured to receive first data reported by at least one device; A first processing module, configured to process the first data through a scenario rule library to obtain a processing result; the scenario rule library includes at least two scenario rules; the scenario rule library includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model; A first sending module, used to send the first data to a cloud server; the first data is used by the cloud server to obtain an updated scene rule library; The first receiving module is further configured to receive the updated scenario rule library sent by the cloud server, and receive the second data reported by the at least one device, so as to process the second data through the updated scenario rule library; The first processing module is also used to match the first data with each scenario rule in the scenario rule library; the scenario rule includes function data and actions corresponding to the function data; when the first data matches the function data of the target scenario rule in the scenario rule library, the action of the target scenario rule is determined; when the first data does not match the function data in any scenario rule in the scenario rule library, the function data included in the at least one behavior rule is determined; a first similarity between the first data and the function data in the at least one behavior rule is determined; based on the first similarity, a processing method corresponding to the first data is determined, and the processing method includes no processing or an alarm.

14. A data processing device, It is characterized in that Applied to a cloud server, the device comprises: A second receiving module is used to receive first data sent by the gateway; the first data is data reported to the gateway by at least one device; A training module, configured to train a prediction model using the first data and historical data of the at least one device to obtain a converged prediction model; An updating module, used to obtain an updated scenario rule library based on the prediction model; a second sending module, configured to send the updated scenario rule library to the gateway end, wherein the updated scenario rule library is used to update the scenario rule library in the gateway end; wherein the gateway end is configured to receive the first data reported by the at least one device; match the first data with each scenario rule in the scenario rule library; when the first data matches the functional data of the target scenario rule in the scenario rule library, determine the action of the target scenario rule; when the first data does not match the functional data in any scenario rule in the scenario rule library, determine the functional data included in at least one behavior rule; determine the first similarity between the first data and the functional data in the at least one behavior rule; based on the first similarity, determine the processing method corresponding to the first data, the processing method including no processing or alarm; the scenario rule library includes at least two scenario rules, and the scenario rule library includes at least one behavior rule and at least one alarm rule; the at least one behavior rule represents a user behavior model; the at least one alarm rule represents an alarm model; the scenario rule includes functional data and actions corresponding to the functional data.

15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, it implements the steps of the data processing method described in any one of claims 1 to 5, or implements the steps of the data processing method described in any one of claims 6 to 12.

16. A storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, it implements the data processing method described in any one of claims 1 to 5, or implements the data processing method described in any one of claims 6 to 12.