Intelligent gateway control method based on swan gap system

By introducing a control method based on the Hongmeng system in the intelligent gateway, detecting changes in the device status and storing user preferences, the problem of inaccurate user manual setting of device status is solved, and the efficiency of automatic device adjustment and user experience is improved.

CN120050166AInactive Publication Date: 2025-05-27SHENZHEN QIANMAN TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510241062.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-05-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing intelligent gateway scenario automation technology requires users to manually set the device status, which makes it difficult for users to accurately determine whether the device status is suitable for them without a long-term experience, resulting in inaccurate parameter settings, and users need to adjust frequently until they find the appropriate status.

Method used

A control method based on the Hongmeng system is provided. By detecting changes in the device status, making preference judgments on the user's preference settings based on preset conditions, storing the user's new preferences into the preference database, and automatically adjusting the device status when the next specific time comes.

Benefits of technology

It improves users' experience of automatic adjustment of equipment, reduces frequent adjustments of user manual settings, and ensures the accuracy of device status and user preferences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050166A_ABST
    Figure CN120050166A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of intelligent gateways, and discloses a control method of an intelligent gateway based on a swan gap system. The method comprises the following steps: acquiring time data, and judging whether the time data is stored in a preference database or not; when it is judged that the time data is stored in a preference database, a control instruction corresponding to the time data is called, so that an intelligent gateway controls an intelligent device; when it is judged that the time data is not stored in the preference database, carrying out equipment state abnormal value detection to obtain abnormal data; performing data extraction on the abnormal data to obtain a control instruction; obtaining preference data according to the control instruction; and when it is judged that the user agrees to store the preference data in the preference database, storing the preference data and the control instruction in the preference database. According to the method, the equipment can be automatically adjusted when the preference time of the user arrives, and the experience of the user on equipment automation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent gateways, and particularly to a control method for an intelligent gateway based on the HarmonyOS. Background Art

[0002] An intelligent gateway based on the HarmonyOS is a device running the HarmonyOS operating system. It serves as a core control node in smart home or Internet of Things (IoT) scenarios, enabling functions such as device interconnection, data processing, remote control, scene automation, and security monitoring. It utilizes the distributed architecture and microkernel design of the HarmonyOS to provide a more efficient, secure, and personalized smart home experience.

[0003] In existing scene automation technologies, intelligent gateways generally require users to manually and actively set the automation modes of various intelligent devices. For example, users set specific times or dates to automatically execute tasks, such as turning lights on or off at a scheduled time or adjusting a thermostat. However, this automation mode requires manual setting by the user. Without a long-term experience of manually setting the device status, users cannot accurately determine whether the device status is suitable for them. In such cases, the manually set parameters may not be accurate, and users need to frequently adjust the device status until they find a device status that suits their preferences, and then make another manual setting.

[0004] In summary, there are certain deficiencies in the convenience of the current intelligent gateway scene automation technology for users to set device status, which affects the user experience of device automation adjustment. Summary of the Invention

[0005] The present invention provides a control method for an intelligent gateway based on the HarmonyOS, which can detect changes in device status, make a preference judgment based on preset conditions for user preference settings, store the new user preferences in a preference database, and perform automatic adjustment of the device at the next specific time, thus enhancing the user experience of device automation adjustment.

[0006] In a first aspect, to solve the above technical problems, the present invention provides a control method for an intelligent gateway based on the HarmonyOS, including: Obtaining time data and determining whether the time data is stored in a preference database; When it is determined that the time data is stored in the preference database, calling a control instruction corresponding to the time data to enable the intelligent gateway to control intelligent devices according to the control instruction; Wherein, when it is determined that the time data is not stored in the preference database, performing device status outlier detection to obtain outlier data; Extracting data from the outlier data to obtain a control instruction; According to the control instruction, preference determination is performed according to preset conditions to obtain preference data; In response to an interaction operation triggered by a user, it is determined whether the user agrees to store the preference data in the preference database. When it is determined that the user agrees to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database.

[0007] Preferably, when it is determined that the preference data is not stored in the preference database, device status outlier detection is performed to obtain abnormal data, including: Obtain device status information, and according to the device status information, perform sparsity calculation to obtain the local reachability density; According to the local reachability density, perform outlier factor calculation to obtain the local outlier factor; According to the local outlier factor, obtain the abnormal data.

[0008] Preferably, the obtaining device status information, performing sparsity calculation according to the device status information, and obtaining the local reachability density include: In the formula, is the real-time data point of the device status; is the historical data point of the device status; is the Euclidean distance between the real-time data point of the device status and the historical data point of the device status; is and the reachable distance between them; is the distance the nearest k data; is the local reachability density, indicating the dilution degree of the real-time data point of the device status and the historical data point of the device status.

[0009] Preferably, the obtaining the abnormal data according to the local outlier factor includes: When the local outlier factor is higher than a preset threshold, it is determined that the real-time device status is an outlier; According to the local outlier factor, obtain the abnormal data; Among them, the calculation formula of the local outlier factor is: In the formula, represents the density difference between the real-time data point of the device status and the historical data set, that is, the local outlier factor; is the distance the nearest kth point; is the real-time data point of the device status; The k data closest to the distance are the nearest k data.

[0010] Preferably, the data extraction of the abnormal data to obtain a control instruction includes: According to the abnormal data, match the device state corresponding to the abnormal data; According to the device state, match the corresponding control operation to obtain a control instruction.

[0011] Preferably, the preference determination according to the control instruction according to preset conditions to obtain preference data includes: According to the control instruction, perform a matching query to obtain the control start time; Subtract the current time from the control start time to obtain the preference duration; According to the preference duration, determine whether the control instruction is a new user preference. When the preference duration exceeds the threshold, it is determined as a new user preference, and the control start time is set as the preference data.

[0012] Preferably, in response to an interactive operation triggered by the user, determine whether the user agrees to store the preference data in the preference database. When it is determined that the user agrees to store the preference data in the preference database, after storing the preference data and the control instruction in the preference database, the method further includes: After storing the preference data and the control instruction in the preference database, when the next time data determination arrives, use it as the time data stored in the preference database.

[0013] In a second aspect, the present invention provides a control system for an intelligent gateway based on the HarmonyOS, including: A data query module for obtaining time data and determining whether the time data is stored in the preference database; An instruction invocation module for, when it is determined that the time data is stored in the preference database, invoking the control instruction corresponding to the time data so that the intelligent gateway controls the intelligent device according to the control instruction; An anomaly detection module for, when it is determined that the preference data is not stored in the preference database, detecting the abnormal value of the device state to obtain abnormal data; A data extraction module for performing data extraction on the abnormal data to obtain a control instruction; A preference determination module for performing preference determination according to the control instruction according to preset conditions to obtain preference data; A data storage module, configured to determine whether the user requests to store the preference data in the preference database according to the preference data. When it is determined that the user requests to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database.

[0014] In a third aspect, the invention further provides an intelligent gateway, including the control system of the intelligent gateway based on the HarmonyOS as described in the second aspect.

[0015] In a fourth aspect, the invention further provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the control method of the intelligent gateway based on the HarmonyOS described in any one of the above is implemented.

[0016] In a fifth aspect, the invention further provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the control method of the intelligent gateway based on the HarmonyOS described in any one of the above.

[0017] Compared with the prior art, the present invention has the following beneficial effects: The embodiment of the present invention provides a control method for an intelligent gateway based on the HarmonyOS. The method includes obtaining time data and determining whether the time data is stored in the preference database; when it is determined that the time data is stored in the preference database, calling the control instruction corresponding to the time data to enable the intelligent gateway to control the intelligent device according to the control instruction; wherein, when it is determined that the time data is not stored in the preference database, detecting the abnormal value of the device state to obtain abnormal data; extracting data from the abnormal data to obtain a control instruction; making a preference determination according to the control instruction according to a preset condition to obtain preference data; in response to an interaction operation triggered by the user, determining whether the user agrees to store the preference data in the preference database. When it is determined that the user agrees to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database.

[0018] In the present invention, the method first continuously obtains time data and determines whether the time data is stored in the preference database, that is, determines whether the current time is the user's preferred control time. If so, it is determined as the user's preferred control time, that is, the user-set preferred control time is reached. At this time, the control instruction corresponding to the time data pre-stored in the preference database can be directly called to control the intelligent device, so that the intelligent gateway controls the intelligent device according to the control instruction; if not, device status outlier detection is performed, that is, it is determined whether the user has adjusted the status of the device. If an adjustment is made at this time, abnormal data of the device status will be obtained, and then a control instruction is matched according to the abnormal data. At this time, the duration of this control is calculated. If the duration exceeds a preset threshold, it is determined that this control is the user's new preferred control. At this time, the user is asked. If the user agrees to store the new preference data and control instruction in the preference database, when the same time arrives next time, the intelligent gateway will automatically adjust the device status according to the stored control instruction. Compared with the situation where the user manually and actively sets the automation mode of each intelligent device, which may lead to inaccurate parameter settings and complex setting processes, the method can make a preference judgment on the user's preference setting based on preset conditions, store the user's new preference in the preference database, and perform automatic adjustment of the device when a specific time arrives next time, improving the user's experience of device automatic adjustment. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 is a schematic flowchart of a control method for an intelligent gateway based on the HarmonyOS provided in the first embodiment of the present invention; Figure 2 is a schematic flowchart of a control method for an intelligent gateway based on the HarmonyOS provided in the first embodiment of the present invention; Figure 3 is a schematic structural diagram of a control system for an intelligent gateway based on the HarmonyOS provided in the second embodiment of the present invention; Figure 4 is a schematic structural diagram of a control system for an intelligent gateway based on the HarmonyOS provided in the second embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0020] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0021] Refer to Figure 1 and Figure 2, the first embodiment of the present invention provides a control method for an intelligent gateway based on the HarmonyOS system, including the following steps: S11, obtain time data and determine whether the time data is stored in the preference database; In step S11, when it is determined that the time data is stored in the preference database, step S12 is executed; S12, when it is determined that the time data is stored in the preference database, call the control instruction corresponding to the time data, so that the intelligent gateway controls the intelligent device according to the control instruction; In step S11, when it is determined that the time data is not stored in the preference database, step S13 is executed; S13, when it is determined that the time data is not stored in the preference database, perform device status outlier detection to obtain outlier data; S14, extract data from the outlier data to obtain a control instruction; S15, according to the control instruction, perform preference determination according to preset conditions to obtain preference data; S16, in response to the interactive operation triggered by the user, determine whether the user agrees to store the preference data in the preference database. When it is determined that the user agrees to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database.

[0022] It should be noted that the intelligent gateway based on the HarmonyOS system is a device that runs the HarmonyOS operating system. It serves as a core control node in smart home or Internet of Things, realizing functions such as device interconnection, data processing, remote control, scene automation, and security monitoring. It utilizes the distributed architecture and microkernel design of the HarmonyOS system to provide a more efficient, secure, and personalized smart home experience. Smart home can include: intelligent lighting devices, such as smart bulbs, smart switches, smart dimmers, and users can remotely control the lights, adjust the brightness, or set timed switches through the intelligent gateway; smart home appliances, including smart air conditioners, smart refrigerators, smart washing machines, smart ovens, and users can adjust the temperature, start or stop the operation of home appliances, and set automation scenarios through the intelligent gateway; intelligent security devices, such as smart locks, smart cameras, smart doorbells, smoke alarms, and the intelligent gateway can manage and monitor these devices, providing remote access and real-time alarm functions to enhance home security; intelligent curtains and shading devices, and the intelligent gateway controls the intelligent curtains and blinds to achieve remote opening and closing or automatic adjustment according to time and light.

[0023] For the convenience of understanding the present invention, some preferred embodiments of the present invention will be further described below.

[0024] In step S11, obtaining time data and determining whether the time is stored in the preference database includes: Since the preference data stored in the preference database is specifically the control time, the time data in this embodiment is the current time data, and the current time data is matched and queried with the time data in the preference database. When a control time identical to the current time is matched, step S12 is performed. In most cases, when the current time has not been matched with the time in the preference database, the operation of step S13 is performed.

[0025] It should be noted that obtaining time data is a continuous process. The smart gateway needs to continuously obtain the current time and simultaneously match the obtained current time with the time in the preference database. The obtained time can be obtained from the system clock built into the smart gateway; it can also be synchronized from a time server on the Internet through the Network Time Protocol; or a separate real-time clock chip can be built into the smart gateway so that the current time data can still be obtained in the event of a power outage. When determining whether the obtained time data is stored in the preference database, a process of database query and data matching is involved. Before matching with the time data in the preference database, it is necessary to ensure that the format of the obtained time data is consistent with the format of the time data stored in the database, and the process may involve operations for formatting the time data.

[0026] When it is determined that the time data is stored in the preference database, the operation described in step S12 is executed.

[0027] In step S12, when it is determined that the time data is stored in the preference database, the control instruction corresponding to the time data is called to enable the smart gateway to control the smart device according to the control instruction, including: The preference database stores preference data and control instructions corresponding to the preference data, which forms a closed loop with step S16, that is, in step S16, the user's new preferences are stored, and the stored preference data can be matched with the current time data when determining the time data next time. The control instruction here is the control instruction pre-stored in the preference database together with the preference data in step S16. The control instruction is determined to be the user's new preference control behavior after preset conditions. Therefore, once the preference control time set by the user arrives, the smart gateway will call the control instruction to enable the smart gateway to control the smart device according to the control instruction, enhancing the user experience of device automation adjustment.

[0028] When it is determined that the time data is not stored in the preference database, the operation described in step S13 is executed.

[0029] In step S13, when it is determined that the time data is not stored in the preference database, device status anomaly value detection is performed to obtain anomaly data, including: Before detecting the abnormal value of the device status, wavelet denoising operation needs to be carried out first to reduce the influence of noise on the subsequent calculation of the LOF algorithm. Wavelet denoising is a signal processing technology used to remove noise from signals.

[0030] Specifically, the wavelet denoising operation can adopt threshold denoising, soft threshold denoising, universal threshold denoising, wavelet packet denoising, multi-scale denoising, and adaptive denoising. Exemplarily, the present invention adopts soft threshold denoising, and the expression of soft threshold denoising is as follows: In the formula, is the wavelet coefficient after denoising; is the given threshold; ; is the original data, that is, the wavelet coefficient containing noise.

[0031] After wavelet denoising, the LOF algorithm is used to calculate the abnormal value of the denoised device status information.

[0032] It should be noted that the LOF (Local Outlier Factor) algorithm is a density-based outlier detection method. Its core idea is to measure the local density difference between a point and its neighbor points to determine whether the point is an outlier. The steps of the LOF algorithm include: obtaining the denoised device status information, calculating the sparsity degree according to the device status information to obtain the local reachability density; calculating the outlier factor according to the local reachability density to obtain the local outlier factor; and obtaining the abnormal data according to the local outlier factor.

[0033] It is worth noting that the two main concepts involved in the steps of the LOF algorithm: local reachability density and local outlier factor. The former refers to: for a given point p , its local reachability distance to the neighbor point o refers to the maximum distance from p to o without reducing the current density; the latter refers to: for a given point p , its local reachability distance to the neighbor point o refers to the maximum distance from p to o without reducing the current density.

[0034] Specifically, the calculation formula of the local reachability density is: In the formula, is the real-time data point of the device status; is the historical data point of the device status; is the Euclidean distance between the real-time data point of the device state and the historical data point of the device state; is and the reachable distance between; is the distance nearest k data; is the local reachability density, indicating the dilution degree of the real-time data point of the device state and the historical data point of the device state.

[0035] Furthermore, the calculation formula of the local outlier factor is: In the formula, represents the density difference between the real-time data point of the device state and the historical data set, that is, the local outlier factor; is the distance the k-th nearest point; is the real-time data point of the device state; is the distance the k nearest data.

[0036] It should be noted that the calculated local outlier factor represents the density difference between the real-time data point of the device state and the historical data set. When the value of the local outlier factor is higher, it means that the density of the real-time data point of the device state in its neighborhood is lower, that is, its data distribution is inconsistent with that of the neighborhood points, and it may be an outlier. In the present invention, a threshold can be set to determine whether the device state is abnormal: when the local outlier factor is higher than the preset threshold, the real-time device state is judged to be an outlier. Specifically, the threshold can be determined according to the experience of technicians or the results of previous experiments, or the historical data of the device state can be statistically analyzed, or machine learning algorithms such as decision trees and support vector machines can be used to train a model based on the historical data to predict the threshold; in addition, designing an adaptive algorithm, adopting a general threshold formula, adopting cross-validation, and based on performance indicators can all be used as means for determining the threshold.

[0037] In step S14, the extracting data from the abnormal data to obtain a control instruction includes: matching the device state corresponding to the abnormal data according to the abnormal data; and matching the corresponding control operation according to the device state to obtain a control instruction. In the present invention, the purpose of using the LOF algorithm to detect the abnormal value of the device state is to determine whether the device state is the original state. If the state value has changed, it indicates that the device state has been artificially controlled and adjusted, and at this time, the abnormal value of the device state will be detected. After the abnormal value detection is performed in step S13, the abnormal data of the device state is obtained; according to the abnormal data, the device state corresponding to the abnormal data is matched, that is, the device state after the user performs a control operation, and then according to the matched device state, the control instruction performed by the user is reversely matched. Exemplarily, at a certain moment, the user changes and adjusts the state of the device. At this time, the LOF algorithm detects an abnormal value and calculates the local outlier factor; according to the local outlier factor, the current device state corresponding to the local outlier factor is reversely matched; according to the current device state of the device, the corresponding control operation of the user is matched to obtain a control instruction.

[0038] In step S15, the determining the preference data according to the preset condition according to the control instruction includes: performing a matching query according to the control instruction to obtain the control start time; calculating the difference between the control start time and the current time to obtain the preference duration; and determining whether the control instruction is a new user preference according to the preference duration. When the preference duration exceeds the threshold, it is determined as a new user preference, and the control start time is set as the preference data.

[0039] Specifically, all input control instructions can follow a unified format or be standardized for easy matching query. The method of matching query can be: developing a query interface that allows all input control instructions to follow a unified format or be standardized for easy matching query; or logging the control instructions, and the log record includes the input time of the control instruction. It should be noted that the control start time needs to be stored in a format that can be parsed by a program, such as a timestamp (Unix timestamp) or a specific date and time format (such as ISO 8601 format). The method for obtaining the current time can be obtained from the system clock built into the smart gateway; it can also be synchronized from a time server on the Internet through the Network Time Protocol; or a separate real-time clock chip can be built into the smart gateway so that the current time data can still be obtained in the event of a power outage. When performing the difference calculation, if the control start time is not stored in the form of a timestamp, it needs to be parsed into a format that can perform date and time calculations. The specific difference calculation step is: subtracting the control start time from the current time to obtain the difference between the two, and this difference is the preference duration.

[0040] Specifically, the preset condition means that when the preference duration exceeds the threshold, it is determined as a new user preference; when the preference duration does not exceed the threshold, it is determined as a non-user preference. When it is determined as a non-user preference, no operation is performed. Obviously, if the implementation of the distance control instruction exceeds a time threshold, it means that the user is relatively satisfied with the new device state and no adjustment is required. At this time, this device state may be regarded as a new preference of the user; if the implementation of the control instruction does not exceed a time threshold and the user performs the next operation, it means that the user is not satisfied with the new device state and needs to be adjusted again. At this time, the new device state is not regarded as the user's new preference. Further, the threshold can be determined by the following methods: empirical threshold, setting a general threshold based on the experience of domain experts and historical data analysis; statistical analysis method, statistically analyzing historical preference data, such as calculating the average value, median, standard deviation, etc., and then determining the threshold based on these statistics; user-defined method, allowing users to set the threshold according to their own needs and habits; adaptive learning, through machine learning algorithms, enabling the system to automatically learn and adjust the threshold according to the user's behavior pattern. It should be noted that during the period when the preference duration does not exceed the threshold, the intelligent gateway continues to detect outliers in real time.

[0041] It should be noted that after it is determined as the user's new preference, the interaction operation in step S16 is triggered.

[0042] In step S16, in response to the interaction operation triggered by the user, it is determined whether the user agrees to store the preference data in the preference database. When it is determined that the user agrees to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database.

[0043] In one implementation manner, the response to the interaction operation triggered by the user may be to trigger an inquiry interface in the intelligent device operation interface to inquire whether the user agrees to store the preference data in the preference database, and according to the user's selection, store the preference data in the preference database or not store it.

[0044] In another implementation manner, the response to the interaction operation triggered by the user may also be to set a mechanism of implicit consent during the user's interaction operation. For example, when the user performs a certain operation multiple times, it can be defaulted that the user has agreed to store this operation as a preference without further inquiry.

[0045] After responding to an interaction operation triggered by a user, when it is determined that the user agrees to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database; when it is determined that the user does not agree to store the preference data in the preference database, the preference data and the control instruction are not stored in the preference database.

[0046] After responding to an interaction operation triggered by a user and determining whether the user agrees to store the preference data in the preference database, when it is determined that the user agrees to store the preference data in the preference database and the preference data and the control instruction are stored in the preference database, the method further includes: after storing the preference data and the control instruction in the preference database, when the next time data determination arrives, using it as the time data stored in the preference database. Specifically, this step forms a closed loop with step S11 and step S12. The preference data and control instruction stored in the preference database in this step can be directly queried and called in step S11 and step S12. In step S11, according to the obtained time data, it is determined whether the time data is stored in the preference database; in step S12, it is determined whether the time data is stored in the preference database, and the control instruction corresponding to the time data is called, where the control instruction is the control instruction pre-stored in the preference database corresponding to the preference data. This step can perform automatic adjustment of the device when the next specific time arrives, improving the user experience of the automatic adjustment of the device.

[0047] The working process of the present invention is described below by taking a relatively common scenario as an example. The working process is as follows: An intelligent table lamp based on the HarmonyOS connected to an intelligent gateway. The intelligent gateway always obtains the current time data from the system clock built into the intelligent gateway, converts the obtained time data into a format that is consistent with the time data format stored in the database, and matches and queries the converted time data with the time data in the preference database while detecting abnormal values of the device status. When it is determined that the time data is stored in the preference database, the control instruction corresponding to the time data is called to enable the intelligent gateway to control the intelligent table lamp according to the control instruction. Among them, the control instruction can be the control instruction corresponding to the device status of "warm light" and "brightness level 3", and the time data can be 19:00. When the moment of 19:00 has not arrived, the intelligent gateway always detects abnormal values of the device status, first performs wavelet denoising on the real-time detected device status, and then inputs it into the LOF algorithm for outlier detection; according to the input device status information, calculates the sparsity degree to obtain the local reachability density; according to the local reachability density, calculates the outlier factor to obtain the local outlier factor; according to the local outlier factor, obtains the abnormal data. That is, at a certain moment, such as at 13:00 noon, the calculated local outlier factor exceeds the pre-set threshold, and the intelligent gateway determines it as an abnormal value of the device status and obtains the abnormal data. Subsequently, according to the abnormal data, matches the device status corresponding to the abnormal data, such as the device status being "cold light" and "brightness level 1" at this time; according to the device status, matches the corresponding control operation to obtain the control instruction. The intelligent gateway then performs a matching query according to the control instruction to obtain the control start time: the control instruction corresponds to the control start time of 13:00 noon. According to the control start time, calculates the difference from the current time to obtain the preference duration: assuming that the threshold setting duration is 1 hour, then at 14:01 noon, the preference duration exceeds the threshold setting time, and at this time, it is determined that the control instruction corresponding to the device status of "cold light" and "brightness level 1" is the new user preference. At this time, an inquiry interface is triggered in the intelligent device operation interface to ask the user whether to agree to store the preference data in the preference database. When it is determined that the user agrees to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database, and the stored preference data and control instruction are used as the time data stored in the preference database when the next time data determination arrives. Therefore, at 13:00 the next day, the device status of the table lamp will automatically be adjusted to "cold light" and "brightness level 1" according to the control instruction.

[0048] In summary, the present invention provides a control method for an intelligent gateway based on the HarmonyOS system. The method includes obtaining time data and determining whether the time data is stored in the preference database; when it is determined that the time data is stored in the preference database, calling the control instruction corresponding to the time data to enable the intelligent gateway to control the intelligent device according to the control instruction; wherein, when it is determined that the time data is not stored in the preference database, detecting the abnormal value of the device state to obtain abnormal data; extracting data from the abnormal data to obtain a control instruction; making a preference determination according to the preset conditions based on the control instruction to obtain preference data; in response to the interactive operation triggered by the user, determining whether the user agrees to store the preference data in the preference database, and when it is determined that the user agrees to store the preference data in the preference database, storing the preference data and the control instruction in the preference database. The method first continuously obtains time data and determines whether the time data is stored in the preference database, that is, determines whether the current time is the user's preferred control time. If so, it is determined as the user's preferred control time, that is, the user's set preferred control time is reached. At this time, the control instruction corresponding to the time data pre-stored in the preference database can be directly called to control the intelligent device, so that the intelligent gateway controls the intelligent device according to the control instruction; if not, the abnormal value detection of the device state is performed, that is, it is determined whether the user has adjusted the state of the device. If an adjustment is made at this time, abnormal data of the device state will be obtained, and then a control instruction is matched according to the abnormal data. At this time, the duration of this control is calculated. If the duration exceeds the preset threshold, it is determined that this control is the user's new preferred control. At this time, the user is asked. If the user agrees to store the new preference data and control instruction in the preference database, when the same time arrives next time, the intelligent gateway will automatically adjust the device state according to the stored control instruction. Compared with the situation where the user manually and actively sets the automation mode of each intelligent device, which may lead to inaccurate parameter settings and complex setting processes, the method can make a preference judgment on the user's preference setting based on preset conditions, store the user's new preference in the preference database, and perform automatic adjustment of the device when a specific time arrives next time, improving the user's experience of device automatic adjustment.

[0049] Referring to Figure 3 and Figure 4 , the second embodiment of the present invention provides a control system for an intelligent gateway based on the HarmonyOS system, including: A data query module for obtaining time data and determining whether the time data is stored in the preference database; An instruction call module for, when it is determined that the time data is stored in the preference database, calling the control instruction corresponding to the time data to enable the intelligent gateway to control the intelligent device according to the control instruction; Anomaly detection module, configured to detect abnormal values of the device status to obtain abnormal data when it is determined that the preference data is not stored in the preference database; Data extraction module, configured to extract data from the abnormal data to obtain a control instruction; Preference determination module, configured to perform preference determination according to the control instruction according to preset conditions to obtain preference data; Data storage module, configured to, in response to an interaction operation triggered by a user, determine whether the user agrees to store the preference data in the preference database, and when it is determined that the user agrees to store the preference data in the preference database, store the preference data and the control instruction in the preference database.

[0050] In an optional implementation manner, the anomaly detection module is specifically configured to: Obtain device status information, calculate the sparsity degree according to the device status information to obtain the local reachability density; Calculate the outlier factor according to the local reachability density to obtain the local outlier factor; Obtain the abnormal data according to the local outlier factor.

[0051] In an optional implementation manner, the anomaly detection module may also be configured to: Obtain device status information, calculate the sparsity degree according to the device status information to obtain the local reachability density, including: In the formula, is the real-time data point of the device status; is the historical data point of the device status; is the Euclidean distance between the real-time data point of the device status and the historical data point of the device status; is and the reachable distance between; is the distance the nearest k data; is the local reachability density, indicating the dilution degree of the real-time data point of the device status and the historical data point of the device status In an optional implementation manner, the anomaly detection module may also be configured to: When the local outlier factor is higher than a preset threshold, determine that the real-time device status is an abnormal value; Obtain the abnormal data according to the local outlier factor; Wherein, the formula for the local outlier factor is: In the formula, represents the density difference between the real-time data points of the device status and the historical data set, that is, the local outlier factor; is the distance to the k-th nearest point; is the real-time data point of the device status; is the distance to the nearest k data.

[0052] In an alternative embodiment, the data extraction module is specifically configured to: Match the device status corresponding to the abnormal data according to the abnormal data; Match the corresponding control operation according to the device status to obtain a control instruction.

[0053] In an alternative embodiment, the preference determination module is specifically configured to: Perform a matching query according to the control instruction to obtain the control start time; Calculate the difference between the control start time and the current time to obtain the preference duration; Judge whether the control instruction is a new user preference according to the preference duration. When the preference duration exceeds the threshold, it is judged as a new user preference, and the control start time is set as the preference data.

[0054] In an alternative embodiment, the data storage module is specifically configured to: After storing the preference data and the control instruction in the preference database, when the next time data determination arrives, use them as the time data stored in the preference database.

[0055] It should be noted that the control system of an intelligent gateway based on the HarmonyOS provided in the embodiments of the present invention is used to execute all the process steps of the control method of an intelligent gateway based on the HarmonyOS in the above embodiments. The working principles and beneficial effects of the two correspond one by one, so they will not be elaborated here.

[0056] The embodiments of the present invention also provide an intelligent gateway, including the control system of the intelligent gateway based on the HarmonyOS described in the second embodiment.

[0057] The embodiments of the present invention also provide an electronic device. The terminal device includes: a processor, a memory, and a computer program stored in the memory and executable on the processor, such as a control program of an intelligent gateway based on the HarmonyOS. When the processor executes the computer program, the steps in the embodiments of the above control method of an intelligent gateway based on the HarmonyOS are implemented, such as Figure 1Step S11 shown above. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above system embodiments, such as the anomaly detection module.

[0058] Exemplarily, the computer program can be divided into one or more modules / units. The one or more modules / units are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the terminal device.

[0059] The electronic device can be a computing device such as a desktop computer, a notebook, a palm computer, and a smart tablet. The terminal device may include, but is not limited to, a processor and a memory. Those skilled in the art can understand that the above components are only examples of the terminal device and do not constitute a limitation on the terminal device. It may include more or fewer components than the above, or combine some components, or different components. For example, the terminal device may further include input / output devices, network access devices, a bus, etc.

[0060] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the terminal device and connects various parts of the entire terminal device through various interfaces and lines.

[0061] The memory can be used to store the computer programs and / or modules. By running or executing the computer programs and / or modules stored in the memory, and invoking the data stored in the memory, the processor realizes various functions of the terminal device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0062] Among them, if the modules / units integrated in the terminal device are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above method embodiments of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be realized. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or system, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.

[0063] It should be noted that the system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the accompanying drawings of the system embodiments provided by the present invention, the connection relationships between modules indicate that there are communication connections between them, which can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art can understand and implement it without creative efforts.

[0064] The specific embodiments described above further elaborate on the purpose, technical solutions, and beneficial effects of the present invention. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. In particular, for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A control method for an intelligent gateway based on the Hongmeng system, characterized in that: include: Acquiring time data, and determining whether the time data is stored in a preference database; When it is determined that the time data is stored in the preference database, calling a control instruction corresponding to the time data so that the intelligent gateway controls the intelligent device according to the control instruction; Wherein, when it is determined that the time data is not stored in the preference database, an abnormal value detection of the device state is performed to obtain abnormal data; Extracting the abnormal data to obtain control instructions; According to the control instruction, preference determination is performed according to preset conditions to obtain preference data; In response to the interactive operation triggered by the user, it is determined whether the user agrees to store the preference data in the preference database. When it is determined that the user agrees to store the preference data in the preference database, the preference data and the control instruction are stored in the preference database.

2. The control method of the smart gateway based on the Hongmeng system according to claim 1 is characterized in that: When it is determined that the preference data is not stored in the preference database, performing device status abnormal value detection to obtain abnormal data includes: Acquire device status information, and perform sparsity calculation based on the device status information to obtain local reachable density; Calculating the outlier factor according to the local reachable density to obtain the local outlier factor; The abnormal data is obtained according to the local outlier factor.

3. The control method of the smart gateway based on the Hongmeng system according to claim 2 is characterized in that: The acquiring device status information and performing sparsity calculation according to the device status information to obtain the local reachable density includes: In the formula, Real-time data points for equipment status; It is the historical data point of the equipment status; It is the Euclidean distance between the real-time data point of the equipment status and the historical data point of the equipment status; for and The reachable distance between For distance Recent k individual data; is the local reachable density, which indicates the dilution degree of the real-time data points of the equipment status and the historical data points of the equipment status.

4. The control method of the intelligent gateway based on the Hongmeng system according to claim 2 is characterized in that: The step of obtaining the abnormal data according to the local outlier factor includes: When the local outlier factor is higher than a preset threshold, the real-time device status is judged to be an abnormal value; According to the local outlier factor, obtaining the abnormal data; Wherein, the local outlier factor calculation formula is: In the formula, It represents the density difference between the real-time data points of the equipment status and the historical data set, that is, the local outlier factor; For distance The kth closest point; Real-time data points for equipment status; For distance The most recent k data.

5. The control method of the intelligent gateway based on the Hongmeng system according to claim 1 is characterized in that: The extracting the abnormal data to obtain the control instruction includes: According to the abnormal data, matching the device status corresponding to the abnormal data; According to the device status, the corresponding control operation is matched to obtain the control instruction.

6. The control method of the intelligent gateway based on the Hongmeng system according to claim 1 is characterized in that: The step of performing preference determination according to the control instruction and the preset conditions to obtain preference data includes: According to the control instruction, a matching query is performed to obtain a control start time; According to the control start time, subtract it from the current time to get the preferred duration; According to the preference duration, it is determined whether the control instruction is a new user preference. When the preference duration exceeds a threshold, it is determined to be a new user preference, and the control start time is set as the preference data.

7. The control method of the intelligent gateway based on the Hongmeng system according to claim 1 is characterized in that: In response to an interactive operation triggered by a user, determining whether the user agrees to store the preference data in a preference database, and when it is determined that the user agrees to store the preference data in the preference database, after storing the preference data and the control instruction in the preference database, the method further includes: After the preference data and the control command are stored in the preference database, the time data stored in the preference database is used when the time data is determined to come next time.

8. A control system for an intelligent gateway based on the Hongmeng system, characterized in that: include: A data query module, used to obtain time data and determine whether the time data is stored in a preference database; An instruction calling module, for calling a control instruction corresponding to the time data when it is determined that the time data is stored in the preference database, so that the intelligent gateway controls the intelligent device according to the control instruction; an abnormality detection module, for performing device status abnormality detection to obtain abnormal data when it is determined that the preference data is not stored in the preference database; A data extraction module, used to extract the abnormal data and obtain control instructions; A preference determination module, used to perform preference determination according to the control instruction and preset conditions to obtain preference data; The data storage module is used to respond to the interactive operation triggered by the user, determine whether the user agrees to store the preference data in the preference database, and when it is determined that the user agrees to store the preference data in the preference database, store the preference data and the control instruction in the preference database.

9. An intelligent gateway, characterized in that: Including a control system for an intelligent gateway based on the Hongmeng system as described in claim 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the control method of the intelligent gateway based on the Hongmeng system as described in any one of claims 1 to 7.