CN115514659A - Data processing method, device, equipment and storage medium - Google Patents

Data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115514659A
CN115514659A CN202110698725.2A CN202110698725A CN115514659A CN 115514659 A CN115514659 A CN 115514659A CN 202110698725 A CN202110698725 A CN 202110698725A CN 115514659 A CN115514659 A CN 115514659A
Authority
CN
China
Prior art keywords
data
rule base
scene
gateway
scene rule
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110698725.2A
Other languages
Chinese (zh)
Inventor
钟欣
郑志科
邓冬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110698725.2A priority Critical patent/CN115514659A/en
Publication of CN115514659A publication Critical patent/CN115514659A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/142Network analysis or design using statistical or mathematical methods
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • H04L41/147Network analysis or design for predicting network behaviour
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Abstract

The application discloses a data processing method, a device, equipment and a storage medium, comprising the following steps: receiving first data reported by the at least one device; processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules; sending the first data to the cloud server; the first data is used for the cloud server to obtain an updated scene rule base; receiving the updated scene rule base sent by the cloud server, receiving second data reported by the at least one device, and processing the second data through the updated scene rule base; the ability of the cloud server side for processing mass data, the high efficiency of the gateway for processing the near-end data and the stability of the connection between the gateway and the equipment are combined, and the comfort and the safety of the home are improved.

Description

Data processing method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and relates to, but is not limited to, a data processing method, apparatus, device, and storage medium.
Background
With the development of the internet of things technology, smart homes increasingly permeate daily life and gradually become reality as an important application field. Under the application field of the intelligent home, people put forward higher requirements on the situation perception capability of the intelligent home, including intelligent linkage, home hidden dangers, illegal invasion and intelligent energy conservation.
With the large-scale access of the intelligent home devices to the internet of things, the number of terminal devices is increased, the business requirements of users are diversified, the problems of mass data processing, bandwidth consumption, network delay, blockage and the like are more and more prominent, and the development trend of future intelligent home cannot be met by means of cloud computing alone. To this end, edge computing is introduced to bring services closer to end users by centralizing the available computing, storage and network resources at the edge of the network. The high-timeliness real-time processing of the edge data is achieved through edge computing, all data do not need to be uploaded to a cloud end to be processed, and therefore the pressure of cloud computing is relieved, data delay is reduced, and bandwidth pressure is reduced. However, the computing resources and storage capacity of the edge computing are limited, and when the data volume is too large, the data also needs to be uploaded to a cloud service for processing. The cloud computing and the edge computing are combined for use (cloud edge cooperation), the joint advantages of the cloud computing and the edge computing are fully utilized, and higher-quality service can be provided for users.
In the related art, the scheme for processing the device data includes cloud computing or edge computing.
The data processing of cloud computing is as follows: the cloud end, namely the cloud service end, collects a large amount of data uploaded by equipment, forms an inference rule through big data, machine learning and other related technologies, and processes the context information in a target context according to the inference rule after the cloud end acquires the context information, so that autonomous inference service is completed, and related equipment is controlled or corresponding feedback is given to a user. However, as more and more sensor devices upload data to the cloud, the cloud processes rules, which may cause problems of delay and blocking, and the connection between the device and the cloud may be unstable, so that corresponding processing cannot be performed. The data for the edge calculation is processed as follows: the method comprises the steps that a scene rule is placed at a gateway end, and the gateway end processes data of equipment to achieve a scene related to the rule scene data; the gateway adopts edge calculation to efficiently process near-end data, and the connection between the gateway end and the intelligent equipment is relatively stable; however, due to the limited computing capability of the gateway, certain reasoning capability is lacked, and only the processing of the data of a specific preset scene can be completed.
Disclosure of Invention
The embodiment of the application provides a data processing method, a data processing device, equipment and a storage medium, and can improve the comfort and the safety of a home by combining the capacity of mass data processing of a cloud server and the advantages of high efficiency of near-end data processing of a gateway end and the stability of connection between the gateway end and the equipment.
The technical scheme of the embodiment of the application is realized as follows:
the embodiment of the application provides a data processing method, which is applied to a gateway end respectively connected with a cloud server end and at least one device; the method comprises the following steps:
receiving first data reported by the at least one device;
processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules;
sending the first data to a cloud server; the first data is used for the cloud server to obtain an updated scene rule base;
receiving the updated scene rule base sent by the cloud server, and receiving second data reported by the at least one device, so as to process the second data through the updated scene rule base.
The embodiment of the application provides a data processing method, which is applied to a cloud server, wherein the cloud server is connected with a gateway, and the gateway is connected with at least one device, and the method comprises the following steps:
receiving first data sent by the gateway end; the first data is data reported to the gateway terminal by the at least one device;
training a prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model;
converting the converged prediction model into an updated scene rule base;
and sending the updated scene rule base to the gateway terminal, wherein the updated scene rule base is used for updating the scene rule base in the gateway terminal.
The embodiment of the application provides a data processing device, which is applied to a gateway terminal, and the device comprises:
a first receiving module, configured to receive first data reported by the at least one device;
the first processing module is used for processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules;
the first sending module is used for sending the first data to a cloud server; the first data is used for the cloud server to obtain an updated scene rule base;
the first receiving module is further configured to receive the updated scene rule base sent by the cloud server, and receive second data reported by the first device, so as to process the second data through the updated scene rule base.
The embodiment of the application provides a data processing device, its characterized in that is applied to the cloud server, the device includes:
the second receiving module is used for receiving the first data sent by the gateway end; the first data is data reported to the gateway terminal by the at least one device;
the training module is used for training a prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model;
the updating module is used for converting the converged prediction model into an updated scene rule base;
and the second sending module is used for sending the updated scene rule base to the gateway terminal, and the updated scene rule base is used for updating the scene rule base in the gateway terminal.
The embodiment of the application further provides an electronic device, which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor executes the computer program to realize the steps in the data processing method of the gateway terminal or the cloud service terminal.
The embodiment of the application also provides a storage medium, wherein a computer program is stored on the storage medium, and when the computer program is executed by a processor, the data processing method of the gateway terminal or the cloud server terminal is realized.
The data processing method, the device, the equipment and the storage medium provided by the embodiment of the application receive first data reported by at least one piece of equipment; processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules; sending the first data to a cloud server; the first data is used for the cloud server to obtain an updated scene rule base; receiving the updated scene rule base sent by the cloud server, receiving second data reported by the at least one device, and processing the second data through the updated scene rule base; the data of the equipment are processed through the scene rules by the gateway at the near end of the equipment, and the scene rules used by the gateway end are updated by the cloud service end, so that the capability of the cloud service end for processing mass data, the high efficiency of the gateway end for processing the near end data and the advantage of the stability of connection between the gateway end and the equipment are combined, the appropriate feedback suitable for the current context of the user can be made according to the data transmitted by the equipment under the intelligent home, and the comfort and the safety of the home are improved.
Drawings
FIG. 1 is a schematic diagram of an alternative configuration of a data processing system according to an embodiment of the present application;
fig. 2 is an alternative flow chart of a data processing method according to an embodiment of the present disclosure;
fig. 3 is an alternative flow chart of a data processing method according to an embodiment of the present application;
fig. 4 is an alternative flow chart of the data processing method according to the embodiment of the present application;
fig. 5 is an alternative flow chart of the data processing method according to the embodiment of the present application;
fig. 6 is an alternative flow chart of the data processing method according to the embodiment of the present application;
fig. 7 is an alternative flow chart of the data processing method according to the embodiment of the present application;
fig. 8 is an alternative flowchart of a data processing method according to an embodiment of the present application;
fig. 9 is an alternative flowchart of a data processing method according to an embodiment of the present application;
FIG. 10 is a schematic diagram of an alternative structure of a data processing apparatus according to an embodiment of the present application;
fig. 11 is an alternative structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 12 is an alternative structural schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will describe the specific technical solutions of the present application in further detail with reference to the accompanying drawings in the embodiments of the present application. The following examples are intended to illustrate the present application but are not intended to limit the scope of the present application.
The embodiment of the application can be provided as a data processing method and device and a storage medium. In practical applications, the data processing method may be implemented in an electronic device, and each functional entity in the electronic device may be cooperatively implemented by hardware resources of the electronic device (e.g., a terminal device, a gateway, and a server), such as computing resources like a processor, and communication resources (e.g., for supporting various communications such as optical cables and cellular communications).
The data processing method provided by the embodiment of the application is applied to a data processing system.
As an example, a data processing system may be configured as shown in FIG. 1, including: the system comprises a cloud server 101, a gateway 102 and a plurality of devices 103, wherein the devices 103 are connected with the gateway 102, and the gateway 102 is connected with the cloud server 101. Optionally, the device 103 may include an internet of things device such as a sensor, and the gateway 102 may be an edge gateway. The cloud server 101 may be a cloud-side internet of things platform, and at this time, the data processing system may constitute an internet of things system.
The gateway 102 receives the data of the device 103, and the gateway 102 caches the data and uploads the data to the cloud server 101. Among other things, the device 103 may support multiple types of devices, such as: air conditioner, TV set, washing machine, intelligent lock, lighting apparatus, smoke transducer, water intake transducer, temperature and humidity transducer, air purifier and so on.
In this embodiment, the device 103 directly accesses the gateway end 103, and may also access the gateway end 103 through a terminal gateway.
The gateway 102 receives the first data reported by the at least one device 103; processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules; sending the first data to a cloud server 101; the first data is used for the cloud server to obtain an updated scene rule base;
the cloud service terminal 101 receives first data sent by the gateway terminal 102; training a prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model; converting the converged prediction model into an updated scene rule base; and sending the updated scene rule base to the gateway end 102, wherein the updated scene rule base is used for updating the scene rule base in the gateway end 102.
The gateway 102 receives the updated scene rule base sent by the cloud server, and receives second data reported by the at least one device, so as to process the second data through the updated scene rule base.
In combination with the data processing system shown in fig. 1, the embodiment provides a data processing method, and by combining the capability of mass data processing at the cloud server and the advantages of high efficiency of the gateway in near-end data processing and stability of connection between the gateway and the device, the method can implement appropriate feedback suitable for the current context of the user according to data transmitted from the device at the smart home, thereby improving the comfort and safety of the home.
Next, embodiments of the data processing method and apparatus and the storage medium provided by the embodiments of the present application are described with reference to a schematic diagram of a data processing system shown in fig. 1.
The embodiment provides a data processing method which is applied to electronic equipment. The functions implemented by the method can be implemented by calling program code by a processor in an electronic device, which at least comprises a processor and a storage medium. The electronic device is implemented as a gateway side or a cloud service side.
Of course, the embodiments of the present application are not limited to being provided as methods and hardware, and may be provided as a storage medium (storing instructions for executing the data processing method provided by the embodiments of the present application) in various implementations.
Fig. 2 is a schematic flow chart of an implementation of a data processing method according to an embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
s201, the gateway receives first data reported by at least one device.
In this embodiment, the first data may include data reported by some or all of the at least one device within a period of time. The gateway end can receive a plurality of pieces of first data.
In one example, at least one device in an access gateway side includes: the first data includes data reported to the gateway end by the device 1 and the device 2, the device 3, the device 4, and the device 5.
In one example, at least one device in an access gateway side includes: the first data includes data reported to the gateway end by the device 1, the device 2, the device 3, the device 4, and the device 5.
In this embodiment of the application, the first data received by the gateway may be data generated by the device based on an operation behavior of a user, or may be data generated by the device based on a control instruction of the gateway.
In the embodiment of the application, the gateway stores the scene rule base, and the received data reported by the device before the scene rule base is updated is called as first data. In practical applications, the gateway periodically updates the scene rule base, and then data of at least one device received from the current scene rule base to a time period before the current scene rule base is updated is called as first data. The period for updating the scene rule base may be one day, 5 days, 15 days, one month, etc.
In this embodiment, the data uploaded by different devices may be different, for example, the data reported by the temperature and humidity sensor includes: temperature, humidity, the data that smoke transducer reported include: the smoke amount and the data reported by the air purifier are the air quality.
S202, the gateway end processes the first data through a scene rule base corresponding to the first device to obtain a processing result.
The scene rule base comprises at least two scene rules.
And after receiving the first data, the gateway end processes the first data through the scene rules in the scene rule base to obtain a processing result. Here, the processing method for processing the current first data as a processing result may include: no processing, functions supported by the device in the at least one device, alarms, etc. When the processing result is non-processing, the gateway does not execute any next processing; when the processing result is a function, sending a control instruction to the equipment supporting the action to instruct the equipment supporting the function to execute the function; and when the processing result is the alarm, determining the alarm equipment, sending an alarm instruction to the alarm equipment, and instructing the alarm equipment to execute alarm processing based on the alarm instruction. In the embodiment of the present application, the processing result may further include other forms of processing methods, and the processing form of the processing result is not limited in any way in the embodiment of the present application.
It should be noted that, when the processing result is an action, the device reporting the first data and the device supporting the action may be the same device or different devices.
In one example, when the first data includes: and when the current environment temperature reported by the air conditioner is determined to be the refrigerating temperature of the air conditioner based on the scene rule, the air conditioner is instructed to reduce the refrigerating temperature, and at the moment, the equipment to which the first data belongs and the equipment supporting the action are both the air conditioner.
In one example, when the first data includes: the intelligent door lock detects the door lock state, the action determined based on the scene rule is to turn on the lamp, then the lamp is indicated to be turned on, at the moment, the equipment to which the first data belongs is the door lock, and the equipment supporting the action is the lamp.
It should be noted that, in this embodiment of the application, when the processing result is that the indicating device executes the action, the device supporting the action generates data, and reports the data generated based on the processing result to the gateway terminal, at this time, if the time for reporting the data generated based on the processing result is before the scene rule base is updated, the data generated based on the processing result may be used as new first data, and the gateway terminal processes the first data generated based on the processing result through the scene rule base.
S203, the gateway side sends the first data to the cloud server side.
The first data is used for the cloud server to obtain an updated scene rule base;
in the embodiment of the application, the gateway side processes the first data and sends the first data to the cloud server side. Under the condition that the connection between the gateway and the cloud service end is established, the gateway directly sends the first data to the cloud service end. Under the condition that the connection between the gateway end and the cloud server end is disconnected, the gateway caches the first data, and after the connection between the gateway end and the cloud server end is established, the cached first data is sent to the cloud server end through the established connection.
And after receiving the first data, the cloud server obtains the updated scene rule through the first data and the historical data of the at least one device. The historical data is data reported by at least one device before first data sent by the gateway to the cloud server, and optionally, the historical data may be historical data within a period of time.
In some embodiments, the scenario rules in the gateway side may be derived based on historical data. Here, before receiving the first data, the cloud service side may obtain a scene rule base based on the historical data, and send the scene rule base to the gateway side, so that the gateway side processes the first data based on the scene rule base.
And after the cloud server side obtains the updated scene rule base, the updated scene rule base is sent to the gateway side.
And S204, the gateway receives the updated scene rule base sent by the cloud server, receives second data reported by the first device, and processes the second data through the updated scene rule base.
Here, the data reported by the device received after receiving the updated scene rule base is referred to as second data. And after receiving the updated scene rule base, the gateway equipment processes the second data through the updated scene rule base.
When it needs to be explained, before the gateway device receives the updated scene rule, the gateway device processes the data reported by the device through the non-updated scene rule.
The data processing method provided by the embodiment of the application can be applied to the following scenes:
in scene 1, in month 1 and month 2, the gateway side processes data reported by the equipment through the scene rules in the scene rule base 1 and sends the received data to the cloud server side, in morning in month 1 and month 3, the cloud server side obtains the scene rule base 2 through the data sent by the gateway side in month 1 and month 2 and the data sent before month 1 and month 2 and sends the scene rule base 2 to the gateway side, the gateway side receives the scene rule base 2, and in month 1 and month 3, the data reported by the equipment is processed through the scene rules in the scene rule base 2.
Scene 2, under the condition that the gateway end is disconnected from the cloud server, processing data reported by the equipment through the scene rule base 1, caching the data reported by the equipment, under the condition that the gateway end is connected with the cloud server, sending the cached data to the cloud server, and obtaining an updated scene rule base by the cloud server based on the received data and historical data: and the scene rule base 2 sends the scene rule base 2 to the gateway end, and after receiving the scene rule base 2, the gateway end 2 processes the data reported by the equipment after receiving the scene rule base 2 based on the scene rule base 2.
In the data processing method provided by the embodiment of the application, a gateway receives first data reported by at least one device; processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules; sending the first data to a cloud server; the first data is used for the cloud server to obtain an updated scene rule base; receiving the updated scene rule base sent by the cloud server, receiving second data reported by the at least one device, and processing the second data through the updated scene rule base; the method has the advantages that the data of the equipment are processed through the scene rules by the gateway at the near end of the equipment, and the scene rules used by the gateway are updated by the cloud server, so that the appropriate feedback suitable for the current context of a user can be made according to the data transmitted by the equipment under the intelligent home by combining the capacity of processing the mass data of the cloud server and the advantages of the high efficiency of processing the near-end data by the gateway and the stability of connection between the gateway and the equipment, the comfort and the safety of the home are improved, and high-quality home service is provided.
In some embodiments, the scenario rule includes functional data and an action corresponding to the functional data; the implementation of S202 includes the following steps:
s2021, matching the first data with each scene rule in the scene rule base;
the scene rule base comprises a plurality of scene rules, each scene rule comprises function data and an action 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: the temperature is higher than the temperature threshold value, and if people are detected to move, the air conditioner is turned on, and in the scene rule, the triggering condition is as follows: and when the temperature is higher than the temperature threshold value, the state condition is that the movement of a person is detected, and the execution action is to turn on the air conditioner. In one example, if the scenario rule is that a gas leakage state is received, the user is notified, and in the scenario rule, the triggering condition is: receiving a gas leakage state, and executing the following actions: the user is notified.
For the first data, the gateway terminal matches the first data with the functional data of each scene rule in the scene rule base, and the rule matched with the first data in the scene rule base is called a target scene rule.
In an example, the first data includes: temperature 30 and smoke volume 40, including in the scene library the scene rules: the method comprises the following steps that a scene rule 1 is to start the air conditioner when the temperature is higher than 25, a scene rule 2 is to adjust the temperature of the air conditioner by one step when the temperature is between 25 and 20, a scene rule 3 is to close the air conditioner when the temperature is lower than 20, and the scene rule 1 is a target scene rule corresponding to the temperature 30 when the current temperature 30 is matched with the scene rule 1.
Here, when the target scene rule of the current first data is matched in the scene rule base, it indicates that the processing mode of the current first data is specified in the scene rule base, and when the target scene rule of the current first data is not matched in the scene rule base, it indicates that the processing mode of the current first data is not specified in the scene rule base.
S2022, when the first data is matched with the functional data of the target scene rule in the scene rule base, determining the action of the target scene rule;
when the target scene rule corresponding to the first data exists, corresponding processing is executed based on the action in the target scene rule. Wherein the action here may be a function or an alarm supported by a device of the at least one device. When the action is a function, sending a control instruction to the equipment supporting the action to instruct the equipment supporting the function to execute the function; and when the processing result is an alarm, determining alarm equipment, sending an alarm instruction to the alarm equipment, and instructing the alarm equipment to execute alarm processing based on the alarm instruction.
S2023, when the first data is not matched with the functional data in any scene rule in the scene rule base, determining a processing mode corresponding to the first data based on the similarity between the first data and a user behavior model.
When the target scene corresponding to the first data does not exist in the scene rule base, determining the similarity between the first data and the user behavior model, and determining the processing mode corresponding to the first data according to the similarity between the first data and the user behavior model.
Here, the higher the similarity between the first data and the user behavior model is, the more the first data is characterized by conforming to the behavior habit of the user, and the lower the similarity between the first data and the user behavior model is, the more the first data is characterized by conforming to the behavior habit of the user. And when the first data accords with the behavior habit of the user, the processing mode corresponding to the first data is not processed, and when the first data does not accord with the behavior habit of the user, the processing mode corresponding to the first data is an alarm.
In some embodiments, the scenario rules library comprises at least one behavior rule and at least one alarm rule; the at least one behavior rule characterizes a user behavior model; the at least one alarm rule characterizes an alarm model; before determining the processing mode corresponding to the first data based on the similarity between the first data and the user behavior model in S2022, the method further includes the following steps:
s2023, determining functional data included by the at least one behavior rule;
s2024, determining a first similarity between the first data and the functional data in the at least one behavior rule.
The functional data in the at least one behavior rule can represent the normal behavior profile of the user, namely the normal behavior habit of the user, and the gateway determines the first similarity between the first data and the functional data in the at least one behavior rule, namely the similarity between the first data and the normal behavior profile of the user.
In the embodiment of the present application, the scene rule base includes two types of scene rules: behavior rules and alarm rules. The behavior rules characterize normal operation of the device, and thus, the behavior rules can characterize a user behavior model that reflects the behavior habits of the user. The alarm rule is a rule which can trigger equipment alarm, such as equipment fault or alarm, and the like, and represents the abnormal operation of the equipment, so that the alarm rule can represent an alarm model reflecting the abnormal condition processing. The behavior rules in the scene rule base form a normal behavior rule base, and the alarm rules in the scene rule base form an alarm rule base.
And the gateway terminal compares the similarity of the first data with the functional data of the action rule in the normal action rule base. Here, the similarity between the first data and the whole may be calculated by using the functional data of the behavior rules in the normal behavior rule base as a whole, or the similarity scores of the first data and the functional data in the respective behavior rules may be calculated separately, and the similarity may be calculated based on all the similarity scores.
When needing to be explained, the gateway end determines the reference scene rule related to the first data from the scene rule base,
in some embodiments, the implementation of S2024 comprises the steps of:
s2241, obtaining a first coefficient and a second coefficient, where the first coefficient is a standard deviation of the functional data included in the at least one behavior rule, and the second coefficient is a mean value of the functional data included in the at least one behavior rule;
s2242, determining at least two data ranges according to the first coefficient and the second coefficient; wherein, the probability values of the data distributed in different data ranges are different;
s2243, determining a probability value corresponding to a data range to which the first data belongs in the at least two data ranges as the first similarity.
Here, the first coefficient, which is the standard deviation of all the functional data in the behavior rule base, is represented by σ, the second coefficient, which is the mean value of all the functional data in the behavior rule base, is represented by μ, and the gateway determines a plurality of data ranges based on σ and μ. In the embodiment of the application, a plurality of data ranges are determined based on the first data and the second coefficient, and the probability values of the data distributed in different data ranges are different.
Taking the example of determining three data ranges, the three data ranges include:
data range one, (μ - σ, μ + σ), corresponding to a probability of 0.6826, the probability of a token value distribution in (μ - σ, μ + σ) is 0.6826;
data range two, (μ -2 σ, μ +2 σ), corresponding to a probability of 0.9545, the probability of characterizing the numerical distribution in μ -2 σ, μ +2 σ) is 0.9545;
data range three, (μ -3 σ, μ +3 σ), corresponding to a probability of 0.9973, the probability of the token value distribution in (μ -3 σ, μ +3 σ) is 0.9973.
And the gateway terminal determines the first similarity corresponding to the first data according to the probability corresponding to the data range in which the first data falls.
In some embodiments, the determining, in S2022, the implementation of the processing manner corresponding to the first data based on the similarity between the first data and the user behavior model includes the following steps:
and when the first similarity is larger than a similarity threshold, determining that the processing mode corresponding to the first data is an alarm.
Here, when the first similarity is smaller than the similarity threshold, the current first data is represented to conform to the user behavior model, the processing mode is not processing, and when the first similarity is larger than the similarity threshold, the current first data is represented to not conform to the user behavior model, and the processing mode is an alarm.
In some embodiments, after S201, the following steps are also implemented:
judging whether the scene rule base exists or not;
and sending the first data to the cloud server under the condition that the scene rule base does not exist in the judgment result, so that the cloud server processes the first data.
At this time, as shown in FIG. 3,
s301, the gateway receives first data reported by at least one device.
S302, the gateway judges whether a scene rule base exists locally.
If there is, S303 is executed, and if there is no, S304 is executed.
And S303, the gateway side processes the first data through the local scene rule to obtain a processing result.
S304, the gateway side sends the first data to the cloud service side.
Here, the first data is processed through a scene rule base of the cloud server, and a processing result is obtained.
After S203, the gateway further performs the following steps:
receiving a notification message sent by the cloud server; the notification message is used for indicating the cloud server to obtain the updated scene rule base;
and sending a pull message responding to the notification message to the cloud server, wherein the pull message is used for indicating that the updated scene rule base is pulled from the cloud server.
In the embodiment of the application, the gateway end is not required to be continuously connected with the cloud server end, and the notification message of the cloud server end can be received under the condition that the connection is established between the gateway end and the cloud server end, so that the scene rule base is pulled from the cloud end, and the wireless resources are saved.
The embodiment of the application provides a data processing method which is applied to a cloud server. The functions realized by the method can be realized by calling the program codes through a processor in the cloud service end, and the program codes can be saved in a computer storage medium.
Of course, the embodiments of the present application are not limited to being provided as methods and hardware, and may be provided as a storage medium (storing instructions for executing a data processing method provided by the embodiments of the present application) in various implementations.
Based on the data processing system shown in fig. 1, fig. 4 is a schematic flow chart of an implementation of a data processing method according to an embodiment of the present application, and as shown in fig. 4, the method includes the following steps:
s401, the cloud server receives the first data sent by the gateway.
The first data is data reported to the gateway terminal by the at least one device.
In this embodiment of the application, the first data may include data that is reported by some or all of the at least one device sent by the gateway to the cloud server within a period of time.
In one example, at least one device in an access gateway end includes: the first data includes data reported to the gateway end by the device 1 and the device 2, the device 3, the device 4, and the device 5.
In one example, at least one device in an access gateway end includes: the first data includes data reported to the gateway end by the device 1, the device 2, the device 3, the device 4, and the device 5.
In this embodiment of the application, the first data received by the gateway may be data generated by the device based on an operation behavior of a user, or may be data generated by the device based on a control instruction of the gateway.
In the embodiment of the application, the gateway stores the scene rule base, and the received data reported by the device before the scene rule base is updated is called as first data. In practical application, the gateway periodically updates the scene rule base, and then the data of at least one device received from the current scene rule base to the time before the current scene rule base is updated is called as first data, and the first data is sent to the cloud service end. The period for updating the scene rule base may be one day, 5 days, 15 days, one month, etc.
In this embodiment of the application, data uploaded by different devices may be different, for example, data reported by the temperature and humidity sensor includes: temperature, humidity, the data that smoke transducer reported include: the smoke amount and the data reported by the air purifier are the air quality.
S402, the cloud server trains a prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model.
After receiving the first data, the cloud server acquires historical data of at least one device, where the historical data may be data within a period of time or historical data of a scene rule base for processing the first data in the gateway.
The cloud server side directly takes the first data and the historical data as training data of the prediction model to train the prediction model, and can also carry out filtering and feature extraction on the first data to obtain data features of the first data, and take 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 comprise first data and historical data, storing the historical data in the cloud server; and when the training data comprises the data characteristics of the first data and the data characteristics of the historical data, caching the data characteristics of the historical data in the cloud server.
In the 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. Wherein the single model employing the machine learning algorithm may include: support Vector Machines (SVMs), logistic Regression (LR), expandable Gradient Boosting tree algorithm (XGBoost), light Gradient Boosting tree algorithm (LightGBM), etc. in an example, the prediction model is XGBoost.
In the embodiment of the application, the prediction model can continuously learn the relation between the state of the equipment and the equipment through training of the training data on the prediction model, so that the converged prediction model can learn the behavior profile of the user. Here, the first data and the history data may include normal data of each device and may also include data in case of an alarm, and thus, the user behavior profile may include a normal behavior profile and an alarm behavior profile.
And S403, the cloud server obtains an updated scene rule base based on the prediction model.
The converged prediction model can learn the user behavior profile, and then the user behavior profile can be embodied, so that the scene rule obtained by the cloud service end based on the prediction model can also embody the user behavior profile. The user behavior profile comprises a normal behavior profile and an alarm behavior profile, so the scene rules converted by the prediction model comprise behavior rules representing the normal behavior profile and alarm rules representing the alarm behavior profile.
In the embodiment of the application, the cloud server can input the device data of each device in at least one device accessed to the gateway into the prediction model to obtain the output obtained by the prediction model, and obtain a scene rule based on one input and the input corresponding to the input, so that the scene rule converted by the prediction model is obtained based on the device data of each device. Wherein the device data of the device characterizes 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.
In this embodiment of the present application, device data of each device may be represented by a device data model of the device, where the device data may include a Thing model (TSL), the TSL includes an attribute, a service, and an event, the attribute represents a basic function supported by the device, and a parameter of the attribute may include a function name, a function identifier, a data type, a value range, a step size, a unit, a read-write type (read-write or read-only), and the like. The service characterizes a service other than the basic functions that the device can provide, and the parameters of the service may include: function name, function identifier, calling mode, input parameter, output parameter, etc., wherein the input parameter and the output parameter's subparameter includes: parameter name, parameter identifier, data type, value range, step size, unit, etc. The event represents the events which can trigger the alarm, such as faults, alarms and the like, and the parameters of the events comprise: the system comprises a function name, a function identifier, an event type, an output parameter and the like, wherein the output parameter is composed of a parameter name (fault number), a parameter identifier, a data type, an enumerated value and the like.
After the cloud server obtains the scene rules converted by the prediction model, an updated scene rule base can be directly formed on the basis of the scene rules converted by the prediction model, and the current scene rule base in the cloud server can be updated on the basis of the scene rules converted by the prediction model to obtain the updated scene rule base. The current scene rule base in the cloud server is the same as the scene rule base used by the gateway for processing the first data.
S404, the cloud server side sends the updated scene rule base to the gateway side.
And the updated scene rule base is used for updating the scene rule base in the gateway terminal.
And after the cloud server side obtains the updated scene rule base, the updated scene rule base is sent to the gateway side, the gateway side receives the updated scene rule base sent by the cloud server side, updates the original scene rule base, replaces the original scene rule base, and processes second data received after the updated scene rule base is received through the updated scene rule base.
In some embodiments, S402 training a predictive model with the first data and the historical data of the at least one device, the implementation of the converged predictive model comprising the steps of: filtering the first data according to a device data model of each device in the at least one device; the device data model characterizes functions supported by the device; extracting data features in the filtered first data based on a device type of each of the at least one device; and training the prediction model through the data characteristics and the historical data to obtain a convergent prediction model.
In the embodiment of the application, before the prediction model is trained based on the first data, the first data may be filtered and feature extracted, and the prediction model is trained through the data features extracted by the feature extraction.
In some embodiments, the scenario rules library comprises at least one behavior rule and at least one alarm rule; the at least one behavior rule characterizes a user behavior model; the at least one alarm rule represents an alarm model; the cloud server also implements the following steps:
s405, determining function data included in the at least one behavior rule;
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;
s407, determining a similarity threshold according to the determined second similarity;
s408, sending the similarity threshold to the gateway, wherein the similarity threshold is used for determining the processing result of the first data when the first data is not matched with the scene rule.
In some embodiments, the implementation of S406 includes:
s4061, acquiring a first coefficient and a second coefficient, where the first coefficient is a standard deviation of the functional data included in the at least one behavior rule, and the second coefficient is a mean value of the functional data included in the at least one behavior rule;
s4062, determining at least two data ranges according to the first coefficient and the second coefficient; the probability values of the data distributed in different data ranges are different;
s4063, with each piece of data in the first data and the historical data as target data, executing the following processing on the target data: and 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.
In some embodiments, the implementation of S407 comprises:
s4071, sorting the determined second similarity to obtain a sorting result;
s4072, determining a segmentation point in the sequencing result according to a set proportion;
s4073, determining the second similarity corresponding to the segmentation point as the similarity threshold.
In the embodiment of the application, the similarity between each piece of training data in the training data obtained by training the prediction model and the user behavior model, namely the second similarity, can be calculated, all the second similarities are ranked, the segmentation points of the similarities are determined according to the ranking result, and the second similarities of the segmentation points are used as the similarity threshold.
In one example, all the second similarities are sorted in order from small to large, and 10% is taken as a set proportion, and at this time, the second similarity at the position of 10% ranked from the first to the high is determined as the similarity threshold.
In some embodiments, the cloud server further performs the following steps:
judging whether the gateway terminal pulls the scene rule from the cloud server terminal;
and processing the first data based on the locally stored scene rule base to obtain a processing result under the condition that the judging result is that the scene rule base is not pulled from the cloud server side by the gateway side.
At this time, as shown in fig. 5, the cloud server implements the following steps:
s501, judging whether the gateway side pulls the scene rule from the cloud server side.
If not, S502 is executed, and if already pulled, S503 is executed.
S502, processing the first data based on the locally stored scene rule base to obtain a processing result.
S503, determining the updated scene rule through the first data and the historical data.
The description of S503 can refer to the description of S402 and S403, and is not repeated here.
In some embodiments, after S403, the cloud server further implements the following steps:
sending a notification message to the gateway end; the notification message is used for indicating the cloud server to obtain the updated scene rule base; receiving a pull message returned by the gateway end in response to the notification message; the pull message is used for indicating the gateway end to pull the updated scene rule base from the cloud server end.
At this time, the cloud server responds to the pull message and sends the updated scene rule base to the gateway.
An embodiment of the present application provides a data processing method, which is applied to a data processing system including a gateway and a cloud server, and as shown in fig. 6, the method includes:
s601, the gateway receives the first data reported by the at least one device.
S602, the gateway end processes the first data through a scene rule base to obtain a processing result.
The scene rule base comprises at least two scene rules.
S603, the gateway side sends the first data to the cloud service side.
S604, the cloud server receives the first data sent by the gateway.
S605, the cloud server trains a prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model.
And S606, the cloud server obtains an updated scene rule base based on the prediction model.
And S607, the cloud service end sends the updated scene rule base to the gateway end.
And S608, the gateway receives the updated scene rule base sent by the cloud server, and receives second data reported by the at least one device, so as to process the second data through the updated scene rule base.
Here, the descriptions of S601, S602, S603, and S608 may be referred to the descriptions of S201, S202, S203, and S204, respectively, and the descriptions of S604, S605, S606, and S607 may be referred to the descriptions of S401, S402, S403, and S404, respectively, and are not repeated herein.
In the embodiment of the application, the gateway side processes the data reported by the equipment through the scene rule base and simultaneously sends the data reported by the equipment to the cloud service side, the cloud service side updates the scene rule base based on the data sent by the gateway side to obtain the updated scene rule base and sends the updated scene rule base to the gateway side, and the gateway side processes the data reported by the equipment based on the updated scene rule base, so that the comfort and the safety of a home are improved by combining the capacity of processing the mass data of the cloud service side, the high efficiency of processing the near-end data by the gateway and the advantage of the connection stability of the gateway and the equipment, and high-quality intelligent home service is provided.
The data processing method provided in the embodiment of the present application is further described below through a specific application scenario.
The data processing method provided in the embodiment of the present application is applied to the data processing system 100 shown in fig. 1, and includes: the cloud service terminal 101 is connected with the gateway terminal 102, and the gateway terminal 102 is connected with the device 103.
As shown in fig. 7, the method for processing an initial scene rule in a data processing method provided in the embodiment of the present application includes:
s701, the equipment reports the functions supported by the equipment to the cloud based on the TSL.
The equipment reports the functions supported by the equipment to a gateway end, namely the gateway, based on the TSL, and the gateway sends the functions supported by the equipment to the cloud.
In this embodiment of the present application, a function supported by a device may be defined as a TSL, and the TSL abstracts the function supported by the device into a data model, that is, a device data model, where the data model includes: attributes, services, and events. The attributes characterize the basic functionality of the device, and one attribute may be represented by: function name, function identifier, data type, value range, step size, unit, and read-write type (read-write or read-only). The services characterize the additional functionality provided by the device, a service can be represented by the following information: function name, function identifier, calling mode, input parameter, output parameter, etc., wherein the input parameter or the output parameter includes: parameter name, parameter identifier, data type, value range, step size, unit, etc. The event represents functions of equipment alarm, fault and the like, and one event can be represented by the following information: function name, function identification, event type and output parameter, wherein the output parameter is represented by parameter name (fault number), parameter identification, data type and enumeration value.
In the embodiment of the application, the complete object model of the equipment is identified by the JSON file, the equipment defines the functions supported by the equipment as data according to the TSL, and reports the data to the cloud, and the cloud analyzes the reported data of the equipment according to the TSL.
Here, after the gateway sends the data reported by the device to the cloud, the gateway can be disconnected from the cloud.
S702, the cloud obtains an initial scene rule according to the TSL.
The cloud obtains an initial scene rule according to the TSL self-defined rule, wherein the scene rule comprises: the behavior rules can form a behavior rule base, and the alarm rules can form an alarm rule base. The scenario rule may include the following elements: triggering conditions and executing actions, wherein the triggering conditions are function data of the scene rules, and the executing actions are actions of the scene rules. The scenario rules may also include the following elements: and the state condition is used for executing a corresponding execution action when the scene rule representation meets the trigger condition under the condition that the scene rule does not comprise the state condition, and executing the corresponding execution action when the scene rule meets the trigger condition and the state condition under the condition that the scene rule comprises the state condition, wherein the function data comprises the trigger condition and the state condition.
In one example, the behavior rules include: when the temperature is higher than the temperature threshold value and the movement of a person is detected, the air conditioner is turned on, and in the behavior rule, the triggering condition is as follows: and when the temperature is higher than the temperature threshold value, the state condition is that the movement of a person is detected, and the execution action is to turn on the air conditioner.
In one example, the action rule includes that all lights in the home are turned off at a certain time, and then in the action rule, the triggering condition is that the time is a certain time, and the action is performed to turn off all the lights in the home.
In an example, the behavior rule includes that the air conditioner is opened and the door is closed, and in the behavior rule, the triggering condition is that the air conditioner is opened and the execution action is closed.
In one example, the alert rules include: and informing a user when the gas leakage state is received, wherein in the alarm rule, the triggering conditions are as follows: receiving a gas leakage state, and executing the following actions: the user is notified.
In one example, the alert rules include: and if the received indoor temperature is higher than the threshold value, informing the user, wherein in the alarm rule, the triggering conditions are as follows: the indoor temperature is above a temperature threshold, performed as: the user is notified.
In one example, the alert rules include: receiving the smoke state detected by the smoke sensor, sending an alarm ring tone, wherein in the alarm rule, the triggering conditions are as follows: and after receiving the smoke state reported and detected by the smoke sensor, executing an action to send an alarm.
In the embodiment of the application, the difference between the behavior rule and the alarm rule is as follows: the executed action in the alarm rule is used for alarming, and the executed action in the behavior rule is used as non-alarming.
In the embodiment of the application, the cloud end can set at least one alarm rule.
S703, the gateway pulls the initial scene rule from the cloud.
And when the gateway pulls the scene rules from the cloud, the pulled scene rules are locally stored.
And after the cloud gateway draws the scene rule, the cloud gateway is defaulted to process the data reported by the equipment, and the cloud shields the processing of the uplink data of the equipment so as to avoid misinformation and further cause unnecessary conflicts.
And when the gateway does not pull the scene rule from the cloud, the cloud processes the data reported by the equipment based on the scene rule.
The above S701 to S703 describe the formation of the scene rule, and the gateway processes the data collected from the device through the scene rule, so as to provide corresponding feedback to the user. However, the data of the device under the condition of scene abnormity cannot be correctly dealt with due to the lack of a certain reasoning capability of the scene rule, wherein the condition of the scene abnormity comprises the following steps: and the temperature is higher than the upper temperature limit supported by the air conditioner, and the fire disaster, the invasion energy of outsiders and other scenes which are not included in the scene rules are generated.
The data collected by the gateway are analyzed through the cloud, so that the user behavior profile is analyzed, a rule base which is adjusted and optimized continuously is formed, and the purpose of context awareness is achieved.
The method for tuning rules in a rule base, as shown in fig. 8, includes:
s801, the cloud acquires data collected by the gateway, and preprocesses the acquired data.
And the remote end acquires various data of the situation reported by the equipment and collected by the gateway, and preprocesses the acquired data.
Here, the preprocessing method includes: the cloud analyzes the data reported by the equipment according to the TSL corresponding to the equipment, and cleans the data not contained in the TSL of each equipment.
In the embodiment of the present application, the preprocessing method further includes: adding position, date and time information in the data to form a sample data set for unified storage.
S802, the cloud extracts data characteristics in the preprocessed data.
And the cloud performs feature extraction on the preprocessed data based on the type of the equipment, and extracts data features.
When the preprocessed data includes the data of the intelligent door sensor, the data features extracted from the data of the intelligent door sensor include: door magnetic state, electric quantity information. When the preprocessed data summary includes data of the temperature and humidity sensor, the data features extracted from the data of the temperature and humidity sensor include: temperature and humidity data and electric quantity information. When the pre-processed data includes data for an air purifier, the features extracted from the data for the air purifier include: the mode and diameter of the device are less than 2.5 fine Particulate Matter (PM), i.e. PM2.5 information.
S803, the cloud trains the prediction model through the extracted data characteristics and the historical data characteristics to obtain a converged prediction model.
The cloud end represents the data characteristics of each device through a structured language to represent functions of different types of devices, the current state of the devices, the state of each device at each moment and the like through the structured language, and the cloud end adopts a machine learning algorithm to obtain a normal behavior profile of a user by continuously learning the extracted data characteristics and historical characteristic data and analyzing the association relationship among the devices. The cloud end trains the prediction model through the extracted data features and the historical feature data, so that the prediction model analyzes the association relation between the devices, and the prediction model capable of reflecting the convergence of the user behavior profile is obtained.
In this embodiment, the prediction model used by the cloud may be a single model, such as: SVM, LR, XGB, lightGBM, etc. The prediction model used by the cloud may also be a combination of multiple single models. The prediction model used in the embodiment of the present application may be a combination of XGBoost and LightGBM.
And the cloud respectively trains, adjusts parameters and compares results of the training models to obtain the trained prediction models.
S804, the cloud obtains a scene rule based on the converged prediction model, and sends the scene rule to the gateway.
After the cloud acquires the prediction model, the functions in the TSL are respectively input, the output result of each function is obtained, a scene rule base formed by scene rules is obtained based on the functions and the output result of each function, and therefore the prediction model is converted into the scene rule base which can be identified by the gateway. And after the cloud obtains the scene rule base, the gateway is informed to obtain the scene rule from the cloud again, and the gateway obtains the scene rule from the cloud and updates the local normal behavior scene rule base.
In the embodiment of the present application, as shown in fig. 9, a device 903-1, a device 903-2, a device 903-3, and a device 903-4 report data to a gateway 902, the gateway 902 sends the reported data to a cloud 901, and the cloud 901 performs the following processing on the received data in sequence to obtain a converged prediction model 905: 9041. pre-treating; 9042. feature extraction, 9043, model training, a scene rule base 906 is obtained based on the prediction model 905, and the cloud sends the scene rule base 906 to the gateway 902, so that the gateway 902 processes data reported by the device 903-1, the device 903-2, the device 903-3 and the device 903-4 through the scene rule base 906. The scene rule base 906 includes: a normal behavior rules library 9061 and an alarm rules library 9062.
In the embodiment of the application, the gateway receives data of the device and processes the received data based on the scene rules in the scene rule base, specifically, the processing is as follows:
and matching the received data with the scene rules in the scene rule base, and if the scene rules corresponding to the received data are matched, executing actions or giving an alarm based on the description of the matched scene rules. And if the received data is not matched with the scene rule, judging the received data and the behavior rule representing the normal behavior contour by adopting a 3Sigma rule to obtain the similarity of the received data and the normal behavior contour. And when the calculated similarity represents that the deviation of the currently received data and the normal behavior profile is overlarge, giving out early warning. After the similarity is calculated by the gateway, whether the current situation of the user is abnormal is judged according to the similarity value Sim, wherein the threshold value of the similarity threshold is taken as k, if Sim > k, the behavior is considered to be normal, and if Sim < = k, the current environment of the user is considered to be abnormal. The threshold value k can be selected as follows: in the training process, after a user normal situation contour is established, the training data are all calculated once for similarity, a division point (the top 10% of the lowest similarity) of the similarity is taken, the similarity of the division point is used as a threshold value k, and then in the detection process, the threshold value is properly adjusted according to the false alarm rate and the false alarm rate of the system.
The method comprises the steps that a cloud continuously trains and optimizes a prediction model through continuous uplink data of a gateway end to form a scene rule base of context perception, the local rule base is updated after the gateway obtains the optimized scene rule base of the cloud, similarity judgment is conducted on the uplink data which are not matched with rules by adopting a 3Sigma criterion, whether abnormity occurs is judged, and whether abnormity occurs is comprehensively analyzed according to data behaviors of associated sensor equipment. The method and the device can efficiently process the uplink data of the intelligent sensor and give appropriate feedback to the current context of the user.
An embodiment of the present application provides a data processing apparatus 1000, which is applied to a gateway, and as shown in fig. 10, the data processing apparatus 1000 includes:
a first receiving module 1001, configured to receive first data reported by the at least one device;
the first processing module 1002 is configured to process the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules;
a first sending module 1003, configured to send the first data to a cloud server; the first data is used for the cloud server to obtain an updated scene rule base;
the first receiving module 1001 is further configured to receive the updated scene rule base sent by the cloud server, and receive second data reported by the first device, so as to process the second data through the updated scene rule base.
In some embodiments, the processing module 1002 is further configured to:
when the first data is matched with the functional data of the target scene rule in the scene rule base, determining the action of the target scene rule; and when the first data is not matched with the functional data in any scene rule in the scene rule base, determining a processing mode corresponding to the first data based on the similarity between the first data and a user behavior model.
In some embodiments, the apparatus 1000 further comprises: a determination module to:
determining functional data included in at least one behavior rule in the scene rule base; the scene rule base comprises at least one behavior rule and at least one alarm rule; the at least one behavior rule characterizes a user behavior model; the at least one alarm rule represents an alarm model;
determining a first similarity of the first data to functional data in the at least one behavior rule.
In some embodiments, the determining module is further to:
acquiring 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 behavior rule, and the second coefficient is an average value of the functional data included in the at least one behavior rule;
determining at least two data ranges according to the first coefficient and the second coefficient; wherein, the probability values of the data distributed in different data ranges are different;
and determining the probability value corresponding to the data range to which the first data belongs in the at least two data ranges as the first similarity.
In some embodiments, the first processing module 1002 is further configured to:
and when the first similarity is larger than a similarity threshold, determining that the processing mode corresponding to the first data is an alarm.
In some embodiments, the apparatus 1000 further comprises:
the first judgment module is used for judging whether the scene rule base exists or not;
the first sending module 1003 is further configured to send the first data to the cloud server if the result of the determination is that the scene rule base does not exist, so that the cloud server processes the first data.
In some embodiments, the first receiving module 1001 is further configured to receive a notification message sent by the cloud server; the notification message is used for indicating the cloud server to obtain the updated scene rule base;
the first sending module 1003 is further configured to send, to the cloud server, a pull message responding to the notification message, where the pull message is used to instruct to pull the updated scene rule base from the cloud server.
An embodiment of the present application provides a data processing apparatus 1100, which is applied to a cloud server, and as shown in fig. 11, the data processing apparatus 1100 includes:
a second receiving module 1101, configured to receive first data sent by the gateway; the first data is data reported to the gateway terminal by the at least one device;
the prediction model is trained through the first data and the historical data of the at least one device to obtain a converged prediction model;
an updating module 1103, configured to convert the converged prediction model into an updated scene rule base;
a second sending module 1104, configured to send the updated scene rule base to the gateway end, where the updated scene rule base is used to update the scene rule base in the gateway end.
In some embodiments, training module 1102 is further configured to:
filtering the first data according to a device data model of each device in the at least one device; the device data model characterizes functions supported by the device;
extracting data features in the filtered first data based on a device type of each of the at least one device;
and training the prediction model through the data characteristics and the historical data to obtain a converged prediction model.
In some embodiments, the apparatus 1100 further comprises: a second determination module to:
determining function data included in at least one behavior rule included in the scene rule base; the scene rule base comprises at least one behavior rule and at least one alarm rule; the at least one behavior rule characterizes a user behavior model; the at least one alarm rule characterizes an alarm model;
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;
and sending the similarity threshold to the gateway terminal, wherein the similarity threshold is used for determining the processing result of the first data when the first data is not matched with the scene rule.
In some embodiments, the second determining module is to:
acquiring 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 behavior rule, and the second coefficient is an average value of the functional data included in the at least one behavior rule;
determining at least two data ranges according to the first coefficient and the second coefficient; the probability values of the data distributed in different data ranges are different;
with each data in the first data and the historical data as target data, executing the following processing aiming at the target data: and 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.
In some embodiments, the second determining module is to:
sequencing the determined second similarity to obtain a sequencing result;
according to a set proportion, determining a segmentation point in the sequencing result;
and determining the second similarity corresponding to the segmentation point as the similarity threshold.
In some embodiments, the apparatus 1100 further comprises:
the second judging module is used for judging whether the gateway terminal pulls the scene rule from the cloud server terminal;
and the second processing module is used for processing the first data based on the locally stored scene rule base to obtain a processing result under the condition that the judging result is that the gateway end does not pull the scene rule base from the cloud service end.
In some embodiments, the second sending module 1103 is further configured to send a notification message to the gateway; the notification message is used for indicating the cloud server to obtain the updated scene rule base;
the second receiving module 1101 is further configured to receive a pull message returned by the gateway end in response to the notification message, where the pull message is used to instruct the gateway end to pull the updated scene rule base from the cloud server.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be noted that, in the embodiment of the present application, if the data processing method is implemented in the form of a software functional module and sold or used as a standalone product, the data processing method may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the related art may be embodied in the form of a software product stored in a storage medium, and including several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present application provides an electronic device, which includes a memory and a processor, where the memory stores a computer program that can be run on the processor, and the processor executes the computer program to implement the steps in the data processing method provided in the foregoing embodiment.
Accordingly, embodiments of the present application provide a storage medium, that is, a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the data processing method provided in the above embodiments.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and the apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be noted that fig. 12 is a schematic diagram of a hardware entity of an electronic device (a gateway side or a cloud server side) according to an embodiment of the present application, and as shown in fig. 12, the electronic device 1200 includes: a processor 1201, at least one communication bus 1202, at least one external communication interface 1204, and memory 1205. Wherein the communication bus 1202 is configured to enable connective communication between such components. The external communication interface 1204 may include a standard wired interface and a wireless interface, among others.
The Memory 1205 is configured to store instructions and applications executable by the processor 1201, and may also buffer data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or already processed by the processor 1201 and modules in the electronic device, and may be implemented by a FLASH Memory (FLASH) or a Random Access Memory (RAM).
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in some embodiments" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one of 8230, and" comprising 8230does not exclude the presence of additional like elements in a process, method, article, or apparatus comprising the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only one logical function division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps of implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer-readable storage medium, and when executed, executes the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated unit described above may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially implemented or portions thereof contributing to the related art may be embodied in the form of a software product stored in a storage medium, and including several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (18)

1. A data processing method is characterized by being applied to a gateway end which is respectively connected with a cloud service end and at least one device; the method comprises the following steps:
receiving first data reported by the at least one device;
processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules;
sending the first data to the cloud server; the first data is used for the cloud server to obtain an updated scene rule base;
and receiving the updated scene rule base sent by the cloud server, and receiving second data reported by the at least one device, so as to process the second data through the updated scene rule base.
2. The method of claim 1, wherein the scenario rule comprises functional data and an action corresponding to the functional data; the processing the first data through the scene rule base to obtain a processing result, including:
matching the first data with each scene rule in the scene rule base;
when the first data is matched with the functional data of the target scene rule in the scene rule base, determining the action of the target scene rule;
and when the first data is not matched with the functional data in any scene rule in the scene rule base, determining a processing mode corresponding to the first data based on the similarity between the first data and a user behavior model.
3. The method of claim 2, wherein the scenario rule base comprises at least one behavior rule and at least one alarm rule; the at least one behavior rule characterizes a user behavior model; the at least one alarm rule characterizes an alarm model; before determining a corresponding processing manner for the first data based on the similarity of the first data and a user behavior model, the method further comprises:
determining functional data included in the at least one behavior rule;
determining a first similarity of the first data to functional data in the at least one behavior rule.
4. The method of claim 3, wherein determining the first similarity between the first data and the functional data in the at least one behavior rule comprises:
acquiring 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 behavior rule, and the second coefficient is a mean value of the functional data included in the at least one behavior rule;
determining at least two data ranges according to the first coefficient and the second coefficient; wherein, the probability values of the data distributed in different data ranges are different;
and determining the probability value corresponding to the data range to which the first data belongs in the at least two data ranges as the first similarity.
5. The method according to claim 2, wherein the determining a corresponding processing manner for the first data based on the first similarity between the first data and the user behavior model comprises:
and when the first similarity is larger than a similarity threshold, determining that the processing mode corresponding to the first data is an alarm.
6. The method of claim 1, wherein after receiving the first data reported by the at least one device, the method further comprises:
judging whether the scene rule base exists or not;
and sending the first data to the cloud service end under the condition that the scene rule base does not exist in the judgment result, so that the cloud service end processes the first data.
7. The method of claim 1, wherein after sending the first data to a cloud server, the method further comprises:
receiving a notification message sent by the cloud server; the notification message is used for indicating the cloud server to obtain the updated scene rule base;
and sending a pull message responding to the notification message to the cloud server, wherein the pull message is used for indicating that the updated scene rule base is pulled from the cloud server.
8. A data processing method is applied to a cloud server, the cloud server is connected with a gateway, and the gateway is connected with at least one device, and the method comprises the following steps:
receiving first data sent by the gateway end; the first data is data reported to the gateway terminal by the at least one device;
training a prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model;
obtaining an updated scene rule base based on the prediction model;
and sending the updated scene rule base to the gateway end, wherein the updated scene rule base is used for updating the scene rule base in the gateway end.
9. The method of claim 8, wherein training a predictive model with the first data and historical data of the at least one device to obtain a converged predictive model comprises:
filtering the first data according to a device data model of each device in the at least one device; the device data model characterizes functions supported by the device;
extracting data features in the filtered first data based on a device type of each of the at least one device;
and training the prediction model through the data characteristics and the historical data to obtain a converged prediction model.
10. The method of claim 8, wherein the scenario rule base comprises at least one behavior rule and at least one alarm rule; the at least one behavior rule characterizes a user behavior model; the at least one alarm rule characterizes an alarm model; the method further comprises the following steps:
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;
sending the similarity threshold to the gateway end; the similarity threshold is used for determining a processing result of the first data when the first data is not matched with the scene rule.
11. The method of claim 10, wherein the determining a second similarity of the first data to each of the historical data and the functional data in the at least one behavior rule comprises:
acquiring 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 behavior rule, and the second coefficient is a mean value of the functional data included in the at least one behavior rule;
determining at least two data ranges according to the first coefficient and the second coefficient; the probability values of the data distributed in different data ranges are different;
with each data in the first data and the historical data as target data, executing the following processing aiming at the target data: and 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.
12. The method of claim 10, wherein determining a similarity threshold based on the determined second similarity comprises:
sequencing the determined second similarity to obtain a sequencing result;
determining a segmentation point in the sequencing result according to a set proportion;
and determining the second similarity corresponding to the segmentation point as the similarity threshold.
13. The method according to claim 8, wherein after receiving the first data sent by the gateway end, the method further comprises:
judging whether the gateway terminal pulls the scene rule from the cloud server terminal;
and processing the first data based on the locally stored scene rule base to obtain a processing result under the condition that the gateway does not pull the scene rule base from the cloud server as a result of the judgment.
14. The method of claim 8, wherein after deriving the updated scene rules base based on the predictive model, the method further comprises:
sending a notification message to the gateway end; the notification message is used for indicating the cloud server to obtain the updated scene rule base;
receiving a pull message returned by the gateway end in response to the notification message; the pull message is used for indicating the gateway end to pull the updated scene rule base from the cloud server end.
15. A data processing apparatus, applied to a gateway, the apparatus comprising:
a first receiving module, configured to receive first data reported by the at least one device;
the first processing module is used for processing the first data through a scene rule base to obtain a processing result; the scene rule base comprises at least two scene rules;
the first sending module is used for sending the first data to a cloud server; the first data is used for the cloud server to obtain an updated scene rule base;
the first receiving module is further configured to receive the updated scene rule base sent by the cloud server, and receive second data reported by the first device, so as to process the second data through the updated scene rule base.
16. A data processing device is applied to a cloud server, and the device comprises:
the second receiving module is used for receiving the first data sent by the gateway terminal; the first data is data reported to the gateway terminal by the at least one device;
the training module is used for training a prediction model through the first data and the historical data of the at least one device to obtain a converged prediction model;
the updating module is used for obtaining an updated scene rule base based on the prediction model;
and the second sending module is used for sending the updated scene rule base to the gateway terminal, and the updated scene rule base is used for updating the scene rule base in the gateway terminal.
17. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the steps of the data processing method of any one of claims 1 to 7 or implements the steps of the data processing method of any one of claims 8 to 14 when executing the computer program.
18. A storage medium on which a computer program is stored, which, when executed by a processor, carries out the data processing method of any one of claims 1 to 7, or carries out the data processing method of any one of claims 8 to 14.
CN202110698725.2A 2021-06-23 2021-06-23 Data processing method, device, equipment and storage medium Pending CN115514659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110698725.2A CN115514659A (en) 2021-06-23 2021-06-23 Data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110698725.2A CN115514659A (en) 2021-06-23 2021-06-23 Data processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115514659A true CN115514659A (en) 2022-12-23

Family

ID=84499474

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110698725.2A Pending CN115514659A (en) 2021-06-23 2021-06-23 Data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115514659A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190065288A1 (en) * 2017-08-28 2019-02-28 Tatung Company Gateway, internet of things device control system and method thereof
CN109451040A (en) * 2018-12-10 2019-03-08 王顺志 Internet of things networking system and network-building method based on edge calculations
CN110650084A (en) * 2019-08-26 2020-01-03 山东省科学院自动化研究所 Intelligent gateway, networking system and data processing method for industrial Internet of things
CN111176133A (en) * 2020-02-11 2020-05-19 青岛海信智慧家居系统股份有限公司 Method and device for determining smart home scene
CN112327763A (en) * 2020-09-08 2021-02-05 深圳Tcl新技术有限公司 Intelligent scene control method, device, gateway and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190065288A1 (en) * 2017-08-28 2019-02-28 Tatung Company Gateway, internet of things device control system and method thereof
CN109451040A (en) * 2018-12-10 2019-03-08 王顺志 Internet of things networking system and network-building method based on edge calculations
CN110650084A (en) * 2019-08-26 2020-01-03 山东省科学院自动化研究所 Intelligent gateway, networking system and data processing method for industrial Internet of things
CN111176133A (en) * 2020-02-11 2020-05-19 青岛海信智慧家居系统股份有限公司 Method and device for determining smart home scene
CN112327763A (en) * 2020-09-08 2021-02-05 深圳Tcl新技术有限公司 Intelligent scene control method, device, gateway and storage medium

Similar Documents

Publication Publication Date Title
US20220006825A1 (en) Cognitive neuro-linguistic behavior recognition system for multi-sensor data fusion
US11270084B2 (en) Systems and methods for using trigger words to generate human-like responses in virtual assistants
CN108919669B (en) Intelligent home dynamic decision method and device and service terminal
KR102608051B1 (en) Artificial intelligence device
US20190095313A1 (en) Log-based system maintenance and management
US10380493B2 (en) System and method for generating machine-curated scenes
CN106647645A (en) Method and system for home control adjustment
CN112800116B (en) Method and device for detecting abnormity of service data
US20210232107A1 (en) Systems and methods for evaluating sensor data of internet-of-things (iot) devices and responsively controlling control devices
CN112051743A (en) Device control method, conflict processing method, corresponding devices and electronic device
WO2021179958A1 (en) Intelligent control method for air conditioner, and intelligent control device for air conditioner
KR20200050373A (en) Electronic apparatus and control method thereof
US10574764B2 (en) Automated learning universal gateway
CN115826428B (en) Control method and device of household equipment, storage medium and electronic device
KR102658112B1 (en) Artificial intelligence apparatus for controlling auto stop system based on driving information and method for the same
CN108010527A (en) Audio recognition method, device, computer equipment and storage medium
KR20210077916A (en) A method for integrated controlling home appliance and system for the same
CN114298141A (en) Power generation equipment abnormity detection method and system based on deep learning
CN115514659A (en) Data processing method, device, equipment and storage medium
CN117435999A (en) Risk assessment method, apparatus, device and medium
CN109597572B (en) Storage management method
CN112815610A (en) Control method and device for ion generator in household appliance and household appliance
CN115619316A (en) Acquisition equipment work control method, device, equipment and storage medium
US20210352207A1 (en) Method for adapting the quality and/or frame rate of a live video stream based upon pose
KR20210062238A (en) Method for Image Information Analysis Based Prevention System and Method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination