State synchronization method and related system
By using the preset state synchronization mechanism to process the status instructions of smart home appliances in the server, the problem of unstable state of smart home appliances is solved, and the response efficiency and stability of the equipment are improved.
Patent Information
- Application Number
- CN202410991221.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-07-23
AI Technical Summary
In the field of smart homes, the control instructions received by the server do not perform additional processing, resulting in unstable state of smart home appliances, which is prone to problems such as control conflicts and excessive response times.
The server uses a preset state synchronization mechanism to process multiple received state instructions, remove duplicate and conflicting instructions, determine target state instructions, and send them to smart devices to reduce the number of responses and improve device stability.
By removing duplicate and conflicting instructions, the efficiency and response speed of smart devices to process state instructions are improved, and the stability of the device is enhanced.
Smart Images

Figure CN118523977B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communications, and in particular to a state synchronization method and a related system. Background Art
[0002] At present, in the field of smart home, a three-party connection is established between a mobile terminal (such as a mobile phone), a smart appliance, and a server, so that the device status of the smart appliance can be remotely controlled through the mobile terminal. In the prior art, the server is used to receive control instructions from the mobile terminal to the smart appliance, and send all control instructions to the smart appliance to change the device status of the smart appliance. Since the server does not perform additional processing on the received control instructions, it is easy to cause control conflicts and lead to unstable device status of the smart appliance. Summary of the invention
[0003] The present application provides a state synchronization method and a related system. The server processes multiple received state instructions according to a preset state synchronization mechanism to obtain at least one target state instruction, which can remove repeated and conflicting instructions from multiple state instructions and reduce the number of responses of smart devices, thereby improving the efficiency and response speed of smart devices in processing state instructions and improving the stability of smart devices.
[0004] In the first aspect, the present application provides a state synchronization method, which is applied to a server in a state synchronization system, wherein the state synchronization system also includes a smart device and at least one mobile terminal, and the smart device and each mobile terminal are communicatively connected through the server; the method includes: receiving multiple state instructions from the at least one mobile terminal, each state instruction in the multiple state instructions is associated with the controlled state of a single function in at least one function of the smart device, and the controlled state includes a start state and a pause state; determining at least one target state instruction among the multiple state instructions according to a preset state synchronization mechanism, and storing the at least one target state instruction in the server; the at least one target state instruction is used to characterize the start state of at least one function of the smart device; sending the at least one target state instruction to a smart device in an online state to change the controlled state of at least one function of the smart device.
[0005] In a second aspect, the present application provides a status synchronization system, which includes a server, a smart device and a mobile terminal, the smart device and the mobile terminal are communicatively connected via the server, and the server is used to execute the steps in the method as described in any one of the first aspects.
[0006] In a third aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps of the method described in any one of the second aspects are implemented.
[0007] It can be seen that in the embodiment of the present application, the server receives multiple status instructions from at least one mobile terminal, each status instruction in the multiple status instructions is associated with the controlled state of a single function in at least one function of the smart device, and the controlled state includes a start state and a pause state; at least one target status instruction in the multiple status instructions is determined according to a preset state synchronization mechanism, and at least one target status instruction is stored in the server; at least one target status instruction is used to characterize the start state of at least one function of the smart device; at least one target status instruction is sent to the smart device in the online state to change the controlled state of at least one function of the smart device. In the present application, the server processes the received multiple status instructions according to the preset state synchronization mechanism to obtain at least one target status instruction, which can remove repeated and conflicting instructions in the multiple status instructions, reduce the number of responses of the smart device, thereby improving the efficiency and response speed of the smart device in processing status instructions, and improving the stability of the smart device. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0009] Figure 1 A schematic diagram of a state synchronization system provided in an embodiment of the present application;
[0010] Figure 2 A schematic diagram of another state synchronization system provided in an embodiment of the present application;
[0011] Figure 3 A schematic diagram of the structure of a server provided for an application embodiment;
[0012] Figure 4 A flowchart of a state synchronization method provided in an embodiment of the present application;
[0013] Figure 5 A schematic diagram of a flow chart of a target state determination instruction provided in an embodiment of the present application;
[0014] Figure 6 A schematic diagram of another flow chart of determining a target state instruction provided in an embodiment of the present application;
[0015] Figure 7 A schematic diagram of a state synchronization scenario provided for an embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0017] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0018] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0019] In the embodiments of the present application, "and / or" describes the association relationship of the associated objects, indicating that three relationships may exist. For example, A and / or B can represent the following three situations: A exists alone; A and B exist at the same time; B exists alone. Among them, A and B can be singular or plural.
[0020] In the embodiment of the present application, the symbol " / " can indicate that the objects associated with each other are in an "or" relationship. In addition, the symbol " / " can also indicate a division sign, that is, performing a division operation. For example, A / B can indicate A divided by B.
[0021] In the embodiments of the present application, "at least one item" or similar expressions refer to any combination of these items, including any combination of single items or plural items, and refer to one or more, and multiple refers to two or more. For example, at least one item of a, b, or c can represent the following seven situations: a, b, c, a and b, a and c, b and c, a, b, and c. Among them, each of a, b, and c can be an element or a set containing one or more elements.
[0022] In the embodiments of the present application, "equal to" can be used in conjunction with greater than, and is applicable to the technical solution adopted when greater than, and can also be used in conjunction with less than, and is applicable to the technical solution adopted when less than. When equal to is used in conjunction with greater than, it is not used in conjunction with less than; when equal to is used in conjunction with less than, it is not used in conjunction with greater than.
[0023] The present application provides a state synchronization method and a related system. The server processes multiple received state instructions according to a preset state synchronization mechanism to obtain at least one target state instruction, which can remove repeated and conflicting instructions from multiple state instructions and reduce the number of responses of smart devices, thereby improving the efficiency and response speed of smart devices in processing state instructions and improving the stability of smart devices.
[0024] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0025] See also Figure 1 , Figure 1A schematic diagram of a state synchronization system provided in an embodiment of the present application, the state synchronization system 1 includes a server 10, a smart device 20 and at least one mobile terminal 30. The server 10 can be a physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and basic cloud computing services such as big data and artificial intelligence platforms. The mobile terminal 30 can be a user equipment (User Equipment, UE) such as a mobile phone, a smart phone, a laptop, a digital broadcast receiver, a personal digital assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing equipment connected to a wireless modem, a mobile station (Mobile Station, MS), a mobile terminal (Mobile Terminal), etc. The smart device 20 can be a smart home appliance that can communicate and interact with a user through the Internet or a local network, including but not limited to realizing functions such as automatic control, remote operation, data monitoring and feedback, such as smart door locks, smart refrigerators, smart ovens, smart fans, smart TVs, etc.
[0026] The smart device 20 and the mobile terminal 30 are connected in communication via the server 10. The mobile terminal 30 can remotely control the smart device 20 by sending a control instruction to the server 10, and the server 10 sends the control instruction to the smart device after receiving the control instruction; the smart device 20 reports its own device status to the server 10, and the server 10 synchronizes the device status of the smart device 20 to the application in the mobile terminal 30, so that the user can know the device status of the smart device 20 in real time.
[0027] The device status includes the controlled status of each function of the mobile terminal.
[0028] For specific implementation, see Figure 2 , Figure 2 Schematic diagram of another state synchronization system provided by an embodiment of the present application, wherein a device shadow 11 is stored in a server 10, and a device shadow 11 refers to a virtual copy of the state information of a smart device 20 stored in a cloud or a local server. Each smart device 20 has only one device shadow 11, and the smart device 20 can actively report its own device state to the device shadow 11 ( Figure 2 The mobile terminal 30 can check the device status of the smart device 20 by obtaining the device status of the device shadow 11 ( Figure 2To obtain the device status, when the device status of the smart device 20 needs to be modified, a control instruction can be sent to the device shadow 11 ( Figure 2 When the smart device 20 is online, the device shadow 11 sends the control instruction to the smart device 20 to change the device state of the smart device 20 ( Figure 2 When the smart device 20 is offline, the control instruction can be cached in the database 111 of the device shadow 11, and then sent to the smart device 20 when the smart device 20 is online. When the device shadow 11 receives multiple control instructions within a time window, the device shadow 11 executes the step instructions in the state synchronization method provided in the embodiment of the present application for the multiple control instructions to exclude repeated and conflicting instructions in the multiple control instructions, reduce the number of responses of the smart device 20, thereby improving the efficiency and response speed of the smart device 20 in processing state instructions, and improving the stability of the smart device 20.
[0029] See also Figure 3 , Figure 3 A schematic diagram of the structure of a server provided for an application embodiment, such as Figure 3 As shown, the server 10 is Figure 1 The server 10 in the embodiment may include: a processor 1001, such as a CPU, a network interface 1003, a user interface 1004, a memory 1002, and a communication bus 1006. The communication bus is used to realize the connection and communication between these components. The user interface 1004 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1004 may also include a standard wired interface and a wireless interface. The network interface 1003 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1002 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1002 may optionally be a storage device independent of the aforementioned processor 1001. The computer program 1005 is stored in the memory 1002, and the computer program 1005 is configured to be executed by the above-mentioned processor 1001. The computer program 1005 includes instructions for executing any step in the following state synchronization method embodiment. In a specific implementation, the processor 1001 is used to execute any step performed by the processing device in the following method embodiment. The network interface 1003 is mainly used to connect to the background server and perform data communication with the background server; the user interface 1004 is mainly used to connect to the client (user end) and perform data communication with the client.
[0030] Those skilled in the art will understand that Figure 3The structure of the server 10 shown in the figure does not constitute a limitation on the server 10, and the server 10 may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0031] Based on the above hardware structure, various embodiments of the state synchronization method of the present application are proposed.
[0032] See also Figure 4 , Figure 4 A flow chart of a state synchronization method provided in an embodiment of the present application, the state synchronization method is applied to Figure 1 In the server 10 of the state synchronization system 1, the method comprises:
[0033] Step S401: receiving a plurality of status instructions from the at least one mobile terminal.
[0034] Each of the multiple status instructions is associated with a controlled state of a single function of at least one function of the smart device.
[0035] The controlled state includes, but is not limited to, a start state and a pause state. The start state is used to represent the execution state of the function of the smart device, and the pause state is used to represent the shutdown state of the function of the smart device.
[0036] Among them, multiple state instructions can come from the same mobile terminal or from multiple mobile terminals. Multiple state instructions can be settings for the controlled state of the same function or for the controlled state settings of different functions. Therefore, when multiple state instructions are all for the same controlled state control of the same function, the problem of instruction duplication will arise.
[0037] Among them, the functions of the smart device include one or more, which refers to the product functions of the smart device, that is, the user instructs the smart device to perform specific operations through software control or automated programs by inputting status instructions to meet the user's needs or provide specific services. The user obtains the functions of the smart device through the application on the mobile terminal, and remotely controls the specific function by operating the application and triggering the status instruction for the specific function. Exemplarily, the air conditioner has functions such as cooling, heating, wind speed, wind direction control, dehumidification, energy saving, and timing. When the user triggers the cooling function, the mobile terminal sends the first status instruction of the cooling function to the server, and the server sends the first status instruction of the cooling function to the smart device to start the cooling function. After the cooling function is started, the smart device reports the device status to the server, and the device status includes the start-up status of the cooling function. When the cooling function needs to be turned off, the mobile terminal sends the second status instruction of the cooling function to the server, and the second status instruction is used to indicate the pause state of the cooling function of the smart device.
[0038] Step S402: determining at least one target state instruction among the multiple state instructions according to a preset state synchronization mechanism, and storing the at least one target state instruction in the server.
[0039] The at least one target state instruction is used to represent the activation state of at least one function of the smart device.
[0040] Among them, in this embodiment, one or more status instructions related to the activation status of the function of the smart device can be screened out from multiple status instructions according to the preset status synchronization mechanism.
[0041] In some embodiments, the preset state synchronization mechanism is used to obtain one or more state instructions in which the controlled state is the startup state among the multiple state instructions, and to merge multiple state instructions associated with the same function among the one or more state instructions to obtain at least one target state instruction.
[0042] See also Figure 5 , Figure 5 A flowchart of determining a target state instruction provided in an embodiment of the present application is provided. The specific process of the server determining at least one target state instruction from multiple state instructions according to a preset state synchronization mechanism includes the following steps:
[0043] Step S501, one or more state instructions whose controlled state is a start state are screened out from a plurality of state instructions, and recorded as a first state instruction set.
[0044] Step S502: Filter out multiple status instructions associated with the same function from the first status instruction set and record them as reference status instructions.
[0045] Step S503: merge multiple reference instructions into a single status instruction according to a merging rule.
[0046] Step S504: determine the remaining state instructions in the first state instruction set and the single state instruction obtained in step S503 as target state instructions.
[0047] For specific implementation, see Table 1, which is a status instruction data table provided in the embodiment of the present application.
[0048]
[0049] As shown in Table 1, the mobile terminal includes a first terminal 1, a second terminal 2, a third terminal 3, and a fourth terminal 4. The smart device includes cooling, heating, and dehumidification functions. In the table, "start" indicates the start state, "pause" indicates the pause state, and " indicates that it is not set. The first terminal 1 sent 2 status instructions (1, start, cooling), (1, start, dehumidification), the second terminal 2 sent 3 status instructions (2, pause, cooling), (2, start, heating), (2, start, dehumidification), the third terminal 3 sent 1 status instruction (3, start, cooling), and the fourth terminal 4 sent 1 status instruction (4, start, cooling). The meaning of the status instruction is (terminal, controlled state, function).
[0050] First, select the state instructions (1, start, cooling), (1, start, dehumidification), (2, start, heating), (2, start, dehumidification), (3, start, cooling), (4, start, cooling) whose controlled state is the start state.
[0051] Secondly, the state instructions with the same function in the state instructions whose controlled state is the start state are merged. For the refrigeration function, there are three state instructions (1, start, cooling), (3, start, cooling), and (4, start, cooling). One state instruction is selected from them according to the merging rule, for example, merged into (1, start, cooling); for the dehumidification function, there are two state instructions (1, start, dehumidification) and (2, start, dehumidification). One state instruction is selected from them according to the merging rule, for example, merged into (2, start, dehumidification).
[0052] Finally, (1, start, cooling), (2, start, heating), and (2, start, dehumidification) are used as target state instructions.
[0053] It can be seen that in this embodiment, through the preset state synchronization mechanism, the state instructions associated with the state instructions of the pause state can be removed from multiple state instructions, and the state instructions associated with the same function from multiple state instructions of the start state can be merged, which can reduce the number of message transmissions from the server to the smart device and the number of repeated responses of the smart device, thereby improving the stability of the smart device.
[0054] In some embodiments, the method for merging multiple status instructions associated with the same function in the one or more status instructions specifically includes the following steps: obtaining multiple reference status instructions associated with the same function in the one or more status instructions; determining the merged status instruction based on the size of the timestamps contained in the multiple reference status instructions, the timestamp being used to represent the moment when each reference status instruction in the multiple reference status instructions is sent by the corresponding mobile terminal.
[0055] Each status instruction carries a timestamp, which is used to indicate the time when the status instruction is sent by the corresponding mobile terminal. For multiple reference status instructions associated with the same function, one status instruction is determined from the multiple reference status instructions according to the timestamp size, so as to achieve the purpose of merging multiple repeated status instructions.
[0056] Among them, the state instruction with the smallest timestamp, that is, the earliest sent out, can be selected as the merged state instruction, or the state instruction with the largest timestamp, that is, the latest sent out, can be selected as the merged state instruction. Of course, there are other selection methods, and the final effect achieved is the same.
[0057] It can be seen that in this embodiment, multiple repeated status instructions can be merged into one status instruction according to the timestamp size.
[0058] In some embodiments, after storing the at least one target state instruction in the server, the method further includes: obtaining historical configuration parameters of at least one function corresponding to the at least one target state instruction, the server storing historical configuration parameters of each function of the at least one function of the smart device, the historical configuration parameters being used to characterize the configuration parameters of each function in the processing cycle before the current processing cycle; sending the at least one target state instruction to the online smart device includes: sending the at least one target state instruction and the historical configuration parameters corresponding to the at least one target state instruction to the online smart device, so as to change the controlled state of at least one function of the smart device to the startup state.
[0059] Among them, in addition to the start state and the pause state, the controlled state of a function of the smart device is also associated with specific configuration parameters when the controlled state is the start state. For example, for the cooling function of the air conditioner, when the controlled state is the start state, a specific cooling temperature needs to be set. When the user starts a function without setting the function configuration parameters, the server receives the state instruction for the start state of the function, obtains the historical configuration parameters corresponding to the function, and uses the historical configuration parameters as the configuration parameters of the current state instruction. The target state instruction and the corresponding historical configuration parameters are stored in the server. When the smart device is online, the server sends the target state instruction and the corresponding historical configuration parameters to the smart device.
[0060] The historical configuration parameters are usually the configuration parameters corresponding to the function in the device status reported by the smart device last time and stored in the server. For example, the temperature of the air conditioning cooling function was set to 26°C last time. When the cooling function is started again, if a specific temperature is set, the temperature is directly set to 26°C.
[0061] It can be seen that in this embodiment, when the user starts a function without setting the function configuration parameters, the server receives the status instruction for the start-up state of the function, obtains the historical configuration parameters corresponding to the function, and uses the historical configuration parameters as the configuration parameters of the current status instruction. Using the historical configuration parameters as the configuration parameters of the current status instruction not only helps to improve user experience and satisfaction, but also increases the intelligence and convenience of smart devices.
[0062] In some embodiments, the status instruction is also associated with the configuration parameters of a single function in at least one function of the smart device; the preset state synchronization mechanism is used to obtain one or more status instructions in the multiple status instructions in which the controlled state is the startup state, and to merge multiple status instructions associated with the same function and the same configuration parameters in the one or more status instructions into a single status instruction, and to exclude status instructions other than the highest priority status instruction in the one or more status instructions associated with the same function and different configuration parameters; the at least one target status instruction is used to characterize the startup state of at least one function of the smart device and the configuration parameters of each function in the at least one function.
[0063] When a user starts a function and sets corresponding configuration parameters at the same time, the state instruction for the function is associated with the controlled state and the configuration parameters at the same time.
[0064] See also Figure 6 , Figure 6 Another flow chart of determining a target state instruction provided in an embodiment of the present application, wherein the specific process of the server determining at least one target state instruction from multiple state instructions according to a preset state synchronization mechanism includes the following steps:
[0065] Step S601, one or more state instructions whose controlled state is a start state are screened out from a plurality of state instructions, and recorded as a first state instruction set.
[0066] Step S602: Filter out a plurality of status instructions associated with the same function and having the same configuration parameters from the first status instruction set, and record them as first reference status instructions.
[0067] Step S603: merge multiple first reference instructions into a single state instruction according to a merging rule.
[0068] Step S604 , filtering out multiple status instructions associated with the same function and having different configuration parameters from the first status instruction set, namely, second reference status instructions.
[0069] Step S605 , selecting a state instruction with the highest priority from the plurality of second reference instructions according to the priority, and recording it as a third reference state instruction.
[0070] Step S606: determine the remaining state instructions in the first state instruction set, the single state instruction obtained in step S603, and the third reference state instruction obtained in step S605 as target state instructions.
[0071] For specific implementation, see Table 2, which is another status instruction data table provided in the embodiment of the present application.
[0072]
[0073] As shown in Table 2, the mobile terminal includes a first terminal 1, a second terminal 2, a third terminal 3, and a fourth terminal 4. The smart device includes cooling, heating, and dehumidification functions. In the table, "start" indicates the start state, "pause" indicates the pause state, and " indicates that it is not set. The configuration parameter of the cooling function is the cooling temperature (unit: °C), the configuration parameter of the heating function is the heating temperature (unit: °C), and the configuration parameter of the dehumidification function is the relative humidity (unit: RH).
[0074] The first terminal 1 sent two status instructions (1, start, cooling, 17°C), (1, start, dehumidification, 50%RH), and the second terminal 2 sent three status instructions (2, pause, cooling, )、(2, start, heating, 26℃)、(2, start, dehumidification, 50%RH)
[0075] The third terminal 3 sends a status instruction (3, start, cooling, 20℃).
[0076] The fourth terminal 4 sends a status instruction (4, start, cooling, 26°C). The status instruction means (terminal, controlled state, function, configuration parameters).
[0077] First, select the state instructions for the controlled state to be the start state (1, start, cooling, 17°C), (1, start, dehumidification, 50%RH), (2, start, heating, 26°C), (2, start, dehumidification, 50%RH), (3, start, cooling, 20°C), (4, start, cooling, 26°C), which is the first state instruction set.
[0078] Secondly, merge the state instructions with the same function and configuration parameters in the state instructions whose controlled state is the start state in the first state instruction set. For the dehumidification function, there are two state instructions (1, start, dehumidification, 50%RH) and (2, start, dehumidification, 50%RH). Select one state instruction from them according to the merging rule, for example, merge into (2, start, dehumidification, 50%RH).
[0079] Again, multiple state instructions whose controlled states are the start state, associated with the same function, and with different configuration parameters are selected from the first state instruction set, and recorded as the second reference state instructions, including (1, start, cooling, 17°C), (3, start, cooling, 20°C), and (4, start, cooling, 26°C) for the cooling function. The state instruction with the highest priority is selected from the second reference state instructions as the second reference state instruction, for example, (3, start, cooling, 20°C) is selected.
[0080] Finally, (3, start, cooling, 20°C), (2, start, heating, 26°C), and (2, start, dehumidification, 50%RH) are used as target state instructions.
[0081] It can be seen that in this embodiment, when the status instruction is simultaneously associated with the controlled state and the configuration parameters, one or more status instructions whose controlled instructions are the startup state are first screened out, and then the status instructions associated with the same function and the same configuration parameters in one or more status instructions are merged, and the other status instructions except the status instruction with the highest priority in the multiple status instructions associated with the same function and different configuration parameters in one or more status instructions are excluded to obtain the target status instruction, which can effectively reduce the number of repeated instructions.
[0082] In some embodiments, the priority is used to characterize the execution order of each status instruction among multiple status instructions that are associated with the same function and have different configuration parameters in the one or more status instructions; the priority includes at least one of a time priority and a device priority, the time priority is used to determine the execution order according to the size of a timestamp carried by the status instruction, and the device priority is used to determine the execution order according to a device level, and the device level is the device level of a mobile terminal corresponding to the multiple status instructions.
[0083] Among them, the user can set the device level of different mobile terminals bound to the smart device on the cloud platform. When multiple status instructions are associated with the same function or multiple status instructions are associated with the same function and have different configuration parameters, the final executed instruction is determined according to the device level.
[0084] In some embodiments, the priority also includes function priority. After determining at least one target state instruction among the multiple state instructions according to a preset state synchronization mechanism, the method also includes: detecting that there is a conflict in at least one function associated with the at least one target state instruction; determining the conflicting first state instruction and the second state instruction according to the priority, the priority of the first state instruction being higher than the priority of the second state instruction; and using other state instructions among the at least one target state instruction except the second state instruction as target state instructions.
[0085] The function priority refers to determining the priority order between multiple functions of a smart device. For example, as shown in Table 1, the function priority may be cooling>dehumidification>heating. The function priority may be the default priority order set in the smart device, and the user may also customize the function priority through the mobile terminal.
[0086] Among them, when there are conflicting state instructions in at least one target state instruction, for example, when there is a conflict between the cooling function and the heating function in the multiple target state instructions (1, start, cooling), (2, start, heating), and (2, start, dehumidification) determined according to Table 1, the priority of the cooling function is higher than the priority of the heating function according to the function priority. Therefore, the final target state instructions include (1, start, cooling), (2, start, dehumidification).
[0087] It can be seen that in the embodiment, after at least one target state instruction is preliminarily determined, it is determined whether there are conflicting instructions in at least one target state instruction. When conflicting instructions exist, state instructions with lower function priorities are excluded according to the function priorities, thereby avoiding conflicts between different functions and ensuring the stability and consistency of the system during operation.
[0088] Step S403: Send the at least one target state instruction to the online smart device to change the controlled state of at least one function of the smart device.
[0089] It can be seen that in the embodiment of the present application, the server receives multiple status instructions from at least one mobile terminal, each status instruction in the multiple status instructions is associated with the controlled state of a single function in at least one function of the smart device, and the controlled state includes a start state and a pause state; at least one target status instruction in the multiple status instructions is determined according to a preset state synchronization mechanism, and at least one target status instruction is stored in the server; at least one target status instruction is used to characterize the start state of at least one function of the smart device; at least one target status instruction is sent to the smart device in the online state to change the controlled state of at least one function of the smart device. In the present application, the server processes the received multiple status instructions according to the preset state synchronization mechanism to obtain at least one target status instruction, which can remove repeated and conflicting instructions in the multiple status instructions, reduce the number of responses of the smart device, thereby improving the efficiency and response speed of the smart device in processing status instructions, and improving the stability of the smart device.
[0090] In some embodiments, after sending the at least one target state instruction to the smart device in an online state, the method also includes: receiving at least one synchronization instruction from the smart device, a single synchronization instruction being used to characterize the controlled state of each of the at least one function as the startup state; and updating the controlled state of each of the at least one function to the startup state.
[0091] Among them, when the smart device changes the controlled state of at least one function according to the target state instruction, it needs to report the new controlled state to the server in time, and the server will then feed back the new controlled state to the mobile terminal, which helps the user to check the current controlled state of the smart device in time.
[0092] In some embodiments, for the status instructions filtered out from the multiple status instructions, the server sends a prompt message to the mobile terminal, where the prompt message includes the reason for the control failure, so that the user can promptly understand the reason for the failure to set the status instruction he / she expects.
[0093] Exemplarily, the filtered out status instructions specifically include: status instructions whose controlled state is a pause state; other status instructions in the second reference status instructions except the third reference status instructions involved in step S604 and step S605; and status instructions with lower functional priority in at least one target status instruction and in two status instructions that send conflicts.
[0094] See also Figure 7 , Figure 7 A schematic diagram of a state synchronization scenario provided in an embodiment of the present application. Figure 7 As shown, Figure 7 by Figure 1 The state synchronization system provided is a framework, the mobile terminal 30 includes a first terminal 1, a second terminal 2, a third terminal 3, and a fourth terminal 4, the smart device 20 is an air conditioner, the first terminal 1 sends 2 state instructions (1, start, cooling), (1, start, dehumidification) to the server 10, the second terminal 2 sends 3 state instructions (2, pause, cooling), (2, start, heating), (2, start, dehumidification) to the server 10, the third terminal 3 sends 1 state instruction (3, start, cooling) to the server 10, and the fourth terminal 4 sends 1 state instruction (4, start, cooling) to the server 10. The meaning of the state instruction is (terminal, controlled state, function).
[0095] After receiving multiple status instructions, the server 10 processes and analyzes the multiple status instructions according to the status synchronization method provided in this embodiment, and obtains three status instructions, namely (1, start, cooling), (2, start, heating), and (2, start, dehumidification). It is determined whether there is a conflict among the three status instructions. (1, start, cooling) and (2, start, heating) conflict with each other, and (2, start, heating) is excluded according to the function priority, and (1, start, cooling) and (2, start, dehumidification) are sent as target status instructions to the air conditioner in the online state. And a prompt message of heating failure is sent to the second terminal 2.
[0096] The air conditioner starts the cooling and dehumidification functions according to the two target state instructions, and reports the latest controlled state of each function to the server 10. For example, cooling is started and dehumidification is started.
[0097] The server 10 sends the latest controlled status of the smart device 20 to the four mobile terminals 30 .
[0098] In some embodiments, the preset state synchronization mechanism is also used to obtain multiple first state instructions in which the controlled state is the pause state among the multiple state instructions, and to merge multiple state instructions associated with the same function among the multiple first state instructions to obtain a first target state instruction, and the first target state instruction is used to represent the pause state of the corresponding function.
[0099] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media sets. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium may be a solid-state hard disk.
[0100] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the steps of any method described in the above method embodiments, and the above computer includes an electronic device.
[0101] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0102] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0103] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the above-mentioned units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0104] The units described above 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 on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0105] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0106] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the above-mentioned methods in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0107] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0108] The embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A state synchronization method, characterized in that: A server applied to a state synchronization system, wherein the state synchronization system further comprises a smart device and a plurality of mobile terminals, wherein the smart device and each mobile terminal are communicatively connected via the server; the method comprises: receiving a plurality of status instructions from the plurality of mobile terminals, each of the plurality of status instructions being associated with a controlled state of a single function of at least one function of the smart device, the controlled state comprising a start state and a pause state; When the controlled state is the startup state, the multiple state instructions are also associated with configuration parameters; If the configuration parameters of the multiple state instructions are not set, at least one target state instruction among the multiple state instructions is determined according to the first preset state synchronization mechanism, and the at least one target state instruction is used to characterize the startup state of at least one function of the smart device; wherein the specific process of determining the at least one target state instruction according to the first preset state synchronization mechanism includes the following steps: screening out one or more state instructions whose controlled state is the startup state from the multiple state instructions; screening out multiple reference state instructions associated with the same function from the one or more state instructions; merging the multiple reference state instructions into a single state instruction; determining the state instructions associated with different functions in the one or more state instructions and the single state instruction as the at least one target state instruction; If the configuration parameters of the multiple state instructions are set, at least one target state instruction among the multiple state instructions is determined according to the second preset state synchronization mechanism, and the at least one target state instruction is used to characterize the startup state of at least one function of the smart device and the configuration parameters of each function of the at least one function; wherein the specific process of determining the at least one target state instruction according to the second preset state synchronization mechanism includes the following steps: screening out one or more state instructions whose controlled state is the startup state from the multiple state instructions; screening out a plurality of first reference state instructions associated with the same function and the same configuration parameters from the one or more state instructions; merging the plurality of first reference state instructions into a single first state instruction; screening out a plurality of second reference state instructions associated with the same function and different configuration parameters from the one or more state instructions; determining a single second state instruction from the plurality of second reference state instructions according to priority; determining the state instructions associated with different functions, the single first state instruction, and the single second state instruction in the one or more state instructions as the at least one target state instruction; storing the at least one target state instruction in the server; Sending the at least one target state instruction to an online smart device to change a controlled state of at least one function of the smart device; After determining at least one target state instruction among the multiple state instructions according to the first preset state synchronization mechanism, the method further includes: Acquire historical configuration parameters of at least one function corresponding to the at least one target state instruction, wherein the server stores historical configuration parameters of each function of the at least one function of the smart device, and the historical configuration parameters are used to represent configuration parameters of each function in a processing cycle before a current processing cycle; The sending of the at least one target state instruction to the online smart device includes: sending the at least one target state instruction and the historical configuration parameters corresponding to the at least one target state instruction to the online smart device, so as to change the controlled state of at least one function of the smart device to the startup state.
2. The method according to claim 1, characterized in that The first preset state synchronization mechanism is used to obtain one or more state instructions in which the controlled state is the startup state among the multiple state instructions, and to merge multiple state instructions associated with the same function among the one or more state instructions to obtain at least one target state instruction.
3. The method according to claim 2, characterized in that The step of merging the plurality of reference status instructions into a single status instruction comprises: The merged status instruction is determined according to the size of the timestamps included in the multiple reference status instructions, and the timestamp is used to represent the time when each reference status instruction in the multiple reference status instructions is sent by the corresponding mobile terminal.
4. The method according to claim 1, characterized in that: The second preset state synchronization mechanism is used to obtain one or more state instructions in which the controlled state is the startup state among the multiple state instructions, and to merge multiple state instructions associated with the same function and the same configuration parameters among the one or more state instructions into a single state instruction, and to exclude state instructions other than the state instruction with the highest priority among the one or more state instructions associated with the same function and different configuration parameters.
5. The method according to claim 4, characterized in that The priority is used to characterize the execution order of each status instruction among multiple status instructions associated with the same function and different configuration parameters in the one or more status instructions; the priority includes at least one of a time priority and a device priority, the time priority is used to determine the execution order according to the size of a timestamp carried by the status instruction, and the device priority is used to determine the execution order according to a device level, and the device level is the device level of the mobile terminal corresponding to the multiple status instructions.
6. The method according to claim 4 or 5, characterized in that: The priority also includes a function priority. After determining at least one target state instruction among the multiple state instructions according to the second preset state synchronization mechanism, the method further includes: detecting a conflict in at least one function associated with the at least one target state instruction; Determine the conflicting first state instruction and second state instruction according to the priority, wherein the priority of the first state instruction is higher than the priority of the second state instruction; The other state instructions among the at least one target state instruction except the second state instruction are used as target state instructions.
7. The method according to any one of claims 1 to 5, characterized in that: After sending the at least one target state instruction to the online smart device, the method further includes: receiving at least one synchronization instruction from the smart device, wherein the single synchronization instruction is used to indicate that the controlled state of each function of the at least one function is the startup state; The controlled state of each of the at least one function is updated to the start state.
8. A state synchronization system, characterized in that: The status synchronization system includes a server, a smart device and a mobile terminal, the smart device and the mobile terminal are communicatively connected via the server, and the server is used to execute the steps in the method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
