WO2020228031A1 - Instruction processing method and apparatus, electronic device and storage medium - Google Patents
Instruction processing method and apparatus, electronic device and storage medium Download PDFInfo
- Publication number
- WO2020228031A1 WO2020228031A1 PCT/CN2019/087296 CN2019087296W WO2020228031A1 WO 2020228031 A1 WO2020228031 A1 WO 2020228031A1 CN 2019087296 W CN2019087296 W CN 2019087296W WO 2020228031 A1 WO2020228031 A1 WO 2020228031A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- control instruction
- control
- user
- priority
- instruction
- Prior art date
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 32
- 239000013643 reference control Substances 0.000 claims abstract description 174
- 238000000034 method Methods 0.000 claims abstract description 57
- 238000012545 processing Methods 0.000 claims description 24
- 230000004044 response Effects 0.000 claims description 20
- 230000006870 function Effects 0.000 claims description 17
- 230000001960 triggered effect Effects 0.000 claims description 13
- 230000000694 effects Effects 0.000 claims description 9
- 238000013475 authorization Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 14
- 230000003993 interaction Effects 0.000 description 11
- 230000000977 initiatory effect Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 230000008859 change Effects 0.000 description 6
- 238000007791 dehumidification Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000001816 cooling Methods 0.000 description 3
- 230000015572 biosynthetic process Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000004140 cleaning Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003111 delayed effect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000000779 smoke Substances 0.000 description 1
- 238000010408 sweeping Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Definitions
- This application relates to the field of Internet of Things, and more specifically, to an instruction processing method, device, electronic device, and storage medium.
- this application proposes an instruction processing method, device, electronic equipment, and storage medium to improve the foregoing problems.
- this application provides an instruction processing method applied to an electronic device.
- the method includes: after receiving a control instruction, acquiring a target device controlled by the control instruction and a user who sends the control instruction; Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is a control command sent by a user other than the sending user in the user group to which the sending user belongs to control the target device Control instruction, the users in the user group are all bound to the target device; if it is identified that the control instruction conflicts with the reference control instruction, compare the control of the sending user and the user who sent the reference control instruction Priority; if the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction.
- the present application provides an instruction processing device that runs on an electronic device.
- the device includes: an instruction information acquisition unit, configured to acquire the target device controlled by the control instruction and the target device controlled by the control instruction after receiving the control instruction.
- the sending user of the control instruction the reference information determining unit is used to obtain the reference control instruction received within the same cycle time as the control instruction, and the reference control instruction is the user group to which the sending user belongs except the Sending a control instruction for controlling the target device sent by a user other than the user, and all users in the user group are bound to the target device;
- the priority comparison unit is configured to compare the control priority of the sending user and the user who sent the reference control instruction if the control instruction conflicts with the reference control instruction; the instruction processing unit is configured to: The control priority of the sending user is higher than the control priority of the user sending the reference control instruction, and the control instruction is executed.
- this application provides an electronic device including one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be The one or more processors execute the above-mentioned methods.
- the present application provides a computer-readable storage medium having program code stored in the computer-readable storage medium, wherein the above-mentioned method is executed when the program code is running, and control confusion can also be avoided.
- the instruction processing method, device, electronic device, and storage medium provided by this application will first obtain the target device controlled by the control instruction and the sending user of the control instruction after receiving the control instruction, and then obtain Refer to the control instruction, and then identify the conflict between the control instruction and the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priority of the sending user and the user sending the reference control instruction If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
- FIG. 1 shows a schematic diagram of the architecture of the Internet of Things proposed in an embodiment of the present application
- FIG. 2 shows a schematic diagram of another architecture of the Internet of Things proposed in an embodiment of the present application
- FIG. 3 shows a schematic diagram of yet another architecture of the Internet of Things proposed by an embodiment of the present application
- FIG. 4 shows a schematic diagram of a communication mode between a client and a server proposed in an embodiment of the present application
- FIG. 5 shows a schematic diagram of the operating environment of the instruction processing method proposed in an embodiment of the present application
- FIG. 6 shows a schematic diagram of a cycle time in the instruction processing method proposed by the embodiment of the present application.
- FIG. 7 shows a schematic diagram of another cycle time in the instruction processing method proposed by the embodiment of the present application.
- FIG. 8 shows a flowchart of an instruction processing method proposed by another embodiment of the present application.
- FIG. 9 shows a schematic diagram of determining a reference user in the instruction processing method proposed by an embodiment of the present application.
- FIG. 10 shows a flowchart of an instruction processing method proposed by still another embodiment of the present application.
- FIG. 11 shows a schematic diagram of a priority mode configuration in an instruction processing method proposed by still another embodiment of the present application.
- FIG. 12 shows a flowchart of an instruction processing method proposed by another embodiment of the present application.
- FIG. 13 shows a flowchart of an instruction processing method proposed by another embodiment of the present application.
- FIG. 14 shows a structural block diagram of an instruction processing device proposed by an embodiment of the present application.
- FIG. 15 shows a structural block diagram of an instruction processing device proposed by another embodiment of the present application.
- FIG. 16 shows a structural block diagram of an instruction processing device proposed by another embodiment of the present application.
- FIG. 17 shows a structural block diagram of an electronic device of the present application for executing the instruction processing method according to an embodiment of the present application
- Fig. 18 is a storage unit for storing or carrying program codes for implementing the device control method according to the embodiment of the present application.
- the Internet of Things is a network concept that extends and expands its user end to any item and item for information exchange and communication based on the "Internet concept".
- IoT technology With the development of IoT technology, some scenarios can be configured in the IoT system. For the configuration scenario, multiple controlled devices may be involved, and multiple controlled devices have a certain linkage relationship and can work together.
- the controlled devices can be projectors, projection screens, smart lights, smart sockets, human sensors, door and window sensors, wireless switches, air conditioners, smoke alarms, smart curtain motors, and electronic devices such as air purifiers and smart speakers.
- the control terminal 100 that plays a control role can realize data interaction with the controlled device 99 by directly establishing a wireless connection with the router 90.
- the control terminal 100 can also realize data interaction with the controlled device 99 through the data link between the cloud 91 and the router 90 after establishing a connection with the cloud 91.
- the control terminal 100 directly establishes data interaction with the first cloud 91a, and then realizes the control terminal 100 based on the data interaction between the first cloud 91a and the second cloud 91b.
- the controlled device 99 may establish a wireless connection with the router 90 through the gateway 98.
- the data interaction may include the control terminal 100 sending a control instruction to the controlled device, and may also include the controlled device returning status information to the control terminal 100 or returning the instruction execution result.
- the data interaction between the control terminal 100 and the controlled device may be triggered by a client installed in the control terminal 100.
- each manufacturer will develop its own SDK plug-in so as to control client calls in the terminal 100.
- the client loads the manufacturer's SDK plug-in, it can call the loaded SDK plug-in, and then interact with the manufacturer's server through the SDK plug-in.
- the client 110 shown in FIG. 4 is loaded with the SDK plug-in 111 of manufacturer A and the SDK plug-in 112 of manufacturer B.
- the client 110 can communicate with manufacturer A by calling the SDK plug-in of manufacturer A.
- the server 210 of manufacturer B performs data interaction, and the client 110 can interact with the server 220 of manufacturer B by calling the SDK plug-in of manufacturer B.
- the control methods in IoT scenarios are becoming more and more abundant. For example, multiple users can be bound to the same controlled device at the same time, so that multiple users can control or configure the same device.
- the inventor found in the research that in the related instruction processing method, the electronic device that forwards the control instruction (for example, the server or the gateway 98 in the cloud 91) is executed in the order before and after the instruction is received. Even the control commands received at the same time will be executed.
- the inventor also discovered that the control commands triggered by multiple users bound to the same controlled device may conflict with each other when controlling the same device. However, the electronic device that forwards the control command may conflict with each other.
- the inventor proposes an instruction processing method, device, electronic device, and storage medium that can improve the above-mentioned problems in this application.
- an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
- Step S110 After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction.
- the electronic device is an intermediate device between the control terminal and the controlled device operated by the user.
- the electronic device After the electronic device receives the control instruction sent by the control terminal, it can forward the received control instruction to the target device, and the target device here refers to the controlled device that the user desires to control or configure. So in order for the electronic device to identify which user sent the received control instruction and which device the user expects to control, the control instruction sent by the control terminal operated by the user will carry information about the sending user. And the information of the controlled target device, so that the electronic device can obtain the target device controlled by the control instruction and the sending user of the control instruction.
- the control terminal can encode the information about the sending user and the information of the target device under control based on the coding rule negotiated with the electronic device to generate control Instruction, when the electronic device receives the control instruction, it can decode according to the decoding regulations corresponding to the negotiated encoding rule, and then obtain the target device carried in the control instruction and the user who sent the control instruction.
- the information about the sending user carried in the control instruction may be the user's account, and the information about the controlled target device may be the unique identifier of the device to be controlled.
- Step S120 Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs.
- the cycle time can be understood as the work cycle of the smart home scenario, and can also be understood as the time period for intensively processing the received control commands that have not yet been executed.
- the working cycle of the smart home scene it should be noted that when the user configures the smart home scene, he can configure a working cycle for the configured scene.
- the electronic device will Compare the control priority of the sending user of all control commands, and only allow users with higher control priority to control the target device, or allow control commands sent by users with higher control priority to override those with lower control priority
- the control instructions sent by the user but the control instructions sent by the user with lower control priority are not allowed to overwrite the control instructions sent by the user with higher control priority, and the length of the working cycle can be set by the user.
- the electronic device can also automatically adapt according to the scene configured by the user.
- a device classification library can be pre-established in the electronic device, and the working cycles for various device adaptations are preset in the classification library, so that the electronic device can identify the working cycle corresponding to each device.
- electrical appliances such as air conditioners, televisions, speakers, etc. that may not run for a long time can be configured with a 12-hour or 24-hour work cycle.
- electrical equipment such as sensors or cameras that will run for a long time, a period of one month or even longer can be configured.
- the user group therein represents users who can control the same device, and the control priority of each user in the user group can be configured by users with special permissions in the user group. For example, it can be configured by an administrator user, or configured by a user who forms a user group.
- a user can send a user group formation instruction to the electronic device through the bound control terminal. After receiving the component instruction, the electronic device will first search for the controlled device bound to the initiating user. Then divide the users bound with the same controlled device into the same user group, and configure the initiating user as an administrator user by default, so that the initiating user can configure the control priority.
- the electronic device inquires that other user A is also bound to controlled device B and controlled device C, and other users B is bound to controlled device A, then the electronic device will allocate the initiating user and user A as a user group, and then allocate the initiating user and user B to another user group.
- a relatively complete user group can be established.
- the control terminal can directly control the controlled device based on LAN communication.
- the control command sent by the control terminal can be directly sent to the controlled device through the gateway instead of forwarding based on the cloud server.
- the electronic device can directly configure users in the same local area network as a user group, or directly configure the controlled device bound to the initiating user Users in the same local area network are configured as a user group so that the user group can be established quickly.
- the electronic device can identify users in the same local area network in multiple ways. For example, it can identify that the control terminal bound to the multiple users uses the same public network IP when communicating with the server.
- the electronic device can also determine whether the IP address and the subnet mask of the user control terminal are the same to determine whether multiple control terminals are in the same local area network. It is understandable that the above method can also be used to determine whether the controlled device and the controlling terminal are in the same local area network, and the above method can still be used to determine whether multiple controlled devices are in the same local area network.
- Step S130 If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user sending the reference control instruction.
- the electronic device may determine whether two or more control commands conflict in various ways. As a way, it can be judged by the control effect of the same control function. In this manner, if it is recognized that the control instruction and the reference control instruction have different control effects on the same function of the target device, it is determined that the control instruction conflicts with the reference control instruction.
- the control command is to control smart speaker A to adjust the volume to 30, and the reference control command is also to control the volume of smart speaker, but it is to adjust the volume of smart speaker A to 25, then the electronic device recognizes 25 and 30 After different, it is determined that the control command conflicts with the reference control command.
- the electronic device detects that the control instruction is to control the air conditioner A to adjust the cooling temperature to 25 degrees, and it recognizes that the reference control instruction is to adjust the cooling temperature of the air conditioner A to 16 degrees, then the electronic device will recognize that 25 is different from 16 It is determined that the control instruction conflicts with the reference control instruction. As another way, the electronic device can judge the control mode of the device. In this manner, if it is recognized that the control instruction and the reference control instruction control the target device to switch to different operating modes, it is determined that the control instruction conflicts with the reference control instruction.
- the electronic device if the electronic device recognizes that the control instruction is to control the cleaning robot A to switch to the sweeping mode, and the reference control instruction is to control the cleaning robot A to switch to the charging mode, the electronic device will determine that the control instruction conflicts with the reference control instruction.
- the control command received by the electronic device carries the control effective time or control end time, it is recognized that the control command is different from the effective time or control end time in the reference control command. In this case, it is determined that the control instruction conflicts with the reference control instruction.
- the electronic device recognizes that 11 o'clock and 12 o'clock are different, determine that the control instruction is different from the reference control Command conflict.
- Step S140 If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction.
- Step S141 If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. It can be understood that the control command and the reference control command received by the electronic device in this embodiment are within the same cycle time, and the cycle time in this embodiment has different meanings. The cycle time carries on the introduction of the embodiment scheme.
- the cycle time can be understood as the working cycle of the smart home scene, as shown in Figure 6, time T1 to time T2 is a working cycle, time T2 to time T3 is another working cycle, from time T1 to time T2
- user A first sends a control command to control air conditioner A (the target device in this example) to turn on the cooling mode at T1+n.
- control air conditioner A the target device in this example
- the electronic device will find that after receiving the control command sent by user A In the cycle time from T1 to T2, there is no reference control instruction, then the electronic device will directly execute the control instruction sent by user A.
- user B also sent a control command to control air conditioner A to turn on the dehumidification mode.
- the electronic device After receiving the control command to be sent by user B, the electronic device began to obtain the reference control command.
- the control command for controlling the air conditioner A is used as a reference control command, and then the control priority of user B and user A is compared. If the comparison finds that the control priority of user B is lower than the control priority of user A, then the electronic device will The control command sent by user B is discarded, but if it is found that the control priority of user B is higher than the control priority of user A, the electronic device will execute the control command sent by user B, and then switch the air conditioner A to dehumidification mode.
- control priority of user B is lower than the control priority of user A
- user B sends a control command to control air conditioner A at time T2+n during the period from T2 to T3, and it is still Control the air conditioner A to enter the dehumidification mode, then after entering this cycle time, because no other user has sent a control command, then there is no reference control command within this cycle time, and the electronic device will directly execute only the user B’s
- the control command sent at time T2+n then switches the air conditioner A to the dehumidification mode.
- time T4 to time T5 is one cycle time
- time T5 to time T6 is another period time. It is understandable that in this way, control instructions that have not been executed are processed.
- the length of each cycle time will be relatively short, for example, 1 second or 0.5 seconds , Even 0.1 seconds.
- the electronic device will receive the subsequent control commands that control the same target device in each cycle time as the reference control command, and the electronic device will take the control command and reference control command within the same cycle time
- the control priority of the sending user is compared, and the control command sent by the user with higher control priority is executed, and the reference control command sent by the user with lower control priority is discarded. For example, if user A sends a control command to control smart speaker A at time T4+n, and user B sends a reference control command to control smart speaker A at time T4+3n, then the electronic device is determining the control priority of user A If the control priority is higher than that of user B, the electronic device will execute the control instruction sent by user A, and discard the reference control instruction sent by user B.
- control instruction and the reference control instruction may be control instructions received at the same time.
- control instructions and reference control instructions in the embodiments of the present application may be instructions for actually controlling the controlled device to change the operating state, or instructions for configuring the controlled device. For example, if the content of the control instruction is to trigger device A to start, then the control instruction is the instruction that actually controls the controlled device to change the operating state, and if the content of the control instruction is that if device A starts, device B starts, then the control instruction It is the instruction to configure the controlled device.
- control instruction and the reference control instruction can both be instructions for actually controlling the controlled device to change the operating state, or one can be an instruction for actually controlling the controlled device to change the operating state, and the other is for configuring the controlled device. Instructions for the device.
- the electronic device can distinguish whether the control instruction is an instruction to actually control the controlled device to change the operating state or configure the controlled device through the identifier carried in the instruction.
- the method provided in this implementation can perform instruction processing more flexibly, and improve the flexibility and comprehensiveness of instruction processing. It should be noted that in the embodiment of the present application, if the control priority of the sender of the control instruction is the same as the control priority of the sender of the reference control instruction, both the control instruction and the reference control instruction will be executed by the electronic device.
- the instruction processing method After receiving a control instruction, it will first obtain the target device controlled by the control instruction and the sending user of the control instruction, and then obtain the reference control instruction, and then transfer the control instruction Perform conflict identification with the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priorities of the sending user and the user who sent the reference control instruction. If the control of the sending user is The priority is higher than the control priority of the user who sent the reference control instruction, and the control instruction is executed. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
- an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
- Step S210 After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction.
- Step S220 Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device.
- Step S230 If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user sending the reference control instruction.
- Step S240 If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction.
- Step S241 If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, obtain a reference user, the reference user being the latest execution of the electronic device in the historical cycle time.
- the control instruction has a sending user of a conflicting control instruction.
- Step S250 Compare the control priority of the sending user and the reference user.
- Step S260 If the control priority of the sending user is higher than the control priority of the user of the reference control instruction, execute the control instruction and discard the reference control instruction.
- Step S261 If the control priority of the sending user is lower than the control priority of the user of the reference control instruction, discard the control instruction.
- the reference user will be further determined.
- the control instruction sent by the user C is to control the start of the target device A
- the electronic device will search for the control instruction before the time T5 to find the last control instruction that controlled the target device A and was executed. It is understandable that the most recent one mentioned here refers to the one with the shortest time interval.
- the electronic device finds that user A has sent a control instruction to control target device A from time T4 to time T5, and the control instruction sent by user A conflicts with the control instruction sent by user C and is executed, then the electronic device The user A will be determined as the reference user.
- the reference user may not necessarily be the user in the previous cycle time, but may also be the user in the earlier cycle time.
- control instruction when a user sends a control command, he may control multiple target devices at the same time, or may control multiple functions of the same target device. Then in this manner, the control instruction includes multiple control parameters, and the reference control instruction includes multiple control parameters. Wherein, optionally, the control parameter characterizes the control of different target devices. Optionally, the multiple control parameters represent multiple functions for controlling the same target device. In the case that the control instruction includes multiple control parameters, for two different control instructions, there may be some conflicts in the control parameters, but some control parameters do not conflict.
- the step of identifying a conflict between the control command and the reference control command includes: identifying a conflict between a part of the control parameter of the control command and a part of the control parameter of the reference control command.
- the step of executing the control instruction includes: generating a new control instruction, and the new control instruction includes multiple control parameters in the control instruction and multiple control parameters in the reference control instruction.
- the control parameter in the control parameter that does not conflict with the control parameter in the received control instruction execute the new control instruction.
- the content of the control instruction is to control the air conditioner to turn off and control the windows to open 45 degrees.
- it can be determined that one control parameter of the control command is to control the air conditioner to turn off, and the other control parameter is to control the window to open 45 degrees.
- the reference control command is to control the air conditioner to close and control the window to open 90 degrees, then it can be determined that one control parameter of the control command is to control the air conditioner to close, and the other control parameter is to control the window to open 90 degrees.
- the electronic device will recognize that the control parameter in the control command and the reference control command to turn off the air conditioner does not conflict, and the control parameter in the control command to control the window to open 45 degrees is different from the control in the reference control command.
- the control parameter of window opening 90 degrees is in conflict.
- the electronic device compares that the control priority of the user who sends the control instruction is higher than the control priority of the user who sends the reference control instruction, the electronic device generates a control that includes two control parameters: controlling the air conditioner to turn off and controlling the window to open 45 degrees. Command, and discard the control parameter that controls the window to open 90 degrees.
- the instruction processing method provided by this application first obtains the target device controlled by the control instruction and the control instruction after receiving the control instruction and the unexecuted reference control instruction in the same time period.
- the sending user compares the control priority of the sending user with the user who sent the reference control instruction. If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute all The control instruction is described, and the reference control instruction is discarded. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
- an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
- Step S310 After receiving the control instruction, acquire the target device controlled by the control instruction and the sending user of the control instruction.
- Step S320 Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device.
- Step S330 If it is recognized that the control instruction conflicts with the reference control instruction, obtain the control priorities of the sending user and the user sending the reference control instruction in the current time period, wherein, in different priority modes Below, users in the user group have different control priorities.
- a user who has the control priority of each user who configures the user group can configure the control priority of each user to change according to a certain time period, so as to increase the flexibility of priority control.
- a 24-hour period can be configured.
- the control priority is reduced sequentially, and the control priority of user B, user C, user D, and user A is reduced in the second time period, and then in the third time period, user C, user D, user A, and user The control priority of B is successively lowered.
- Step S340 Compare the control priorities of the sending user and the user sending the reference control instruction.
- Step S350 If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction.
- Step S351 If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction.
- the control priority of each user can also be obtained through the current priority mode. It is understandable that when configuring the control priority of users in a user group, it can also be done based on different modes. For example, in the case where the user group includes user A, user B, user C, and user D, the first mode and the second mode can be configured, where in the first mode, user A, user B, user C, and user D In the second mode, the control priority of user B, user C, user D, and user A are sequentially reduced. In this way, users with control priority configuration can choose between the first mode and the second mode, and then can quickly configure the control priority of each user, instead of each user's control priority Level configuration.
- the step of comparing the control priorities of the sending user and the user sending the reference control instruction includes: acquiring the priority mode currently corresponding to the user group to which the sending user belongs, where In the different priority modes, the users in the user group have different control priorities; based on the priority mode, the control priorities of the sending user and the user sending the reference control instruction are compared.
- a plurality of cards 98 are displayed. Each card corresponds to a priority control mode, and a mode control switch 98 is correspondingly configured for control When that mode is enabled, each card is also configured with a progress bar 96 that characterizes the control priority of each user.
- the user with the highest control priority is the mother, and the user with the lowest control priority is the child user, and in the cards in the father mode, the user with the highest control priority is the dad, and the control priority is the lowest.
- the user is the child.
- the instruction processing method provided by the present application realizes through the above method that in the case that multiple users can control the same device, the conflict of instructions can be resolved based on the control priority of the user in the current time period. Improved equipment control efficiency.
- the current user control priority mode can also be used to resolve command conflicts, which improves the efficiency of device control.
- an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
- Step S410 After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction.
- Step S440 If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, obtain the priority of the first device linkage scenario triggered after the target device executes the control instruction. It can be understood that, in some cases, certain scenarios are more important, so based on this approach, the steps in this embodiment will always include subsequent scenario priority comparisons.
- the electronic device or other devices that can communicate with the electronic device store the linkage state of the device corresponding to the configured scene.
- the scene configured by the user is that after device A is started, device B is triggered to start; if device B is detected to start, device C is triggered to start.
- the stored device linkage scenario is that device A starts, which triggers device B to start and triggers device C to start, and for this scenario, the user can further configure the priority of a scenario.
- the target device controlled by the control instruction is the aforementioned device A, then when the triggering device A starts, the aforementioned configured scene will be triggered.
- Step S450 If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction.
- Step S460 Obtain the priority of the second device linkage scene triggered after the target device executes the reference control instruction.
- Step S470 If it is recognized that the priority of the first device linkage scenario is lower than the priority of the second device linkage scenario, detect whether the priority of the sending user meets a specified condition.
- the specified condition includes: the control priority of the sending user is the highest in the user group to which it belongs. It is understandable that the user with the highest priority can be identified as an administrator user, then the administrator user can perform arbitrary control or configuration on the bound device.
- Step S480 If the priority of the sending user meets the specified condition, execute the control instruction.
- Step S490 If the priority of the sending user does not meet the specified condition, send a prompt message to the terminal bound to the user who sent the reference control instruction, so as to prompt whether the user who sent the reference control instruction is authorized to execute the control instruction.
- Step S491 Determine whether the received information represents authorization to execute a control instruction. If authorization information indicating that the execution of the control instruction is permitted is received, the control instruction is executed.
- Step S492 If a message indicating that execution of the control instruction is not allowed is received, discard the control instruction.
- the instruction processing method after receiving a control instruction, it will first obtain the target device controlled by the control instruction and the sending user of the control instruction, and then obtain the reference control instruction, and then transfer the control instruction Perform conflict identification with the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priorities of the sending user and the user who sent the reference control instruction. If the control of the sending user is The priority is higher than the control priority of the user who sent the reference control instruction, and the priority of the scene triggered after the target device respectively executes the control instruction and the reference control instruction is further compared to determine whether to execute the control instruction.
- the solution is solved based on the user's control priority and the priority of the scene triggered after the target device executes the control instruction and refers to the control instruction.
- the conflict of commands improves the efficiency of equipment control.
- an instruction processing method provided by an embodiment of the present application is applied to a server, and the method includes:
- Step S510 After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction.
- Step S520 Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device.
- Step S530 If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user sending the reference control instruction.
- Step S531 If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction.
- Step S540 If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, identify whether the reference control instruction indicates a response end time, and the response end time is the target device Time to stop executing the function indicated by the reference control instruction.
- Step S550 If the end time of the indicated response is recognized, the length of time between the current time and the end of the indicated response is detected.
- Step S560 If it is recognized that the time length is less than the target time length, the control instruction is sent to the gateway to instruct the gateway to execute the control instruction after the response ends.
- Step S551 If it is recognized that there is no end time of the instruction response, discard the control instruction.
- the reference control instruction carries the control response end time as a control effect.
- the air conditioner A can be configured to start for 2 hours, then it can be clear that the response end time is 2 hours.
- the air conditioner A can be configured to keep starting from 11 o'clock to 12 o'clock by referring to the control command, then it can be clear that the response end time is 12 o'clock. Then when it is judged that the control command conflicts with the reference control command, if the control command is directly discarded, the user may need to resend the control command again.
- control instruction is sent to the gateway to instruct the gateway to execute the control instruction after the response end time, so that even if the control instruction is currently The executed control commands conflict and can be delayed to be executed to avoid the user from repeatedly sending commands.
- the instruction processing method provided by the present application realizes through the above method that in the case that multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user and the timeliness of the reference control instruction, and the improvement Improve equipment control efficiency.
- the current control instructions that cannot be executed immediately can be cached for subsequent execution, reducing the user's repeated operations.
- an instruction processing apparatus 600 provided by an embodiment of the present application runs on an electronic device, and the apparatus 600 includes:
- the instruction information acquiring unit 610 is configured to acquire the target device controlled by the control instruction and the sending user of the control instruction after receiving the control instruction.
- the reference information determining unit 620 is configured to obtain a reference control instruction received within the same cycle time as the control instruction, and the reference control instruction is sent by users other than the sending user in the user group to which the sending user belongs. For the control instructions used to control the target device, all users in the user group are bound to the target device.
- the priority comparison unit 630 is configured to compare the control priority of the sending user and the user who sent the reference control command if it is identified that the control command conflicts with the reference control command.
- the priority comparison unit 630 is configured to determine that the control instruction and the reference control instruction have different control effects on the same function of the target device if the control instruction and the reference control instruction have different control effects. conflict.
- the instruction processing unit 640 is configured to execute the control instruction if the control priority of the sending user is higher than the control priority of the user sending the reference control instruction.
- the reference control instruction is a control instruction that has been executed by the electronic device.
- the reference control instruction is a control instruction that has not yet been executed. In this manner, the instruction processing unit 640 is further configured to discard the reference control instruction if the control priority of the sending user is higher than the control priority of the user sending the reference control instruction.
- the device further includes a reference user acquiring unit 650, configured to acquire a reference user, and the reference user is the most recent execution of the electronic device in the historical cycle time and the control The sending user of the conflicting control command.
- the priority comparison unit 630 is also used to compare the control priority of the sending user and the reference user, if the control priority of the sending user is higher than the control priority of the reference control instruction user Level, execute the control instruction.
- the control instruction includes multiple control parameters
- the reference control instruction includes multiple control parameters.
- the instruction processing unit 640 is specifically configured to generate a new control instruction.
- the new control instruction includes a plurality of control parameters in the control instruction
- the reference control instruction includes a number of control parameters in the reference control instruction. Receiving a control parameter that does not conflict with the control parameter in the control instruction; execute the new control instruction.
- the multiple control parameters represent multiple functions that control the same target device.
- the control parameters characterize the control of different target devices.
- control instruction and the reference control instruction are received simultaneously.
- the priority comparison unit 630 is specifically configured to compare the control priorities of the sending user and the user sending the reference control instruction in the current time period, wherein, in different time periods, the The control priorities of users in the user group are different.
- the priority comparison unit 630 is specifically configured to obtain the current priority mode corresponding to the user group to which the sending user belongs, wherein, in different priority modes, the users in the user group control Priorities are different; based on the priority mode, the control priorities of the sending user and the user sending the reference control instruction are compared.
- the apparatus 600 further includes a scene acquiring unit 660, configured to acquire the priority of the first device linkage scene triggered after the target device executes the control instruction; The priority of the second device linkage scene triggered after the target device executes the reference control instruction.
- the priority comparison unit 630 is further configured to detect the priority of the sending user if it is recognized that the priority of the first device linkage scene is lower than the priority of the second device linkage scene Whether it meets the specified conditions.
- the specified condition includes: the control priority of the sending user is the highest in the user group to which it belongs.
- the instruction processing unit 640 is further configured to execute the control instruction if the priority of the sending user meets the specified condition, and discard the control instruction if the information indicating that the execution of the control instruction is not allowed is received.
- the electronic device is a server, and the target device communicates with the server through a gateway.
- the reference information determining unit 620 is further configured to, if the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, identify whether the reference control instruction indicates the end of the response
- the response end time is the time when the target device stops executing the function indicated by the reference control instruction. If the indicated response end time is recognized, the time between the current time and the indicated response end time is detected length.
- the instruction processing unit 640 is specifically configured to send the control instruction to the gateway if it is recognized that the time length is less than the target time length, and instruct the gateway to execute the control instruction after the response ends.
- an embodiment of the present application also provides another electronic device 200 that can execute the foregoing instruction processing method.
- the electronic device 200 includes one or more (only one is shown in the figure) a processor 102, a memory 104, and a network module 106 coupled to each other.
- the memory 104 stores a program that can execute the content in the foregoing embodiment, and the processor 102 can execute the program stored in the memory 104.
- the processor 102 may include one or more processing cores.
- the processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 200, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and calling data stored in the memory 104.
- the processor 102 may use at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
- DSP Digital Signal Processing
- FPGA Field-Programmable Gate Array
- PDA Programmable Logic Array
- the processor 102 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
- the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented by a communication chip alone.
- the memory 104 may include random access memory (RAM) or read-only memory (Read-Only Memory).
- the memory 104 may be used to store instructions, programs, codes, code sets or instruction sets.
- the memory 104 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions for implementing the following method embodiments, etc.
- the data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
- the network module 106 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, such as with audio playback devices.
- the network module 106 may include various existing circuit elements for performing these functions, for example, an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a subscriber identity module (SIM) card, a memory, etc. .
- SIM subscriber identity module
- the network module 106 can communicate with various networks such as the Internet, an intranet, and a wireless network, or communicate with other devices through a wireless network.
- the aforementioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network.
- the network module 106 can exchange information with the base station.
- the electronic device 200 shown in FIG. 17 may be the aforementioned server or gateway.
- the included processor 102 may be a microprocessor, and the included network module 106 may also include an interface for performing communication protocol conversion.
- FIG. 18 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
- the computer-readable medium 1100 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
- the computer-readable storage medium 1100 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
- the computer-readable storage medium 1100 includes a non-transitory computer-readable storage medium.
- the computer-readable storage medium 1100 has a storage space for executing the program code 810 of any method step in the foregoing method.
- These program codes can be read out from or written into one or more computer program products.
- the program code 1110 may be compressed in a suitable form, for example.
- the instruction processing method, device, electronic device, and storage medium provided by this application will first obtain the target device controlled by the control instruction and the sending user of the control instruction after receiving the control instruction, and then obtain Refer to the control instruction, and then identify the conflict between the control instruction and the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priority of the sending user and the user sending the reference control instruction If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Selective Calling Equipment (AREA)
Abstract
Disclosed are an instruction processing method and apparatus, an electronic device and a storage medium. The method comprises: after receiving a control instruction, acquiring a target device controlled by means of the control instruction and a sending user of the control instruction; acquiring a reference control instruction received within the same cycle time as the control instruction, wherein the reference control instruction is a control instruction, sent by a user other than the sending user, in a user group to which the sending user belongs, and is used for controlling the target device; if it is identified that the control instruction is in conflict with the reference control instruction, comparing the control priorities of the sending user and the user who sends the reference control instruction; and if the control priority of the sending user is higher than that of the user who sends the reference control instruction, executing the control instruction. By means of the method, where the same device can be controlled by a plurality of users, the conflict of instructions is solved on the basis of the control priorities of users, thereby improving the device control efficiency.
Description
本申请涉及物联网领域,更具体地,涉及一种指令处理方法、装置、电子设备以及存储介质。This application relates to the field of Internet of Things, and more specifically, to an instruction processing method, device, electronic device, and storage medium.
随着互联网技术的普及以及物联网概念的发展,人们开始尝试通过远程控制系统来对电气设备进行管理和控制,使电气设备的控制便于操作,从而大大方便人们的日常生活。然而,当某个电子设备或者某个场景可以由多个用户进行控制的情况下,控制效果还有待提升。With the popularization of Internet technology and the development of the concept of Internet of Things, people have begun to try to manage and control electrical equipment through remote control systems to make the control of electrical equipment easy to operate, which greatly facilitates people's daily life. However, when a certain electronic device or a certain scene can be controlled by multiple users, the control effect needs to be improved.
发明内容Summary of the invention
鉴于上述问题,本申请提出了一种指令处理方法、装置、电子设备以及存储介质,以改善上述问题。In view of the foregoing problems, this application proposes an instruction processing method, device, electronic equipment, and storage medium to improve the foregoing problems.
第一方面,本申请提供了一种指令处理方法,应用于电子设备,所述方法包括:当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户;获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备;若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级;若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。In the first aspect, this application provides an instruction processing method applied to an electronic device. The method includes: after receiving a control instruction, acquiring a target device controlled by the control instruction and a user who sends the control instruction; Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is a control command sent by a user other than the sending user in the user group to which the sending user belongs to control the target device Control instruction, the users in the user group are all bound to the target device; if it is identified that the control instruction conflicts with the reference control instruction, compare the control of the sending user and the user who sent the reference control instruction Priority; if the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction.
第二方面,本申请提供了一种指令处理装置,运行于电子设备,所述装置包括:指令信息获取单元,用于当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户;参考信息确定单元,用于获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备;In a second aspect, the present application provides an instruction processing device that runs on an electronic device. The device includes: an instruction information acquisition unit, configured to acquire the target device controlled by the control instruction and the target device controlled by the control instruction after receiving the control instruction. The sending user of the control instruction; the reference information determining unit is used to obtain the reference control instruction received within the same cycle time as the control instruction, and the reference control instruction is the user group to which the sending user belongs except the Sending a control instruction for controlling the target device sent by a user other than the user, and all users in the user group are bound to the target device;
优先级比对单元,用于若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级;指令处理单元,用于若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。The priority comparison unit is configured to compare the control priority of the sending user and the user who sent the reference control instruction if the control instruction conflicts with the reference control instruction; the instruction processing unit is configured to: The control priority of the sending user is higher than the control priority of the user sending the reference control instruction, and the control instruction is executed.
第三方面,本申请提供了一种电子设备,包括一个或多个处理器以及存储器;一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行上述的方法。In a third aspect, this application provides an electronic device including one or more processors and a memory; one or more programs, wherein the one or more programs are stored in the memory and configured to be The one or more processors execute the above-mentioned methods.
第四方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码运行时执行上述的方法,并且也可以避免控制混乱。In a fourth aspect, the present application provides a computer-readable storage medium having program code stored in the computer-readable storage medium, wherein the above-mentioned method is executed when the program code is running, and control confusion can also be avoided.
本申请提供的一种指令处理方法、装置、电子设备以及存储介质,在当接收到控制 指令后,会先获取所述控制指令所控制的目标设备以及所述控制指令的发送用户,然后再获取参考控制指令,进而将控制指令与参考控制指令进行冲突识别,若识别所述控制指令与所述参考控制指令冲突,再比对所述发送用户与发送所述参考控制指令的用户的控制优先级,若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。从而通过上述方式实现了在多个用户都可以对同一个设备进行控制的情况下,基于用户的控制优先级的方式来解决指令的冲突,提升了设备控制效率。The instruction processing method, device, electronic device, and storage medium provided by this application will first obtain the target device controlled by the control instruction and the sending user of the control instruction after receiving the control instruction, and then obtain Refer to the control instruction, and then identify the conflict between the control instruction and the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priority of the sending user and the user sending the reference control instruction If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
图1示出了本申请实施例提出的一种物联网的架构示意图;FIG. 1 shows a schematic diagram of the architecture of the Internet of Things proposed in an embodiment of the present application;
图2示出了本申请实施例提出的另一种物联网的架构示意图;FIG. 2 shows a schematic diagram of another architecture of the Internet of Things proposed in an embodiment of the present application;
图3示出了本申请实施例提出的再一种物联网的架构示意图;FIG. 3 shows a schematic diagram of yet another architecture of the Internet of Things proposed by an embodiment of the present application;
图4示出了本申请实施例提出的一种客户端与服务器通信方式的示意图;FIG. 4 shows a schematic diagram of a communication mode between a client and a server proposed in an embodiment of the present application;
图5示出了本申请实施例提出的指令处理方法运行环境示意图;FIG. 5 shows a schematic diagram of the operating environment of the instruction processing method proposed in an embodiment of the present application;
图6示出了本申请实施例提出的指令处理方法中一种周期时间的示意图;FIG. 6 shows a schematic diagram of a cycle time in the instruction processing method proposed by the embodiment of the present application;
图7示出了本申请实施例提出的指令处理方法中另一种周期时间的示意图;FIG. 7 shows a schematic diagram of another cycle time in the instruction processing method proposed by the embodiment of the present application;
图8示出了本申请另一实施例提出的一种指令处理方法的流程图;FIG. 8 shows a flowchart of an instruction processing method proposed by another embodiment of the present application;
图9示出了本申请实施例提出的指令处理方法中确定参考用户的示意图;FIG. 9 shows a schematic diagram of determining a reference user in the instruction processing method proposed by an embodiment of the present application;
图10示出了本申请再一实施例提出的一种指令处理方法的流程图;FIG. 10 shows a flowchart of an instruction processing method proposed by still another embodiment of the present application;
图11示出了本申请再一实施例提出的一种指令处理方法中优先级模式配置的示意图;FIG. 11 shows a schematic diagram of a priority mode configuration in an instruction processing method proposed by still another embodiment of the present application;
图12示出了本申请又一实施例提出的一种指令处理方法的流程图;FIG. 12 shows a flowchart of an instruction processing method proposed by another embodiment of the present application;
图13示出了本申请又一实施例提出的一种指令处理方法的流程图;FIG. 13 shows a flowchart of an instruction processing method proposed by another embodiment of the present application;
图14示出了本申请实施例提出的一种指令处理装置的结构框图;FIG. 14 shows a structural block diagram of an instruction processing device proposed by an embodiment of the present application;
图15示出了本申请另一实施例提出的一种指令处理装置的结构框图;FIG. 15 shows a structural block diagram of an instruction processing device proposed by another embodiment of the present application;
图16示出了本申请再一实施例提出的一种指令处理装置的结构框图;FIG. 16 shows a structural block diagram of an instruction processing device proposed by another embodiment of the present application;
图17示出了本申请的用于执行根据本申请实施例的指令处理方法的电子设备的结构框图;FIG. 17 shows a structural block diagram of an electronic device of the present application for executing the instruction processing method according to an embodiment of the present application;
图18是本申请实施例的用于保存或者携带实现根据本申请实施例的设备控制方法的程序代码的存储单元。Fig. 18 is a storage unit for storing or carrying program codes for implementing the device control method according to the embodiment of the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions 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 a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of this application.
物联网是在“互联网概念”的基础上,将其用户端延伸和扩展到任何物品与物品之间,进行信息交换和通信的一种网络概念。随着物联网技术的发展,在物联网系统中可以配置一些场景。对于配置的场景,可以涉及到多个受控设备,而且多个受控设备之间具有一定的联动关系,能够协同工作。The Internet of Things is a network concept that extends and expands its user end to any item and item for information exchange and communication based on the "Internet concept". With the development of IoT technology, some scenarios can be configured in the IoT system. For the configuration scenario, multiple controlled devices may be involved, and multiple controlled devices have a certain linkage relationship and can work together.
其中,受控设备可以为投影仪、投屏幕、智能灯、智能插座、人体传感器、门窗传 感器、无线开关、空调伴侣、烟雾报警器、智能窗帘电机、以及空气净化器、智能音箱等电子设备。在一种方式中,如图1所示,起控制作用的控制终端100可以通过直接与路由器90建立无线连接的方式实现与受控设备99之间进行数据交互。再者,控制终端100也可以通过与云端91建立连接后,通过云端91与路由器90之间的数据链路实现与受控设备99之间的数据交互。Among them, the controlled devices can be projectors, projection screens, smart lights, smart sockets, human sensors, door and window sensors, wireless switches, air conditioners, smoke alarms, smart curtain motors, and electronic devices such as air purifiers and smart speakers. In one manner, as shown in FIG. 1, the control terminal 100 that plays a control role can realize data interaction with the controlled device 99 by directly establishing a wireless connection with the router 90. Furthermore, the control terminal 100 can also realize data interaction with the controlled device 99 through the data link between the cloud 91 and the router 90 after establishing a connection with the cloud 91.
作为另外一种方式,如图2所示,控制终端100直接建立与第一云91a之间的数据交互,而再基于第一云91a与第二云91b之间的数据交互,实现控制终端100与第二云91b之间的数据交互,然后再第二云91b可以与受控设备99进行数据交互的情况下,控制终端100进而实现与受控设备99之间的数据交互。As another way, as shown in FIG. 2, the control terminal 100 directly establishes data interaction with the first cloud 91a, and then realizes the control terminal 100 based on the data interaction between the first cloud 91a and the second cloud 91b. Data interaction with the second cloud 91b, and then under the condition that the second cloud 91b can perform data interaction with the controlled device 99, the control terminal 100 further realizes the data interaction with the controlled device 99.
作为再一种方式,如图3所示,受控设备99可以通过网关98与路由器90建立无线连接。其中,数据交互可以包括控制终端100向受控设备发送控制指令,还可以包括受控设备向控制终端100返回状态信息或者返回指令执行结果等。其中,控制终端100与受控设备之间的数据交互可以由控制终端100中安装的客户端来触发。As another way, as shown in FIG. 3, the controlled device 99 may establish a wireless connection with the router 90 through the gateway 98. The data interaction may include the control terminal 100 sending a control instruction to the controlled device, and may also include the controlled device returning status information to the control terminal 100 or returning the instruction execution result. The data interaction between the control terminal 100 and the controlled device may be triggered by a client installed in the control terminal 100.
为了便于进行数据的交互,各个厂商都会各自开发自己的SDK插件以便控制终端100中的客户端调用。当客户端加载厂商的SDK插件以后,便可以调用所加载的SDK插件,进而通过该SDK插件与厂商的服务器之间进行数据交互。例如,如图4所示,在图4所示的客户端110中加载有厂商A的SDK插件111以及厂商B的SDK插件112,其中客户端110可以通过调用厂商A的SDK插件来与厂商A的服务器210进行数据交互,而客户端110可以通过调用厂商B的SDK插件来与厂商B的服务器220进行数据交互。In order to facilitate data interaction, each manufacturer will develop its own SDK plug-in so as to control client calls in the terminal 100. After the client loads the manufacturer's SDK plug-in, it can call the loaded SDK plug-in, and then interact with the manufacturer's server through the SDK plug-in. For example, as shown in FIG. 4, the client 110 shown in FIG. 4 is loaded with the SDK plug-in 111 of manufacturer A and the SDK plug-in 112 of manufacturer B. The client 110 can communicate with manufacturer A by calling the SDK plug-in of manufacturer A. The server 210 of manufacturer B performs data interaction, and the client 110 can interact with the server 220 of manufacturer B by calling the SDK plug-in of manufacturer B.
而随着物理网场景的丰富,在物联网场景中的控制方式也越来越丰富。例如,多个用户可以同时绑定同一个受控设备,进而可以实现多个用户可以对同一个设备进行控制或者对同一个设备进行配置。但是,发明人在研究中发现,在相关的指令处理方式中,进行控制指令转发的电子设备(例如,云端91中的服务器或者网关98),都是按照接收到指令的前后顺序执行的,而即使是对于同一时间接收到的控制指令,也都会执行。但是,发明人同时也发现,绑定同一个受控设备的多个用户,在对该同一个设备进行控制时所触发的控制指令可能会相互冲突,然而进行控制指令转发的电子设备对于这些相互冲突的控制指令都会执行,进而会造成在前被转发的控制指令的控制效果被在后转发的控制指令的效果覆盖,造成资源浪费。并且,若多个用户同时都可以对同一个设备进行控制,还会造成控制的混乱。With the enrichment of physical network scenarios, the control methods in IoT scenarios are becoming more and more abundant. For example, multiple users can be bound to the same controlled device at the same time, so that multiple users can control or configure the same device. However, the inventor found in the research that in the related instruction processing method, the electronic device that forwards the control instruction (for example, the server or the gateway 98 in the cloud 91) is executed in the order before and after the instruction is received. Even the control commands received at the same time will be executed. However, the inventor also discovered that the control commands triggered by multiple users bound to the same controlled device may conflict with each other when controlling the same device. However, the electronic device that forwards the control command may conflict with each other. Conflicting control instructions will be executed, which will cause the control effect of the control instruction that was forwarded before to be overwritten by the effect of the control instruction that is forwarded later, resulting in waste of resources. Moreover, if multiple users can control the same device at the same time, it will cause confusion in control.
因此,发明人提出了本申请中可以改善上述问题的指令处理方法、装置、电子设备以及存储介质。Therefore, the inventor proposes an instruction processing method, device, electronic device, and storage medium that can improve the above-mentioned problems in this application.
下面将结合附图具体描述本申请的各实施例。The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
请参阅图5,本申请实施例提供的一种指令处理方法,应用于电子设备,所述方法包括:Referring to FIG. 5, an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
步骤S110:当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户。可以理解的是,电子设备为用户所操作的控制终端与受控设备之间的中间设备。当电子设备接收到控制终端发送的控制指令后,可以将接收到的控制指令再转发到目标设备,而这里的目标设备是指用户期望控制或者配置的受控设备。那么为了便于电子设备识别所接收到的控制指令是由哪一个用户发送的,以及这个用户期望控制的是哪一个设备,在用户操作的控制终端发送的控制指令中会携带有关于发送用户的信息以及所控制的目标设备的信息,进而使得电子设备可以获取到控制指令所控制的目标设备以及所述控制指令的发送用户。作为一种方式,控制终端在向目标设备发送控制指令的过程中,可以基于与电子设备之间所协商好的编码规则对关于发送用户的信息以及所控制的目标设备的信息进行编码以生成控制指令,那么当电子设备接收到控制指令后,就可以按照协商的编码规则所对应的解码规定进行解码,进而获取到控制指令中携带的目标设备以及所述控制指令的发送用户。其中,可选的,控制指令中所携带的关于发送用户的信息可以为用户的帐号,而关于所控制的目标设备的信息可以为所要控制设备的唯一性标识。Step S110: After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction. It can be understood that the electronic device is an intermediate device between the control terminal and the controlled device operated by the user. After the electronic device receives the control instruction sent by the control terminal, it can forward the received control instruction to the target device, and the target device here refers to the controlled device that the user desires to control or configure. So in order for the electronic device to identify which user sent the received control instruction and which device the user expects to control, the control instruction sent by the control terminal operated by the user will carry information about the sending user. And the information of the controlled target device, so that the electronic device can obtain the target device controlled by the control instruction and the sending user of the control instruction. As a way, in the process of sending the control instruction to the target device, the control terminal can encode the information about the sending user and the information of the target device under control based on the coding rule negotiated with the electronic device to generate control Instruction, when the electronic device receives the control instruction, it can decode according to the decoding regulations corresponding to the negotiated encoding rule, and then obtain the target device carried in the control instruction and the user who sent the control instruction. Optionally, the information about the sending user carried in the control instruction may be the user's account, and the information about the controlled target device may be the unique identifier of the device to be controlled.
步骤S120:获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备。其中,周期时间可以理解为智能家居场景的工作周期,也可以理解为集中对接收到的还未执行的控制指令进行处理的时间周期。对于智能家居场景的工作周期,需要说明的是,用户在进行智能家居场景配置时,可以给所配置的场景配置一个工作周期,在所配置的一个工作周期内,电子设备会对某一个设备的所有控制指令的发送用户的控制优先级进行比对,仅允许控制优先级高的用户对目标设备进行控制,或者允许控制优先级更高的用户所发送的控制指令去覆盖控制优先级较低的用户所发送的控制指令,但是不允许控制优先级较低的用户所发送的控制指令去覆盖控制优先级较高的用户所发送的控制指令,而其中的工作周期的长度可以由用户自己设定,也可以由电子设备根据用户所配置的场景进行自动适配。Step S120: Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device. Among them, the cycle time can be understood as the work cycle of the smart home scenario, and can also be understood as the time period for intensively processing the received control commands that have not yet been executed. Regarding the working cycle of the smart home scene, it should be noted that when the user configures the smart home scene, he can configure a working cycle for the configured scene. During the configured working cycle, the electronic device will Compare the control priority of the sending user of all control commands, and only allow users with higher control priority to control the target device, or allow control commands sent by users with higher control priority to override those with lower control priority The control instructions sent by the user, but the control instructions sent by the user with lower control priority are not allowed to overwrite the control instructions sent by the user with higher control priority, and the length of the working cycle can be set by the user. , The electronic device can also automatically adapt according to the scene configured by the user.
作为一种方式,电子设备中可以预先建立一个设备分类库,在该分类库中对于各种设备适配的工作周期进行预先设定,进而电子设备可以识别每种设备对应的工作周期。例如,对于空调、电视机、音箱等可能不会一直长时间运行的电器设备可以配置12小时或者24小时的工作周期。而对于传感器或者摄像头等会长时间运行的电器设备可以配置一个月甚至更长的周期。再者,其中的用户组表征可以对相同的设备进行控制的用户,而用户组中的每个用户的控制优先级可以由用户组中的具有特殊权限的用户尽心配置。例如,可以由管理员用户进行配置,或者由组建用户组的用户进行配置。其中,组建用户组的方式可以有多种。作为一种方式,可以由某一个用户通过所绑定的控制终端向电子设备发送用户组组建指令,电子设备在接收到该组件指令后,会先查找该发起用户所绑定的受控设备,然后将绑定有相同受控设备的用户划分到同一个用户组,并默认将发起用户配置为管理员用户,以便该发起用户可以进行控制优先级进行配置。例如,该发起用户绑定有受控设备A、受控设备B以及受控设备C,那么电子设备在查询到有其他用户A也绑定有受控设备B以及受控设备C,而其他用户B绑定有受控设备A,那么电子设备就会将发起用户与用户A分配为一个用户组,而将发起用户与用户B再分配一个用户组。通过上述方式,可以建立较为完备的用户组。As a way, a device classification library can be pre-established in the electronic device, and the working cycles for various device adaptations are preset in the classification library, so that the electronic device can identify the working cycle corresponding to each device. For example, electrical appliances such as air conditioners, televisions, speakers, etc. that may not run for a long time can be configured with a 12-hour or 24-hour work cycle. For electrical equipment such as sensors or cameras that will run for a long time, a period of one month or even longer can be configured. Furthermore, the user group therein represents users who can control the same device, and the control priority of each user in the user group can be configured by users with special permissions in the user group. For example, it can be configured by an administrator user, or configured by a user who forms a user group. Among them, there are many ways to form a user group. As a way, a user can send a user group formation instruction to the electronic device through the bound control terminal. After receiving the component instruction, the electronic device will first search for the controlled device bound to the initiating user. Then divide the users bound with the same controlled device into the same user group, and configure the initiating user as an administrator user by default, so that the initiating user can configure the control priority. For example, if the initiating user is bound to controlled device A, controlled device B, and controlled device C, then the electronic device inquires that other user A is also bound to controlled device B and controlled device C, and other users B is bound to controlled device A, then the electronic device will allocate the initiating user and user A as a user group, and then allocate the initiating user and user B to another user group. Through the above method, a relatively complete user group can be established.
作为另外一种方式,控制终端可以直接基于局域网通信的方式对受控设备进行控制,在这种方式下,控制终端发送的控制指令可以直接通过网关发送到受控设备而不用再基于云服务器转发。那么基于这种控制方式,电子设备在接收到发起用户发送的用户组组建指令后,可以直接将处于同一个局域网的用户配置为一个用户组,或者直接将与发起用户所绑定的受控设备处于同一个局域网的用户配置为一个用户组,以便可以快速的进行用户组的建立。其中,电子设备可以通过多种方式来识别处于同一个局域网内的用户,例如,可以识别该多个用户所绑定的控制终端与服务器之间通信时均采用相同的公网IP,那么就可以判定该多个用户处于同一个局域网内。再者,电子设备还可以通过判断用户控制终端的IP地址和子网掩码是否均相同来判断,多个控制终端是否处于同一个局域网内。可以理解的是,判断受控设备与控制终端是否在同一个局域网内也可以采用上述方式,而判断多个受控设备是否处于同一个局域网内依然可以采用上述方式。As another way, the control terminal can directly control the controlled device based on LAN communication. In this way, the control command sent by the control terminal can be directly sent to the controlled device through the gateway instead of forwarding based on the cloud server. . Then based on this control method, after receiving the user group formation instruction sent by the initiating user, the electronic device can directly configure users in the same local area network as a user group, or directly configure the controlled device bound to the initiating user Users in the same local area network are configured as a user group so that the user group can be established quickly. Among them, the electronic device can identify users in the same local area network in multiple ways. For example, it can identify that the control terminal bound to the multiple users uses the same public network IP when communicating with the server. It is determined that the multiple users are in the same local area network. Furthermore, the electronic device can also determine whether the IP address and the subnet mask of the user control terminal are the same to determine whether multiple control terminals are in the same local area network. It is understandable that the above method can also be used to determine whether the controlled device and the controlling terminal are in the same local area network, and the above method can still be used to determine whether multiple controlled devices are in the same local area network.
步骤S130:若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。Step S130: If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user sending the reference control instruction.
在本申请实施例中,电子设备可以通过多种方式来确定两个或者多个控制指令是否冲突。作为一种方式,可以通过对于同一个控制功能的控制效果来进行判断。在这种方式下,若识别所述控制指令与所述参考控制指令对所述目标设备的同一功能的控制效果不同,判定控制指令与所述参考控制指令冲突。例如,控制指令是控制智能音箱A将音量调节为30,而参考控制指令同样是对智能音箱的音量进行控制,但是,是将智能音箱A音量调节为25,那么电子设备在识别到25与30不同后就会判定控制指令与所述参考控制指令冲突。此外,若电子设备检测到控制指令是控制空调A调节制冷温度为25度,而识别到参考控制指令是调节空调A的制冷温度为16度,那么电子设备在识别到25与16不同后就会判定控制指令 与所述参考控制指令冲突。而作为另外一种方式,电子设备可以通过对设备的控制模式来进行判断。在这种方式下,若识别到所述控制指令与所述参考控制指令控制所述目标设备切换到不同的工作模式,判定控制指令与所述参考控制指令冲突。例如,电子设备识别到控制指令是控制扫地机器人A切换到扫地模式,而参考控制指令是控制控制扫地机器人A切换到充电模式,那么电子设备就会判定控制指令与所述参考控制指令冲突。此外,作为再一种方式,若电子设备接收到的控制指令中携带有控制的生效时间或者控制结束时间的情况下,在识别到控制指令与参考控制指令中的生效时间或者控制结束时间不同的情况下,判定控制指令与所述参考控制指令冲突。例如,若电子设备接收到的控制指令的生效时间为11点,而参考控制指令的生效时间为12点,那么电子设备识别11点和12点不同的情况下,判定控制指令与所述参考控制指令冲突。In the embodiment of the present application, the electronic device may determine whether two or more control commands conflict in various ways. As a way, it can be judged by the control effect of the same control function. In this manner, if it is recognized that the control instruction and the reference control instruction have different control effects on the same function of the target device, it is determined that the control instruction conflicts with the reference control instruction. For example, the control command is to control smart speaker A to adjust the volume to 30, and the reference control command is also to control the volume of smart speaker, but it is to adjust the volume of smart speaker A to 25, then the electronic device recognizes 25 and 30 After different, it is determined that the control command conflicts with the reference control command. In addition, if the electronic device detects that the control instruction is to control the air conditioner A to adjust the cooling temperature to 25 degrees, and it recognizes that the reference control instruction is to adjust the cooling temperature of the air conditioner A to 16 degrees, then the electronic device will recognize that 25 is different from 16 It is determined that the control instruction conflicts with the reference control instruction. As another way, the electronic device can judge the control mode of the device. In this manner, if it is recognized that the control instruction and the reference control instruction control the target device to switch to different operating modes, it is determined that the control instruction conflicts with the reference control instruction. For example, if the electronic device recognizes that the control instruction is to control the cleaning robot A to switch to the sweeping mode, and the reference control instruction is to control the cleaning robot A to switch to the charging mode, the electronic device will determine that the control instruction conflicts with the reference control instruction. In addition, as yet another way, if the control command received by the electronic device carries the control effective time or control end time, it is recognized that the control command is different from the effective time or control end time in the reference control command. In this case, it is determined that the control instruction conflicts with the reference control instruction. For example, if the effective time of the control instruction received by the electronic device is 11 o'clock, and the effective time of the reference control instruction is 12 o'clock, then the electronic device recognizes that 11 o'clock and 12 o'clock are different, determine that the control instruction is different from the reference control Command conflict.
步骤S140:若所述发送用户的控制优先级低于发送所述参考控制指令的用户的控制优先级,丢弃所述控制指令。步骤S141:若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。可以理解的是,本实施例中电子设备所接收到的控制指令和参考控制指令是处于同一个周期时间内的,而本实施例中的周期时间会有不同的意义,下面将分别针对每种周期时间进行实施例方案的介绍。Step S140: If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction. Step S141: If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. It can be understood that the control command and the reference control command received by the electronic device in this embodiment are within the same cycle time, and the cycle time in this embodiment has different meanings. The cycle time carries on the introduction of the embodiment scheme.
在周期时间可以理解为智能家居场景的工作周期这种情况下,如图6所示,T1时刻到T2时刻为一个工作周期,T2时刻到T3时刻为另外一个工作周期,在T1时刻到T2时刻这个工作周期中,用户A首先在T1+n这个时刻发送了一个控制空调A(本示例中的目标设备)开启制冷模式的控制指令,电子设备在接收到用户A发送的控制指令后,会发现在T1到T2这个周期时间内还没有参考控制指令,那么电子设备会直接执行用户A发送的控制指令。In this case, the cycle time can be understood as the working cycle of the smart home scene, as shown in Figure 6, time T1 to time T2 is a working cycle, time T2 to time T3 is another working cycle, from time T1 to time T2 In this work cycle, user A first sends a control command to control air conditioner A (the target device in this example) to turn on the cooling mode at T1+n. The electronic device will find that after receiving the control command sent by user A In the cycle time from T1 to T2, there is no reference control instruction, then the electronic device will directly execute the control instruction sent by user A.
而在T1+3n时刻用户B也发送了一个控制空调A开启除湿模式的控制指令,而电子设备在接收待用户B发送的控制指令后,开始获取参考控制指令,即会将前述用户A发送的控制空调A的控制指令作为参考控制指令,进而再开始比对用户B与用户A的控制优先级,若比对发现用户B的控制优先级低于用户A的控制优先级,那么电子设备就会丢弃掉用户B发送的控制指令,但是若发现用户B的控制优先级高于用户A的控制优先级,那么电子设备就会执行用户B发送的控制指令,进而将空调A切换为除湿模式。At T1+3n, user B also sent a control command to control air conditioner A to turn on the dehumidification mode. After receiving the control command to be sent by user B, the electronic device began to obtain the reference control command. The control command for controlling the air conditioner A is used as a reference control command, and then the control priority of user B and user A is compared. If the comparison finds that the control priority of user B is lower than the control priority of user A, then the electronic device will The control command sent by user B is discarded, but if it is found that the control priority of user B is higher than the control priority of user A, the electronic device will execute the control command sent by user B, and then switch the air conditioner A to dehumidification mode.
在发现用户B的控制优先级低于用户A的控制优先级的这种情况下,若用户B在T2到T3这个周期时间内的T2+n时刻又发送控制空调A的控制指令,且依然是控制空调A进入到除湿模式,那么在进入这个周期时间后,因为还没有其他用户发送过控制指令,那么就还未有这个周期时间内的参考控制指令,进而电子设备会直接只执行用户B在T2+n时刻发送的控制指令,进而将空调A切换为除湿模式。When it is found that the control priority of user B is lower than the control priority of user A, if user B sends a control command to control air conditioner A at time T2+n during the period from T2 to T3, and it is still Control the air conditioner A to enter the dehumidification mode, then after entering this cycle time, because no other user has sent a control command, then there is no reference control command within this cycle time, and the electronic device will directly execute only the user B’s The control command sent at time T2+n then switches the air conditioner A to the dehumidification mode.
另外,在周期时间为集中对接收到的还未执行的控制指令进行处理的这种情况下,如图7所示,T4时刻到T5时刻为一个周期时间,而T5时刻到T6时刻为另一个周期时间。可以理解的是,在这种方式下,均是对还未执行的控制指令进行处理,为了保证指令处理的实时性,每个周期时间的长度会相对较短,例如,为1秒或者0.5秒,甚至为0.1秒。In addition, in the case where the cycle time is focused on processing the received control commands that have not been executed, as shown in Figure 7, time T4 to time T5 is one cycle time, and time T5 to time T6 is another period time. It is understandable that in this way, control instructions that have not been executed are processed. In order to ensure the real-time nature of instruction processing, the length of each cycle time will be relatively short, for example, 1 second or 0.5 seconds , Even 0.1 seconds.
在这种方式下,电子设备会将每个周期时间内的接收到的在后的控制同一个目标设备的控制指令作为参考控制指令,电子设备会将同一周期时间内的控制指令和参考控制指令进行发送用户的控制优先级进行比对,而会执行控制优先级更高的用户所发送的控制指令,将控制优先级更低的用户所发送的参考控制指令进行丢弃。例如,若用户A在T4+n时刻发送有控制智能音箱A的控制指令,而用户B在T4+3n时刻发送有控制智能音箱A的参考控制指令,那么电子设备在判定用户A的控制优先级高于用户B的控制优先级的情况下,电子设备会执行用户A发送的控制指令,而丢弃用户B发送的参考控制指令。In this way, the electronic device will receive the subsequent control commands that control the same target device in each cycle time as the reference control command, and the electronic device will take the control command and reference control command within the same cycle time The control priority of the sending user is compared, and the control command sent by the user with higher control priority is executed, and the reference control command sent by the user with lower control priority is discarded. For example, if user A sends a control command to control smart speaker A at time T4+n, and user B sends a reference control command to control smart speaker A at time T4+3n, then the electronic device is determining the control priority of user A If the control priority is higher than that of user B, the electronic device will execute the control instruction sent by user A, and discard the reference control instruction sent by user B.
需要说明的是,所述控制指令与所述参考控制指令可能为同时接收到的控制指令。再者,本申请实施例中的控制指令以及参考控制指令可以是实际控制受控设备改变运行状态的指令,也可以是配置受控设备的指令。例如,若控制指令的内容为触发设备A启动,那么该控制指令就是实际控制受控设备改变运行状态的指令,而若控制指令的内容 为若设备A启动,设备B就启动,那么该控制指令就是配置受控设备的指令。It should be noted that the control instruction and the reference control instruction may be control instructions received at the same time. Furthermore, the control instructions and reference control instructions in the embodiments of the present application may be instructions for actually controlling the controlled device to change the operating state, or instructions for configuring the controlled device. For example, if the content of the control instruction is to trigger device A to start, then the control instruction is the instruction that actually controls the controlled device to change the operating state, and if the content of the control instruction is that if device A starts, device B starts, then the control instruction It is the instruction to configure the controlled device.
那么在本申请实施例中,控制指令和参考控制指令可以均为实际控制受控设备改变运行状态的指令,也可以一个为实际控制受控设备改变运行状态的指令,而另一个为配置受控设备的指令。那么在这种方式下,电子设备在接收到控制指令后,可以通过指令中所携带的标识符来区分控制指令是属于实际控制受控设备改变运行状态的指令,还是配置受控设备的指令。通过上述方式可以使得本实施中所提供的方法可以更加灵活的进行指令处理,提升指令处理的灵活性以及全面性。需要说明的是,在本申请实施例中,若控制指令的发送用户的控制优先级与参考控制指令的发送用户的控制优先级相同,控制指令和参考控制指令都会被电子设备执行。Then in the embodiment of the present application, the control instruction and the reference control instruction can both be instructions for actually controlling the controlled device to change the operating state, or one can be an instruction for actually controlling the controlled device to change the operating state, and the other is for configuring the controlled device. Instructions for the device. In this way, after receiving the control instruction, the electronic device can distinguish whether the control instruction is an instruction to actually control the controlled device to change the operating state or configure the controlled device through the identifier carried in the instruction. Through the above method, the method provided in this implementation can perform instruction processing more flexibly, and improve the flexibility and comprehensiveness of instruction processing. It should be noted that in the embodiment of the present application, if the control priority of the sender of the control instruction is the same as the control priority of the sender of the reference control instruction, both the control instruction and the reference control instruction will be executed by the electronic device.
本申请提供的一种指令处理方法,在当接收到控制指令后,会先获取所述控制指令所控制的目标设备以及所述控制指令的发送用户,然后再获取参考控制指令,进而将控制指令与参考控制指令进行冲突识别,若识别所述控制指令与所述参考控制指令冲突,再比对所述发送用户与发送所述参考控制指令的用户的控制优先级,若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。从而通过上述方式实现了在多个用户都可以对同一个设备进行控制的情况下,基于用户的控制优先级的方式来解决指令的冲突,提升了设备控制效率。In the instruction processing method provided by the present application, after receiving a control instruction, it will first obtain the target device controlled by the control instruction and the sending user of the control instruction, and then obtain the reference control instruction, and then transfer the control instruction Perform conflict identification with the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priorities of the sending user and the user who sent the reference control instruction. If the control of the sending user is The priority is higher than the control priority of the user who sent the reference control instruction, and the control instruction is executed. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
请参阅图8,本申请实施例提供的一种指令处理方法,应用于电子设备,所述方法包括:Referring to FIG. 8, an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
步骤S210:当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户。Step S210: After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction.
步骤S220:获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备。步骤S230:若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。步骤S240:若所述发送用户的控制优先级低于发送所述参考控制指令的用户的控制优先级,丢弃所述控制指令。步骤S241:若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,获取参考用户,所述参考用户为所述电子设备在历史周期时间中最近一次执行的与所述控制指令有冲突的控制指令的发送用户。步骤S250:比对所述发送用户与参考用户的控制优先级。步骤S260:若所述发送用户的控制优先级高于所述参考控制指令的用户的控制优先级,执行所述控制指令并丢弃所述参考控制指令。步骤S261:若所述发送用户的控制优先级低于所述参考控制指令的用户的控制优先级,丢弃所述控制指令。Step S220: Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device. Step S230: If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user sending the reference control instruction. Step S240: If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction. Step S241: If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, obtain a reference user, the reference user being the latest execution of the electronic device in the historical cycle time. The control instruction has a sending user of a conflicting control instruction. Step S250: Compare the control priority of the sending user and the reference user. Step S260: If the control priority of the sending user is higher than the control priority of the user of the reference control instruction, execute the control instruction and discard the reference control instruction. Step S261: If the control priority of the sending user is lower than the control priority of the user of the reference control instruction, discard the control instruction.
下面再结合附图9对本实施例的内容进行介绍。The content of this embodiment will be introduced below in conjunction with FIG. 9.
如图9所示,若在进入T5时刻到T6时刻这个时间周期的过程中,在确定执行用户C发送的控制指令后,会再进一步的确定参考用户。其中,用户C发送的控制指令为控制目标设备A启动,那么电子设备就会查找T5时刻之前的控制指令,以查找到最近一次控制目标设备A且被执行的控制指令。可以理解的是其中所述的最近一次是指相距时间最短的一次。那么若电子设备查找到T4时刻到T5时刻中用户A发送过控制目标设备A的控制指令,并且用户A发送的控制指令与用户C发送的控制指令是相互冲突且被执行了的,那么电子设备就会确定用户A为参考用户。当然,并不是每个周期时间都会有控制指令发送,因此参考用户也不一定会是前一次周期时间内的用户,也可能是更早的周期时间中的用户。As shown in Fig. 9, if in the process of entering the time period from time T5 to time T6, after determining to execute the control instruction sent by user C, the reference user will be further determined. Among them, the control instruction sent by the user C is to control the start of the target device A, then the electronic device will search for the control instruction before the time T5 to find the last control instruction that controlled the target device A and was executed. It is understandable that the most recent one mentioned here refers to the one with the shortest time interval. Then if the electronic device finds that user A has sent a control instruction to control target device A from time T4 to time T5, and the control instruction sent by user A conflicts with the control instruction sent by user C and is executed, then the electronic device The user A will be determined as the reference user. Of course, not every cycle time will have a control command sent, so the reference user may not necessarily be the user in the previous cycle time, but may also be the user in the earlier cycle time.
需要说明的是,用户在发送控制指令时,可能会同时对多个目标设备进行控制,也可能会同一个目标设备的多项功能进行控制。那么在这种方式下,所述控制指令包括多个控制参数,所述参考控制指令包括多个控制参数。其中,可选的,所述控制参数表征控制不同的目标设备。可选的,所述多个控制参数表征控制同一个目标设备的多个功能。在控制指令包括多个控制参数的情况下,对于两个不同的控制指令,可能会存在部分控制参数冲突,而部分控制参数不冲突的情况。It should be noted that when a user sends a control command, he may control multiple target devices at the same time, or may control multiple functions of the same target device. Then in this manner, the control instruction includes multiple control parameters, and the reference control instruction includes multiple control parameters. Wherein, optionally, the control parameter characterizes the control of different target devices. Optionally, the multiple control parameters represent multiple functions for controlling the same target device. In the case that the control instruction includes multiple control parameters, for two different control instructions, there may be some conflicts in the control parameters, but some control parameters do not conflict.
在这种方式下,所述若识别所述控制指令与所述参考控制指令冲突的步骤包括:若识别到所述控制指令的部分控制参数与所述参考控制指令的部分控制参数冲突。相应的,所述执行所述控制指令的步骤包括:生成新的控制指令,所述新的控制指令包括所述控制指令中的多个控制参数,以及所述参考控制指令中的多个控制参数中与所述接收到控制指令中的控制参数不冲突的控制参数;执行所述新的控制指令。例如,控制指令中的内容为控制空调关闭并控制窗户打开45度。那么可以确定的是控制指令的一个控制参数为控制空调关闭,另一个控制参数为控制窗户打开45度。参考控制指令为控制空调关闭并控制窗户打开90度,那么可以确定的是控制指令的一个控制参数为控制空调关闭,另一个控制参数为控制窗户打开90度。In this manner, the step of identifying a conflict between the control command and the reference control command includes: identifying a conflict between a part of the control parameter of the control command and a part of the control parameter of the reference control command. Correspondingly, the step of executing the control instruction includes: generating a new control instruction, and the new control instruction includes multiple control parameters in the control instruction and multiple control parameters in the reference control instruction The control parameter in the control parameter that does not conflict with the control parameter in the received control instruction; execute the new control instruction. For example, the content of the control instruction is to control the air conditioner to turn off and control the windows to open 45 degrees. Then it can be determined that one control parameter of the control command is to control the air conditioner to turn off, and the other control parameter is to control the window to open 45 degrees. The reference control command is to control the air conditioner to close and control the window to open 90 degrees, then it can be determined that one control parameter of the control command is to control the air conditioner to close, and the other control parameter is to control the window to open 90 degrees.
在这种情况下,电子设备会识别控制指令和参考控制指令中的控制空调关闭这个控制参数是不冲突的,而控制指令中的控制窗户打开45度这个控制参数,与参考控制指令中的控制窗户打开90度这个控制参数是冲突的。那么电子设备在对比到发送控制指令的发送用户的控制优先级高于发送参考控制指令的用户的控制优先级的情况下,生成包括控制空调关闭以及控制窗户打开45度这两个控制参数的控制指令,而会丢弃控制窗户打开90度这个控制参数。In this case, the electronic device will recognize that the control parameter in the control command and the reference control command to turn off the air conditioner does not conflict, and the control parameter in the control command to control the window to open 45 degrees is different from the control in the reference control command. The control parameter of window opening 90 degrees is in conflict. Then, when the electronic device compares that the control priority of the user who sends the control instruction is higher than the control priority of the user who sends the reference control instruction, the electronic device generates a control that includes two control parameters: controlling the air conditioner to turn off and controlling the window to open 45 degrees. Command, and discard the control parameter that controls the window to open 90 degrees.
本申请提供的一种指令处理方法,在当接收到控制指令以及处于同一个时间周期的还未执行的参考控制指令后,会先获取所述控制指令所控制的目标设备以及所述控制指令的发送用户,再比对所述发送用户与发送所述参考控制指令的用户的控制优先级,若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令,并丢弃掉参考控制指令。从而通过上述方式实现了在多个用户都可以对同一个设备进行控制的情况下,基于用户的控制优先级的方式来解决指令的冲突,提升了设备控制效率。The instruction processing method provided by this application first obtains the target device controlled by the control instruction and the control instruction after receiving the control instruction and the unexecuted reference control instruction in the same time period. The sending user compares the control priority of the sending user with the user who sent the reference control instruction. If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute all The control instruction is described, and the reference control instruction is discarded. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
请参阅图10,本申请实施例提供的一种指令处理方法,应用于电子设备,所述方法包括:Referring to FIG. 10, an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
步骤S310:当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户。步骤S320:获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备。步骤S330:若识别所述控制指令与所述参考控制指令冲突,获取当前时间段内所述发送用户和发送所述参考控制指令的用户的控制优先级,其中,在不同的所述优先级模式下,用户组中的用户的控制优先级不同。需要说明的是,具备配置用户组的每个用户的控制优先级的用户可以配置每个用户的控制优先级按照一定的时间段进行变换,以便增加优先级控制的灵活性。例如,在用户组包括用户A、用户B、用户C以及用户D的情况下,可以配置以24小时为一个时间段,在第一个时间段内用户A、用户B、用户C以及用户D的控制优先级依次降低,而在第二个时间段内用户B、用户C、用户D以及用户A的控制优先级依次降低,然后在第三个时间段内用户C、用户D、用户A以及用户B的控制优先级依次降低。Step S310: After receiving the control instruction, acquire the target device controlled by the control instruction and the sending user of the control instruction. Step S320: Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device. Step S330: If it is recognized that the control instruction conflicts with the reference control instruction, obtain the control priorities of the sending user and the user sending the reference control instruction in the current time period, wherein, in different priority modes Below, users in the user group have different control priorities. It should be noted that a user who has the control priority of each user who configures the user group can configure the control priority of each user to change according to a certain time period, so as to increase the flexibility of priority control. For example, when the user group includes user A, user B, user C, and user D, a 24-hour period can be configured. In the first period of time, user A, user B, user C, and user D The control priority is reduced sequentially, and the control priority of user B, user C, user D, and user A is reduced in the second time period, and then in the third time period, user C, user D, user A, and user The control priority of B is successively lowered.
步骤S340:比对所述发送用户与发送所述参考控制指令的用户的控制优先级。步骤S350:若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。步骤S351:若所述发送用户的控制优先级低于发送所述参考控制指令的用户的控制优先级,丢弃所述控制指令。Step S340: Compare the control priorities of the sending user and the user sending the reference control instruction. Step S350: If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. Step S351: If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction.
此外,除了上述的通过时间段来区分优先级的情况下,还可以通过当前的优先级模式来获取每个用户的控制优先级。可以理解的是,在配置用户组中的用户的控制优先级时,还可以基于不同的模式来进行。例如,在用户组包括有用户A、用户B、用户C以及用户D的情况下,可以配置第一模式以及第二模式,其中,在第一模式下用户A、用户B、用户C以及用户D的控制优先级依次降低,而在第二模式下用户B、用户C、用 户D以及用户A的控制优先级依次降低。在这种方式下,具备控制优先级配置的用户可以在第一模式和第二模式中进行选择,进而可以快速的对每个用户的控制优先级进行配置,而不用一个一个用户的进行控制优先级配置。In addition, in addition to the above-mentioned case where the priority is distinguished by the time period, the control priority of each user can also be obtained through the current priority mode. It is understandable that when configuring the control priority of users in a user group, it can also be done based on different modes. For example, in the case where the user group includes user A, user B, user C, and user D, the first mode and the second mode can be configured, where in the first mode, user A, user B, user C, and user D In the second mode, the control priority of user B, user C, user D, and user A are sequentially reduced. In this way, users with control priority configuration can choose between the first mode and the second mode, and then can quickly configure the control priority of each user, instead of each user's control priority Level configuration.
进而在这种方式下,所述比对所述发送用户与发送所述参考控制指令的用户的控制优先级的步骤包括:获取所述发送用户所属用户组当前对应的优先级模式,其中,在不同的所述优先级模式下,用户组中的用户的控制优先级不同;基于所述优先级模式,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。例如,如图11所示,在图11所示的配置界面99中,显示有多个卡片98,每个卡片对应一种优先级控制模式,并且对应配置有模式控制开关98,以便用于控制启用那个模式,在每个卡片中还配置有表征每个用户控制优先级高低的进度条96。其中在妈妈模式的卡片中控制优先级最高的为妈妈这个用户,而控制优先级最低的为孩子这个用户,而在爸爸模式的卡片中控制优先级最高的为爸爸这个用户,而控制优先级最低的为孩子这个用户。Further in this manner, the step of comparing the control priorities of the sending user and the user sending the reference control instruction includes: acquiring the priority mode currently corresponding to the user group to which the sending user belongs, where In the different priority modes, the users in the user group have different control priorities; based on the priority mode, the control priorities of the sending user and the user sending the reference control instruction are compared. For example, as shown in FIG. 11, in the configuration interface 99 shown in FIG. 11, a plurality of cards 98 are displayed. Each card corresponds to a priority control mode, and a mode control switch 98 is correspondingly configured for control When that mode is enabled, each card is also configured with a progress bar 96 that characterizes the control priority of each user. Among the cards in the mother mode, the user with the highest control priority is the mother, and the user with the lowest control priority is the child user, and in the cards in the father mode, the user with the highest control priority is the dad, and the control priority is the lowest. The user is the child.
本申请提供的一种指令处理方法,通过上述方式实现了在多个用户都可以对同一个设备进行控制的情况下,可以基于当前时间段内用户的控制优先级的方式来解决指令的冲突,提升了设备控制效率。还可以通过当前的用户控制优先级模式来解决指令的冲突,提升了设备控制效率。The instruction processing method provided by the present application realizes through the above method that in the case that multiple users can control the same device, the conflict of instructions can be resolved based on the control priority of the user in the current time period. Improved equipment control efficiency. The current user control priority mode can also be used to resolve command conflicts, which improves the efficiency of device control.
请参阅图12,本申请实施例提供的一种指令处理方法,应用于电子设备,所述方法包括:Referring to FIG. 12, an instruction processing method provided by an embodiment of the present application is applied to an electronic device, and the method includes:
步骤S410:当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户。步骤S420:获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备。步骤S430:若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。步骤S440:若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,获取所述目标设备执行所述控制指令后所触发的第一设备联动场景的优先级。可以理解的是,在一些情况下,某些场景是较为重要的,那么基于这种方式在本实施例的步骤总还会包括后续的进行场景的优先级比较的情况。Step S410: After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction. Step S420: Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device. Step S430: If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user sending the reference control instruction. Step S440: If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, obtain the priority of the first device linkage scenario triggered after the target device executes the control instruction. It can be understood that, in some cases, certain scenarios are more important, so based on this approach, the steps in this embodiment will always include subsequent scenario priority comparisons.
可以理解的是,用户在进行场景配置的过程中,电子设备或者可以与电子设备进行通信的其他设备中会存储有所配置场景对应设备的联动状态。例如,用户配置的场景为设备A启动后,就触发设备B启动,若检测到设备B启动,就触发设备C启动。那么所存储的设备联动场景为设备A启动就触发设备B启动并触发设备C启动,而对于这个场景,用户还可以进一步的配置一个场景的优先级。那么若控制指令所控制的目标设备为前述设备A,那么当触发设备A启动后,就会触发前述所配置的场景。It is understandable that in the process of the user's scene configuration, the electronic device or other devices that can communicate with the electronic device store the linkage state of the device corresponding to the configured scene. For example, the scene configured by the user is that after device A is started, device B is triggered to start; if device B is detected to start, device C is triggered to start. Then the stored device linkage scenario is that device A starts, which triggers device B to start and triggers device C to start, and for this scenario, the user can further configure the priority of a scenario. Then if the target device controlled by the control instruction is the aforementioned device A, then when the triggering device A starts, the aforementioned configured scene will be triggered.
步骤S450:若所述发送用户的控制优先级低于发送所述参考控制指令的用户的控制优先级,丢弃所述控制指令。步骤S460:获取所述目标设备执行所述参考控制指令后所触发的第二设备联动场景的优先级。步骤S470:若识别到所述第一设备联动场景的优先级低于所述第二设备联动场景的优先级,检测所述发送用户的优先级是否符合指定条件。Step S450: If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, discard the control instruction. Step S460: Obtain the priority of the second device linkage scene triggered after the target device executes the reference control instruction. Step S470: If it is recognized that the priority of the first device linkage scenario is lower than the priority of the second device linkage scenario, detect whether the priority of the sending user meets a specified condition.
作为一种方式,所述指定条件包括:所述发送用户的控制优先级在所属用户组中最高。可以理解的是,优先级最高的用户可以被认定为管理员用户么,那么管理员用户就可以对所绑定设备进行任意的控制或者配置。步骤S480:若所述发送用户的优先级符合指定条件,执行所述控制指令。步骤S490:若所述发送用户的优先级不符合指定条件,向发送所述参考控制指令的用户所绑定的终端发送提示信息,以便提示发送所述参考控制指令的用户是否授权执行所述控制指令。步骤S491:判断接收到的信息是否表征授权执行控制指令。若接收到表征允许执行所述控制指令的授权信息,执行所述控制指令。步骤S492:若接收到表征不允许执行所述控制指令的信息,丢弃所述控制指令。As a manner, the specified condition includes: the control priority of the sending user is the highest in the user group to which it belongs. It is understandable that the user with the highest priority can be identified as an administrator user, then the administrator user can perform arbitrary control or configuration on the bound device. Step S480: If the priority of the sending user meets the specified condition, execute the control instruction. Step S490: If the priority of the sending user does not meet the specified condition, send a prompt message to the terminal bound to the user who sent the reference control instruction, so as to prompt whether the user who sent the reference control instruction is authorized to execute the control instruction. Step S491: Determine whether the received information represents authorization to execute a control instruction. If authorization information indicating that the execution of the control instruction is permitted is received, the control instruction is executed. Step S492: If a message indicating that execution of the control instruction is not allowed is received, discard the control instruction.
本申请提供的一种指令处理方法,在当接收到控制指令后,会先获取所述控制指令所控 制的目标设备以及所述控制指令的发送用户,然后再获取参考控制指令,进而将控制指令与参考控制指令进行冲突识别,若识别所述控制指令与所述参考控制指令冲突,再比对所述发送用户与发送所述参考控制指令的用户的控制优先级,若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,再进一步的比对目标设备分别执行控制指令和参考控制指令后触发的场景的优先级,来确定是否执行所述控制指令。从而通过上述方式实现了在多个用户都可以对同一个设备进行控制的情况下,基于用户的控制优先级以及目标设备分别执行控制指令和参考控制指令后触发的场景的优先级的方式来解决指令的冲突,提升了设备控制效率。In the instruction processing method provided by the present application, after receiving a control instruction, it will first obtain the target device controlled by the control instruction and the sending user of the control instruction, and then obtain the reference control instruction, and then transfer the control instruction Perform conflict identification with the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priorities of the sending user and the user who sent the reference control instruction. If the control of the sending user is The priority is higher than the control priority of the user who sent the reference control instruction, and the priority of the scene triggered after the target device respectively executes the control instruction and the reference control instruction is further compared to determine whether to execute the control instruction. In this way, in the case where multiple users can control the same device, the solution is solved based on the user's control priority and the priority of the scene triggered after the target device executes the control instruction and refers to the control instruction. The conflict of commands improves the efficiency of equipment control.
请参阅图13,本申请实施例提供的一种指令处理方法,应用于服务器,所述方法包括:Referring to FIG. 13, an instruction processing method provided by an embodiment of the present application is applied to a server, and the method includes:
步骤S510:当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户。步骤S520:获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备。步骤S530:若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。步骤S531:若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。步骤S540:若所述发送用户的控制优先级低于发送所述参考控制指令的用户的控制优先级,识别所述参考控制指令是否有指示响应结束时刻,所述响应结束时刻为所述目标设备停止执行所述参考控制指令所指示功能的时间。步骤S550:若识别到有所述指示响应结束时刻,检测当前时刻与所述指示响应结束时刻之间的时间长度。步骤S560:若识别到该时间长度小于目标时长长度,将所述控制指令发送给所述网关,指示所述网关在所述响应结束时刻后,执行所述控制指令。步骤S551:若识别到没有所述指示响应结束时刻,丢弃所述控制指令。Step S510: After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction. Step S520: Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is the control sent by users other than the sending user in the user group to which the sending user belongs. For the control instruction of the target device, all users in the user group are bound to the target device. Step S530: If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user sending the reference control instruction. Step S531: If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. Step S540: If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, identify whether the reference control instruction indicates a response end time, and the response end time is the target device Time to stop executing the function indicated by the reference control instruction. Step S550: If the end time of the indicated response is recognized, the length of time between the current time and the end of the indicated response is detected. Step S560: If it is recognized that the time length is less than the target time length, the control instruction is sent to the gateway to instruct the gateway to execute the control instruction after the response ends. Step S551: If it is recognized that there is no end time of the instruction response, discard the control instruction.
可以理解的是,在本实施例中参考控制指令中携带有控制的响应结束时刻作为一种控制效果。例如,参考控制指令可以配置空调A启动2小时,那么就可以明确其响应结束时刻为2小时候。再例如,若参考控制指令可以配置空调A在11点到12点保持启动,那么就可以明确其响应结束时刻为12点。那么当判断控制指令与参考控制指令冲突的情况下,若直接丢弃控制指令可能会造成用户需要重新再次发送控制指令,但是,其实再过很短的时间后,例如3秒,或者1秒,甚至是0.5秒后,即使是同样的控制指令就不会和已经处于被执行了的参考控制指令冲突,那么为了避免用户不必要的重复发送控制指令,电子设备会在检测当前时刻与所述指示响应结束时刻之间的时间长度小于目标时长长度后,将所述控制指令发送给所述网关,指示所述网关在所述响应结束时刻后,执行所述控制指令,从而使得即使控制指令当前与已经被执行的控制指令冲突,可以被延后执行,以避免用户重复发送指令。It can be understood that, in this embodiment, the reference control instruction carries the control response end time as a control effect. For example, referring to the control command, the air conditioner A can be configured to start for 2 hours, then it can be clear that the response end time is 2 hours. For another example, if the air conditioner A can be configured to keep starting from 11 o'clock to 12 o'clock by referring to the control command, then it can be clear that the response end time is 12 o'clock. Then when it is judged that the control command conflicts with the reference control command, if the control command is directly discarded, the user may need to resend the control command again. However, in fact, after a short time, such as 3 seconds, or 1 second, or even After 0.5 seconds, even the same control command will not conflict with the reference control command that has already been executed. Then, in order to avoid the user from sending the control command unnecessarily, the electronic device will respond to the command at the current moment. After the length of time between the end moments is less than the target duration, the control instruction is sent to the gateway to instruct the gateway to execute the control instruction after the response end time, so that even if the control instruction is currently The executed control commands conflict and can be delayed to be executed to avoid the user from repeatedly sending commands.
本申请提供的一种指令处理方法,通过上述方式实现了在多个用户都可以对同一个设备进行控制的情况下,基于用户的控制优先级以及参考控制指令的时效来解决指令的冲突,提升了设备控制效率。并且,对于当前还不能立刻执行的控制指令可以进行缓存,以便后续再执行,减少了用户的重复操作。The instruction processing method provided by the present application realizes through the above method that in the case that multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user and the timeliness of the reference control instruction, and the improvement Improve equipment control efficiency. In addition, the current control instructions that cannot be executed immediately can be cached for subsequent execution, reducing the user's repeated operations.
请参阅图14,本申请实施例提供的一种指令处理装置600,运行于电子设备,所述装置600包括:Referring to FIG. 14, an instruction processing apparatus 600 provided by an embodiment of the present application runs on an electronic device, and the apparatus 600 includes:
指令信息获取单元610,用于当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户。参考信息确定单元620,用于获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备。优先级比对单元630,用于若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。作为一种方式,优先级比对单元630,用于若识别所述控制指令与所述参考控制指令对所述目标设备的同一功能的 控制效果不同,判定所述控制指令与所述参考控制指令冲突。指令处理单元640,用于若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。作为一种方式,所述参考控制指令为所述电子设备已经执行的控制指令。作为另外一种方式,所述参考控制指令为还未执行的控制指令。在这种方式下,指令处理单元640,还用于若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,丢弃所述参考控制指令。The instruction information acquiring unit 610 is configured to acquire the target device controlled by the control instruction and the sending user of the control instruction after receiving the control instruction. The reference information determining unit 620 is configured to obtain a reference control instruction received within the same cycle time as the control instruction, and the reference control instruction is sent by users other than the sending user in the user group to which the sending user belongs. For the control instructions used to control the target device, all users in the user group are bound to the target device. The priority comparison unit 630 is configured to compare the control priority of the sending user and the user who sent the reference control command if it is identified that the control command conflicts with the reference control command. As a way, the priority comparison unit 630 is configured to determine that the control instruction and the reference control instruction have different control effects on the same function of the target device if the control instruction and the reference control instruction have different control effects. conflict. The instruction processing unit 640 is configured to execute the control instruction if the control priority of the sending user is higher than the control priority of the user sending the reference control instruction. As a manner, the reference control instruction is a control instruction that has been executed by the electronic device. As another way, the reference control instruction is a control instruction that has not yet been executed. In this manner, the instruction processing unit 640 is further configured to discard the reference control instruction if the control priority of the sending user is higher than the control priority of the user sending the reference control instruction.
作为一种方式,如图15所示,所述装置还包括参考用户获取单元650,用于获取参考用户,所述参考用户为所述电子设备在历史周期时间中最近一次执行的与所述控制指令有冲突的控制指令的发送用户。在这方式下,优先级比对单元630,还用于比对所述发送用户与参考用户的控制优先级,若所述发送用户的控制优先级高于所述参考控制指令的用户的控制优先级,执行所述控制指令。As a way, as shown in FIG. 15, the device further includes a reference user acquiring unit 650, configured to acquire a reference user, and the reference user is the most recent execution of the electronic device in the historical cycle time and the control The sending user of the conflicting control command. In this mode, the priority comparison unit 630 is also used to compare the control priority of the sending user and the reference user, if the control priority of the sending user is higher than the control priority of the reference control instruction user Level, execute the control instruction.
作为一种方式,所述控制指令包括多个控制参数,所述参考控制指令包括多个控制参数。所述指令处理单元640,具体用于生成新的控制指令,所述新的控制指令包括所述控制指令中的多个控制参数,以及所述参考控制指令中的多个控制参数中与所述接收到控制指令中的控制参数不冲突的控制参数;执行所述新的控制指令。其中,所述多个控制参数表征控制同一个目标设备的多个功能。此外,所述控制参数表征控制不同的目标设备。As a manner, the control instruction includes multiple control parameters, and the reference control instruction includes multiple control parameters. The instruction processing unit 640 is specifically configured to generate a new control instruction. The new control instruction includes a plurality of control parameters in the control instruction, and the reference control instruction includes a number of control parameters in the reference control instruction. Receiving a control parameter that does not conflict with the control parameter in the control instruction; execute the new control instruction. Wherein, the multiple control parameters represent multiple functions that control the same target device. In addition, the control parameters characterize the control of different target devices.
作为一种方式,所述控制指令与所述参考控制指令为同时接收到。As a manner, the control instruction and the reference control instruction are received simultaneously.
作为一种方式,优先级比对单元630,具体用于比对所述发送用户与发送所述参考控制指令的用户在当前时间段内的控制优先级,其中,在不同时间段内,所述用户组的用户的控制优先级不相同。As a way, the priority comparison unit 630 is specifically configured to compare the control priorities of the sending user and the user sending the reference control instruction in the current time period, wherein, in different time periods, the The control priorities of users in the user group are different.
作为另外一种方式,优先级比对单元630,具体用于获取所述发送用户所属用户组当前对应的优先级模式,其中,在不同的所述优先级模式下,用户组中的用户的控制优先级不同;基于所述优先级模式,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。As another way, the priority comparison unit 630 is specifically configured to obtain the current priority mode corresponding to the user group to which the sending user belongs, wherein, in different priority modes, the users in the user group control Priorities are different; based on the priority mode, the control priorities of the sending user and the user sending the reference control instruction are compared.
作为一种方式,如图16所示,所述装置600还包括场景获取单元660,用于获取所述目标设备执行所述控制指令后所触发的第一设备联动场景的优先级;获取所述目标设备执行所述参考控制指令后所触发的第二设备联动场景的优先级。As a way, as shown in FIG. 16, the apparatus 600 further includes a scene acquiring unit 660, configured to acquire the priority of the first device linkage scene triggered after the target device executes the control instruction; The priority of the second device linkage scene triggered after the target device executes the reference control instruction.
在这种方式下,优先级比对单元630,还用于若识别到所述第一设备联动场景的优先级低于所述第二设备联动场景的优先级,检测所述发送用户的优先级是否符合指定条件。其中,所述指定条件包括:所述发送用户的控制优先级在所属用户组中最高。对应的,指令处理单元640,还用于若所述发送用户的优先级符合指定条件,执行所述控制指令,若接收到表征不允许执行所述控制指令的信息,丢弃所述控制指令。In this manner, the priority comparison unit 630 is further configured to detect the priority of the sending user if it is recognized that the priority of the first device linkage scene is lower than the priority of the second device linkage scene Whether it meets the specified conditions. Wherein, the specified condition includes: the control priority of the sending user is the highest in the user group to which it belongs. Correspondingly, the instruction processing unit 640 is further configured to execute the control instruction if the priority of the sending user meets the specified condition, and discard the control instruction if the information indicating that the execution of the control instruction is not allowed is received.
作为一种方式,所述电子设备为服务器,所述目标设备通过网关与所述服务器通信。在这种方式下,参考信息确定单元620,还用于若所述发送用户的控制优先级低于发送所述参考控制指令的用户的控制优先级,识别所述参考控制指令是否有指示响应结束时刻,所述响应结束时刻为所述目标设备停止执行所述参考控制指令所指示功能的时间,若识别到有所述指示响应结束时刻,检测当前时刻与所述指示响应结束时刻之间的时间长度。所述指令处理单元640,具体用于若识别到该时间长度小于目标时长长度,将所述控制指令发送给所述网关,指示所述网关在所述响应结束时刻后,执行所述控制指令。As a manner, the electronic device is a server, and the target device communicates with the server through a gateway. In this manner, the reference information determining unit 620 is further configured to, if the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, identify whether the reference control instruction indicates the end of the response The response end time is the time when the target device stops executing the function indicated by the reference control instruction. If the indicated response end time is recognized, the time between the current time and the indicated response end time is detected length. The instruction processing unit 640 is specifically configured to send the control instruction to the gateway if it is recognized that the time length is less than the target time length, and instruct the gateway to execute the control instruction after the response ends.
需要说明的是,本申请中装置实施例与前述方法实施例是相互对应的,装置实施例中具体的原理可以参见前述方法实施例中的内容,此处不再赘述。It should be noted that the device embodiment in this application and the foregoing method embodiment correspond to each other, and the specific principles in the device embodiment can be referred to the content in the foregoing method embodiment, which is not repeated here.
下面将结合图17对本申请提供的一种电子设备进行说明。Hereinafter, an electronic device provided by the present application will be described with reference to FIG. 17.
请参阅图17,基于上述的指令处理方法、装置,本申请实施例还提供的另一种可以执行前述指令处理方法的电子设备200。电子设备200包括相互耦合的一个或多个(图中仅示出一个)处理器102、存储器104以及网络模块106。其中,该存储器104中存储有可以执行前 述实施例中内容的程序,而处理器102可以执行该存储器104中存储的程序。Referring to FIG. 17, based on the foregoing instruction processing method and apparatus, an embodiment of the present application also provides another electronic device 200 that can execute the foregoing instruction processing method. The electronic device 200 includes one or more (only one is shown in the figure) a processor 102, a memory 104, and a network module 106 coupled to each other. Wherein, the memory 104 stores a program that can execute the content in the foregoing embodiment, and the processor 102 can execute the program stored in the memory 104.
其中,处理器102可以包括一个或者多个处理核。处理器102利用各种接口和线路连接整个电子设备200内的各个部分,通过运行或执行存储在存储器104内的指令、程序、代码集或指令集,以及调用存储在存储器104内的数据,执行电子设备200的各种功能和处理数据。可选地,处理器102可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器102可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器102中,单独通过一块通信芯片进行实现。The processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 200, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 104, and calling data stored in the memory 104. Various functions and processing data of the electronic device 200. Optionally, the processor 102 may use at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). A kind of hardware form to realize. The processor 102 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented by a communication chip alone.
存储器104可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器104可用于存储指令、程序、代码、代码集或指令集。存储器104可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 104 may include random access memory (RAM) or read-only memory (Read-Only Memory). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a storage program area and a storage data area, where the storage program area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions for implementing the following method embodiments, etc. The data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
所述网络模块106用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯,例如和音频播放设备进行通讯。所述网络模块106可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。所述网络模块106可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。例如,网络模块106可以与基站进行信息交互。The network module 106 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices, such as with audio playback devices. The network module 106 may include various existing circuit elements for performing these functions, for example, an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a subscriber identity module (SIM) card, a memory, etc. . The network module 106 can communicate with various networks such as the Internet, an intranet, and a wireless network, or communicate with other devices through a wireless network. The aforementioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network. For example, the network module 106 can exchange information with the base station.
需要说明的是,图17中所示的电子设备200可以为前述的服务器或者网关。那么当电子设备200为网关的情况下,所包括的处理器102可以为微处理器,而其所包括的网络模块106还可以包括进行通信协议转换的接口。It should be noted that the electronic device 200 shown in FIG. 17 may be the aforementioned server or gateway. Then, when the electronic device 200 is a gateway, the included processor 102 may be a microprocessor, and the included network module 106 may also include an interface for performing communication protocol conversion.
请参考图18,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质1100中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。计算机可读存储介质1100可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质1100包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质1100具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码1110可以例如以适当形式进行压缩。Please refer to FIG. 18, which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable medium 1100 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment. The computer-readable storage medium 1100 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 1100 has a storage space for executing the program code 810 of any method step in the foregoing method. These program codes can be read out from or written into one or more computer program products. The program code 1110 may be compressed in a suitable form, for example.
本申请提供的一种指令处理方法、装置、电子设备以及存储介质,在当接收到控制指令后,会先获取所述控制指令所控制的目标设备以及所述控制指令的发送用户,然后再获取参考控制指令,进而将控制指令与参考控制指令进行冲突识别,若识别所述控制指令与所述参考控制指令冲突,再比对所述发送用户与发送所述参考控制指令的用户的控制优先级,若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。从而通过上述方式实现了在多个用户都可以对同一个设备进行控制的情况下,基于用户的控制优先级的方式来解决指令的冲突,提升了设备控制效率。The instruction processing method, device, electronic device, and storage medium provided by this application will first obtain the target device controlled by the control instruction and the sending user of the control instruction after receiving the control instruction, and then obtain Refer to the control instruction, and then identify the conflict between the control instruction and the reference control instruction. If it is identified that the control instruction conflicts with the reference control instruction, then compare the control priority of the sending user and the user sending the reference control instruction If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction. Therefore, in the above manner, when multiple users can control the same device, the conflict of instructions is resolved based on the control priority of the user, and the device control efficiency is improved.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application, not to limit them; although the application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims (20)
- 一种指令处理方法,其特征在于,应用于电子设备,所述方法包括:An instruction processing method, characterized in that it is applied to an electronic device, and the method includes:当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户;After receiving the control instruction, obtain the target device controlled by the control instruction and the sending user of the control instruction;获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备;Obtain a reference control instruction received within the same cycle time as the control instruction, where the reference control instruction is a control command sent by a user other than the sending user in the user group to which the sending user belongs to control the target device Control instruction, all users in the user group are bound to the target device;若识别所述控制指令与所述参考控制指令冲突,比对所述发送用户与发送所述参考控制指令的用户的控制优先级;If it is identified that the control instruction conflicts with the reference control instruction, compare the control priorities of the sending user and the user who sent the reference control instruction;若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, execute the control instruction.
- 根据权利要求1所述的方法,其特征在于,所述参考控制指令为所述电子设备已经执行的控制指令。The method according to claim 1, wherein the reference control instruction is a control instruction that has been executed by the electronic device.
- 根据权利要求1所述的方法,其特征在于,所述参考控制指令为还未执行的控制指令;The method according to claim 1, wherein the reference control instruction is a control instruction that has not yet been executed;所述方法,还包括:The method further includes:若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,丢弃所述参考控制指令。If the control priority of the sending user is higher than the control priority of the user sending the reference control instruction, discard the reference control instruction.
- 根据权利要求3所述的方法,其特征在于,所述执行所述控制指令的步骤之前还包括:The method according to claim 3, wherein before the step of executing the control instruction, the method further comprises:获取参考用户,所述参考用户为所述电子设备在历史周期时间中最近一次执行的与所述控制指令有冲突的控制指令的发送用户;Acquiring a reference user, the reference user being the sending user of the control instruction that conflicts with the control instruction that was executed last time by the electronic device in the historical cycle time;比对所述发送用户与参考用户的控制优先级,若所述发送用户的控制优先级高于所述参考控制指令的用户的控制优先级,执行所述控制指令。The control priority of the sending user and the reference user are compared, and if the control priority of the sending user is higher than the control priority of the user of the reference control instruction, the control instruction is executed.
- 根据权利要求3所述的方法,其特征在于,所述控制指令包括多个控制参数,所述参考控制指令包括多个控制参数;所述若识别所述控制指令与所述参考控制指令冲突的步骤包括:若识别到所述控制指令的部分控制参数与所述参考控制指令的部分控制参数冲突;The method according to claim 3, wherein the control instruction includes a plurality of control parameters, and the reference control instruction includes a plurality of control parameters; if the conflict between the control instruction and the reference control instruction is identified The steps include: if it is recognized that part of the control parameter of the control instruction conflicts with the part of the control parameter of the reference control instruction;所述执行所述控制指令的步骤包括:The step of executing the control instruction includes:生成新的控制指令,所述新的控制指令包括所述控制指令中的多个控制参数,以及所述参考控制指令中的多个控制参数中与所述接收到控制指令中的控制参数不冲突的控制参数;A new control instruction is generated, the new control instruction includes multiple control parameters in the control instruction, and the multiple control parameters in the reference control instruction do not conflict with the control parameters in the received control instruction Control parameters;执行所述新的控制指令。Execute the new control instruction.
- 根据权利要求5所述的方法,其特征在于,所述多个控制参数表征控制同一个目标设备的多个功能。The method according to claim 5, wherein the multiple control parameters represent multiple functions of controlling the same target device.
- 根据权利要求5所述的方法,其特征在于,所述控制参数表征控制不同的目标设备。The method according to claim 5, wherein the control parameter characterizes the control of different target devices.
- 根据权利要求3所述的方法,其特征在于,所述控制指令与所述参考控制指令为同时接收到。The method according to claim 3, wherein the control instruction and the reference control instruction are received simultaneously.
- 根据权利要求1-8任一所述的方法,其特征在于,所述比对所述发送用户与发送所述参考控制指令的用户的控制优先级的步骤包括:8. The method according to any one of claims 1-8, wherein the step of comparing the control priorities of the sending user and the user sending the reference control instruction comprises:比对所述发送用户与发送所述参考控制指令的用户在当前时间段内的控制优先级,其中,在不同时间段内,所述用户组的用户的控制优先级不相同。Compare the control priorities of the sending user and the user who sent the reference control instruction in the current time period, where in different time periods, the control priorities of the users in the user group are different.
- 根据权利要求1-8任一所述的方法,其特征在于,所述比对所述发送用户与发送所述参考控制指令的用户的控制优先级的步骤包括:8. The method according to any one of claims 1-8, wherein the step of comparing the control priorities of the sending user and the user sending the reference control instruction comprises:获取所述发送用户所属用户组当前对应的优先级模式,其中,在不同的所述优先级模式下,用户组中的用户的控制优先级不同;Acquiring a priority mode currently corresponding to the user group to which the sending user belongs, where in different priority modes, users in the user group have different control priorities;基于所述优先级模式,比对所述发送用户与发送所述参考控制指令的用户的控制优先级。Based on the priority mode, the control priorities of the sending user and the user who sent the reference control instruction are compared.
- 根据权利要求1所述的方法,其特征在于,所述执行所述控制指令的步骤之前还包括:The method according to claim 1, wherein before the step of executing the control instruction, the method further comprises:获取所述目标设备执行所述控制指令后所触发的第一设备联动场景的优先级;Acquiring the priority of the first device linkage scene triggered after the target device executes the control instruction;获取所述目标设备执行所述参考控制指令后所触发的第二设备联动场景的优先级;Acquiring the priority of the second device linkage scene triggered after the target device executes the reference control instruction;若识别到所述第一设备联动场景的优先级低于所述第二设备联动场景的优先级,检测所述发送用户的优先级是否符合指定条件;If it is recognized that the priority of the first device linkage scenario is lower than the priority of the second device linkage scenario, detecting whether the priority of the sending user meets a specified condition;若所述发送用户的优先级符合指定条件,执行所述控制指令。If the priority of the sending user meets the specified condition, execute the control instruction.
- 根据权利要求11所述的方法,其特征在于,所述方法还包括:The method of claim 11, wherein the method further comprises:若所述发送用户的优先级不符合指定条件,向发送所述参考控制指令的用户所绑定的终端发送提示信息,以便提示发送所述参考控制指令的用户是否授权执行所述控制指令;If the priority of the sending user does not meet the specified condition, sending a prompt message to the terminal bound to the user sending the reference control instruction, so as to prompt the user sending the reference control instruction whether to authorize the execution of the control instruction;若接收到表征允许执行所述控制指令的授权信息,执行所述控制指令。If authorization information indicating that the execution of the control instruction is permitted is received, the control instruction is executed.
- 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method of claim 12, wherein the method further comprises:若接收到表征不允许执行所述控制指令的信息,丢弃所述控制指令。If the information indicating that the execution of the control instruction is not allowed is received, the control instruction is discarded.
- 根据权利要求11-13任一所述的方法,其特征在于,所述指定条件包括:The method according to any one of claims 11-13, wherein the specified condition comprises:所述发送用户的控制优先级在所属用户组中最高。The control priority of the sending user is the highest in the user group to which it belongs.
- 根据权利要求1-14任一所述的方法,其特征在于,所述若识别所述控制指令与所述参考控制指令冲突包括:The method according to any one of claims 1-14, wherein the identifying that the control instruction conflicts with the reference control instruction comprises:若识别所述控制指令与所述参考控制指令对所述目标设备的同一功能的控制效果不同。If it is recognized that the control instruction and the reference control instruction have different control effects on the same function of the target device.
- 根据权利要求1-15任一所述的方法,其特征在于,所述电子设备为服务器,所述目标设备通过网关与所述服务器通信。The method according to any one of claims 1-15, wherein the electronic device is a server, and the target device communicates with the server through a gateway.
- 根据权利要求16所述的方法,其特征在于,所述方法还包括:The method of claim 16, wherein the method further comprises:若所述发送用户的控制优先级低于发送所述参考控制指令的用户的控制优先级,识别所述参考控制指令是否有指示响应结束时刻,所述响应结束时刻为所述目标设备停止执行所述参考控制指令所指示功能的时间;If the control priority of the sending user is lower than the control priority of the user sending the reference control instruction, identify whether the reference control instruction indicates the end time of the response, and the end time of the response is when the target device stops executing The time of the function indicated by the reference control instruction;若识别到有所述指示响应结束时刻,检测当前时刻与所述指示响应结束时刻之间的时间长度;If the end time of the indicated response is recognized, the length of time between the current time and the end of the indicated response is detected;若识别到该时间长度小于目标时长长度,将所述控制指令发送给所述网关,指示所述网关在所述响应结束时刻后,执行所述控制指令。If it is recognized that the time length is less than the target time length, the control instruction is sent to the gateway, and the gateway is instructed to execute the control instruction after the response ends.
- 一种指令处理装置,其特征在于,运行于电子设备,所述装置包括:An instruction processing device, characterized in that it runs on an electronic device, and the device includes:指令信息获取单元,用于当接收到控制指令后,获取所述控制指令所控制的目标设备以及所述控制指令的发送用户;The instruction information acquiring unit is configured to acquire the target device controlled by the control instruction and the sending user of the control instruction after receiving the control instruction;参考信息确定单元,用于获取与所述控制指令在同一个周期时间内接收到的参考控制指令,所述参考控制指令为所述发送用户所属用户组中除所述发送用户外的用户发送过的控制所述目标设备的控制指令,所述用户组中的用户均绑定有所述目标设备;The reference information determining unit is configured to obtain a reference control instruction received within the same cycle time as the control instruction, and the reference control instruction is sent by users other than the sending user in the user group to which the sending user belongs A control instruction for controlling the target device, all users in the user group are bound to the target device;优先级比对单元,用于若识别所述控制指令与所述参考控制指令冲突, 比对所述发送用户与发送所述参考控制指令的用户的控制优先级;A priority comparison unit, configured to compare the control priority of the sending user with the user who sent the reference control command if it is identified that the control command conflicts with the reference control command;指令处理单元,用于若所述发送用户的控制优先级高于发送所述参考控制指令的用户的控制优先级,执行所述控制指令。The instruction processing unit is configured to execute the control instruction if the control priority of the sending user is higher than the control priority of the user sending the reference control instruction.
- 一种电子设备,其特征在于,包括一个或多个处理器以及存储器;An electronic device, characterized in that it includes one or more processors and a memory;一个或多个程序,其中所述一个或多个程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行权利要求1-17任一所述的方法。One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute claim 1 -17 Any of the methods described.
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有程序代码,其中,在所述程序代码运行时执行权利要求1-17任一所述的方法。A computer-readable storage medium, wherein a program code is stored in the computer-readable storage medium, wherein the method according to any one of claims 1-17 is executed when the program code is running.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201980089725.3A CN113330424B (en) | 2019-05-16 | 2019-05-16 | Instruction processing method, device, electronic equipment and storage medium |
PCT/CN2019/087296 WO2020228031A1 (en) | 2019-05-16 | 2019-05-16 | Instruction processing method and apparatus, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/087296 WO2020228031A1 (en) | 2019-05-16 | 2019-05-16 | Instruction processing method and apparatus, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020228031A1 true WO2020228031A1 (en) | 2020-11-19 |
Family
ID=73289996
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/087296 WO2020228031A1 (en) | 2019-05-16 | 2019-05-16 | Instruction processing method and apparatus, electronic device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113330424B (en) |
WO (1) | WO2020228031A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116389635A (en) * | 2023-03-20 | 2023-07-04 | 深圳市正浩创新科技股份有限公司 | Control method, computer-readable storage medium, and terminal |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113805490A (en) * | 2021-09-13 | 2021-12-17 | 珠海格力电器股份有限公司 | Device control method, system, apparatus, device and storage medium |
CN113986164A (en) * | 2021-09-26 | 2022-01-28 | 深圳市酷开网络科技股份有限公司 | Multi-screen interaction method based on data stream, computer equipment and storage medium |
CN114260897A (en) * | 2021-12-24 | 2022-04-01 | 达闼科技(北京)有限公司 | Authority management method, robot and readable storage medium |
CN118740881A (en) * | 2023-03-31 | 2024-10-01 | 比亚迪股份有限公司 | Vehicle remote management method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101101649A (en) * | 2006-03-09 | 2008-01-09 | 英图特有限公司 | Method and system for managing data in a workflow process |
CN101291251A (en) * | 2008-05-09 | 2008-10-22 | 国网信息通信有限公司 | Synchronized control method and system for multicomputer |
CN107423062A (en) * | 2017-07-12 | 2017-12-01 | 珠海格力电器股份有限公司 | Projector control method and device |
CN108984312A (en) * | 2017-06-02 | 2018-12-11 | 伊姆西Ip控股有限责任公司 | The method and apparatus of reading and writing data |
CN109240823A (en) * | 2018-08-10 | 2019-01-18 | 北京小蓦机器人技术有限公司 | The method, apparatus and readable storage medium storing program for executing of multiterminal linkage processing task |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7197702B2 (en) * | 2003-06-13 | 2007-03-27 | Microsoft Corporation | Web page rendering mechanism using external programmatic themes |
JPWO2006011343A1 (en) * | 2004-07-28 | 2008-05-01 | 松下電器産業株式会社 | Conflict resolution device |
JP4527129B2 (en) * | 2007-03-22 | 2010-08-18 | 日本電信電話株式会社 | Scenario execution method and scenario server device |
CN107289581A (en) * | 2017-06-01 | 2017-10-24 | 珠海格力电器股份有限公司 | Air conditioner control method, device and system |
CN107248943B (en) * | 2017-07-06 | 2020-09-01 | 海信集团有限公司 | Equipment control method and device |
-
2019
- 2019-05-16 WO PCT/CN2019/087296 patent/WO2020228031A1/en active Application Filing
- 2019-05-16 CN CN201980089725.3A patent/CN113330424B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101101649A (en) * | 2006-03-09 | 2008-01-09 | 英图特有限公司 | Method and system for managing data in a workflow process |
CN101291251A (en) * | 2008-05-09 | 2008-10-22 | 国网信息通信有限公司 | Synchronized control method and system for multicomputer |
CN108984312A (en) * | 2017-06-02 | 2018-12-11 | 伊姆西Ip控股有限责任公司 | The method and apparatus of reading and writing data |
CN107423062A (en) * | 2017-07-12 | 2017-12-01 | 珠海格力电器股份有限公司 | Projector control method and device |
CN109240823A (en) * | 2018-08-10 | 2019-01-18 | 北京小蓦机器人技术有限公司 | The method, apparatus and readable storage medium storing program for executing of multiterminal linkage processing task |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116389635A (en) * | 2023-03-20 | 2023-07-04 | 深圳市正浩创新科技股份有限公司 | Control method, computer-readable storage medium, and terminal |
Also Published As
Publication number | Publication date |
---|---|
CN113330424B (en) | 2024-07-02 |
CN113330424A (en) | 2021-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020228031A1 (en) | Instruction processing method and apparatus, electronic device and storage medium | |
CN110831112B (en) | Network connection method, intelligent household equipment, intelligent gateway and electronic equipment | |
EP3640936B1 (en) | Apparatus control device, method, and apparatus having same | |
US11782590B2 (en) | Scene-operation method, electronic device, and non-transitory computer readable medium | |
CN112584364B (en) | Bluetooth network, communication method, device and storage medium thereof | |
CN110839271B (en) | Equipment connection method, system, platform and corresponding equipment | |
CN109525540B (en) | Intelligent device binding method and device | |
CN109617731A (en) | Adaptive gateway role configuration method and device under a kind of multi-gateway environment | |
CN109725540B (en) | Equipment control method and device, electronic equipment and storage medium | |
CN109617963B (en) | Equipment control method and device and Internet of things system | |
WO2020228040A1 (en) | Smart home system control method and apparatus, electronic device and storage medium | |
CN113572799B (en) | Method and device for accessing equipment to control platform and server | |
CN109753034B (en) | Control method, control device, electronic equipment and storage medium | |
CN113225744B (en) | Intelligent device ad hoc network method, intelligent networking system and storage medium | |
CN106453427A (en) | Smart home center control server | |
CN109787843B (en) | Network distribution method, device and equipment of intelligent equipment and storage medium | |
CN112596406A (en) | Control method and device of intelligent equipment, control panel and storage medium | |
CN110677899A (en) | Data transmission method and device, terminal equipment and storage medium | |
WO2020228027A1 (en) | Device control method, apparatus, electronic device, and storage medium | |
WO2020224505A1 (en) | Method and apparatus for determining target object | |
CN109981424B (en) | Linkage scheme processing method and device, electronic equipment and storage medium | |
CN115277280A (en) | Control method of intelligent household equipment and control method of server | |
CN106657048A (en) | Improved smart home center control server | |
CN112616176A (en) | Wake-up method and device and control method and device of equipment | |
WO2024016539A1 (en) | Device control method and apparatus, and storage medium and electronic apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19928453 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 26/04/2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19928453 Country of ref document: EP Kind code of ref document: A1 |