Method and apparatus for sending control instructions, storage medium, and electronic device

By determining the time when the device processes control commands in the intelligent device control, caches and sends control commands in turn, the problem of the user's rapid issuance of multiple commands caused by slow response from the device, and the user experience is improved.

CN115616930BActive Publication Date: 2025-06-27HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211350532.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-31
Publication Date
2025-06-27
Estimated Expiration
2042-10-31

AI Technical Summary

Technical Problem

In intelligent device control, users issue multiple control commands of the same type in a short time, resulting in the device being unable to respond in a timely manner, affecting the user experience.

Method used

By determining the target processing time for the target device to process the target type control instruction, multiple control instructions are cached, and partial control instructions are sent to the target device in sequence according to the time.

Benefits of technology

It effectively solves the problem of slow equipment response, allowing the equipment to respond to user control instructions in a timely manner, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115616930B_ABST
    Figure CN115616930B_ABST
Patent Text Reader

Abstract

The present application discloses a method and apparatus for sending control instructions, a storage medium, and an electronic device, relating to the technical field of smart homes. The method for sending control instructions includes: during the process of continuously sending multiple control instructions by a target component of a target application for a target object, determining a target processing time for a target device to process control instructions of a target type, where the multiple control instructions are all used to control the target device and the types of the control instructions are all the target type; and sequentially sending some of the multiple control instructions to the target device according to the target processing time. By adopting the above technical solution, the problem that an application sends multiple control instructions of the same type sent by a user within a short period of time to a device, resulting in the device being unable to respond in time, is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of smart homes. Specifically, it relates to a method and device for sending control instructions, a storage medium, and an electronic device. Background Art

[0002] With the advent of intelligence, more and more devices can be remotely controlled. For example, control instructions can be sent to a device through an application (APP for short) to control the device. However, when controlling the brightness of a light or the sound of a speaker, it is necessary to slide or touch multiple times. As a result, the user will issue many commands in a short period of time, and the APP will send all the commands to the device. However, since the device needs a certain amount of time to respond to the commands, the device response and the operation results displayed on the APP are both slow, resulting in a poor user experience.

[0003] In view of the problem in the related art that the APP sends multiple control instructions of the same type issued by the user in a short period of time to the device, resulting in the device being unable to respond in time.

[0004] Therefore, it is necessary to improve the related art to overcome the above-mentioned defects in the related art. Summary of the Invention

[0005] Embodiments of the present invention provide a method and device for sending control instructions, a storage medium, and an electronic device, so as to at least solve the problem that the APP sends multiple control instructions of the same type issued by the user in a short period of time to the device, resulting in the device being unable to respond in time.

[0006] According to an aspect of the embodiments of the present invention, a method for sending control instructions is provided, including: during the process that a target object continuously issues multiple control instructions through a target component of a target application, determining a target processing time for the target device to process control instructions of a target type, where the multiple control instructions are all used to control the target device and the types of the control instructions are all the target type; and sequentially sending some of the multiple control instructions to the target device according to the target processing time.

[0007] In an exemplary embodiment, determining the target processing time for the target device to process control instructions of the target type includes: determining whether the target application has sent control instructions of the target type to the target device; in the case where it is determined that the target application has sent control instructions of the target type to the target device, determining the average time for the target device to historically process control instructions of the target type as the target processing time; in the case where it is determined that the target application has not sent control instructions of the target type to the target device, sending a first control instruction to the target device, determining the target time for the target device to process the first control instruction, and determining the target time as the target processing time, where the first control instruction is the control instruction earliest sent to the target object among the multiple control instructions.

[0008] In an exemplary embodiment, in the case where the operation log of the target device is obtained, determining the target time for the target device to process the first control instruction includes: determining a first moment when the target device receives the first control instruction from the operation log, and determining a second moment when the target device sends a response message from the operation log, where the response message is a message that needs to be sent to the target application after the target device finishes processing the first control instruction; determining the target time for the target device to process the first control instruction according to the first moment and the second moment.

[0009] In an exemplary embodiment, in the case where the operation log of the target device is not obtained, determining the target time for the target device to process the first control instruction includes: determining a third moment when the target application sends the first control instruction to the target device; determining a fourth moment when the target application receives a response message, where the response message is a message that needs to be sent to the target application after the target device finishes processing the first control instruction; determining the target time for the target device to process the first control instruction according to the third moment and the fourth moment.

[0010] In an exemplary embodiment, before sequentially sending some of the multiple control instructions to the target device according to the target processing time, the method further includes: before determining the target processing time, collecting the control instructions sent to the target object according to a first collection frequency, and caching the collected target control instructions into an instruction sending list; after determining the target processing time, collecting the control instructions sent to the target object according to a second collection frequency, and caching the collected target control instructions into the instruction sending list, where the second collection frequency has a corresponding relationship with the target processing time; sending some of the multiple control instructions to the target device sequentially according to the target processing time includes: sending some of the control instructions in the instruction sending list to the target device sequentially according to the target processing time.

[0011] In an exemplary embodiment, sending some of the control instructions in the instruction sending list to the target device sequentially according to the target processing time includes: repeatedly performing the following operations until the instruction sending list is empty: determining whether the currently to-be-sent control instruction in the instruction sending list is allowed to be sent according to the target processing time; in the case of determining that it is allowed to be sent, sending the currently to-be-sent control instruction to the target application, and determining the next control instruction in the instruction sending list as the currently to-be-sent control instruction; in the case of determining that it is not allowed to be sent, deleting the currently to-be-sent control instruction from the instruction sending list, and determining the next control instruction in the instruction sending list as the currently to-be-sent control instruction.

[0012] In an exemplary embodiment, determining whether a currently to-be-sent control instruction in the instruction sending list is allowed to be sent according to the target processing time includes: determining that the currently to-be-sent control instruction is allowed to be sent when the control instruction of the target type has not been sent before sending the currently to-be-sent control instruction; determining that the currently to-be-sent control instruction is allowed to be sent when the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, and the time interval from the last sending of the control instruction of the target type to the current time is greater than or equal to the target processing time; determining that the currently to-be-sent control instruction is not allowed to be sent when the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, the time interval from the last sending of the control instruction of the target type to the current time is less than the target processing time, and the next control instruction in the instruction sending list is of the target type; determining that the currently to-be-sent control instruction is allowed to be sent when the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, the time interval from the last sending of the control instruction of the target type to the current time is less than the target processing time, and the next control instruction in the instruction sending list is not of the target type.

[0013] According to another aspect of the embodiments of the present invention, there is also provided a control instruction sending device, including: a determining module, configured to determine a target processing time for a target device to process a control instruction of a target type during a process of continuously sending multiple control instructions by a target component of a target application for a target object, where the multiple control instructions are all used to control the target device and the types of the control instructions are all the target type; a sending module, configured to sequentially send some of the multiple control instructions to the target device according to the target processing time.

[0014] According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, where the computer program is configured to execute the above-mentioned control instruction sending method when running.

[0015] According to still another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the above-mentioned processor executes the above-mentioned control instruction sending method through the computer program.

[0016] In the present invention, since the application does not send all multiple control instructions to the target device, but instead sequentially sends some of the multiple control instructions to the target device according to the time when the device processes the control instructions of the target type, the problem that the application sends multiple control instructions of the same type issued by the user in a short time to the device, resulting in the device being unable to respond in time, is solved. As a result, the device can respond to the user's control instructions in time, improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application and, together with the specification, are used to explain the principles of the present application.

[0018] To more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0019] Figure 1 is a schematic diagram of the hardware environment of a method for sending control instructions according to an embodiment of the present application;

[0020] Figure 2 is a flowchart of a method for sending control instructions according to an embodiment of the present invention;

[0021] Figure 3 is a timing diagram of a method for sending control instructions according to an embodiment of the present invention;

[0022] Figure 4 is a structural block diagram (I) of a device for sending control instructions according to an embodiment of the present invention;

[0023] Figure 5 is a structural block diagram (II) of a device for sending control instructions according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] In order to enable those skilled in the art of the present technology to better understand the solutions of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying 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 the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] According to one aspect of an embodiment of the present application, a method for sending a control instruction is provided. The method for sending a control instruction is widely used in smart home (Smart Home), smart home, smart home device ecology, smart house (IntelligenceHouse) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned method for sending a control instruction can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0027] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0028] To solve the above problems, in this embodiment, a method for sending control instructions is provided, including but not limited to being applied in a target application. Figure 2 FIG. is a flowchart of the method for sending control instructions according to an embodiment of the present invention. The process includes the following steps:

[0029] Step S202, during the process of continuously sending multiple control instructions by a target component of a target application to a target object, determine the target processing time for the target device to process control instructions of a target type, where the multiple control instructions are all used to control the target device and the types of the control instructions are all the target type.

[0030] It should be noted that the target application is an application used to control a target device, and the target device includes but is not limited to the above-mentioned intelligent device 102. The target object is a user who uses the target application to control the target device. The above-mentioned target component is a component for the target application to control the target device to complete a target function; the target function includes but is not limited to volume adjustment, brightness adjustment, etc. The above-mentioned target component can be a sliding box (adjusting volume, brightness, etc. by sliding), or a button (each click increases the volume by one unit, increases the brightness by one unit, etc.). The above-mentioned target type includes but is not limited to the volume adjustment type, the brightness adjustment type; that is, the multiple control instructions are all used to adjust the volume, or are all used to adjust the brightness, etc.

[0031] Step S204, sequentially send some of the multiple control instructions to the target device according to the target processing time.

[0032] It should be noted that the target application can collect each control instruction among the multiple control instructions, and then cache each control instruction into an instruction sending list in sequence. Then, the target application can select some control instructions in the instruction sending list and send them to the target device in sequence according to the target processing time.

[0033] For example, the user slides the target component in the target application within 1 second to adjust the volume from 0 to 100. Then, the target application will collect 100 control instructions, including: Control Instruction 1 (adjust the volume of the target device to 1), Control Instruction 2 (adjust the volume of the target device to 2), Control Instruction 3 (adjust the volume of the target device to 3)... Control Instruction 100 (adjust the volume of the target device to 100). Then, the target application can cache the 100 control instructions into the instruction sending list in sequence.

[0034] In the related art, the target application sequentially sends the control instructions in the instruction sending list to the target device, and then the target device executes them sequentially. However, it takes time for the target device to process the control instructions. Assuming that the target device takes 0.02 seconds to process one instruction, it takes 2 seconds for the target device in the prior art to adjust the volume to 100, resulting in slow response of the target device and poor user experience.

[0035] In the embodiment of the present application, some control instructions in the instruction sending list can be sequentially sent to the target device according to the time for the target device to process the control instructions (such as sending control instructions 1, 3, 5... 100 to the target device), so that the target device can respond and process in time, improving the user experience.

[0036] In the above steps, since the application does not send all the control instructions to the target device, but sequentially sends some of the control instructions in the multiple control instructions to the target device according to the time for the device to process the control instructions of the target type, the problem that the application sends all the multiple control instructions of the same type sent by the user in a short time to the device, resulting in the device being unable to respond in time, is solved, so that the device can respond to the user's control instructions in time and improve the user experience.

[0037] In an exemplary embodiment, the above-mentioned determination of the target processing time for the target device to process the control instructions of the target type can be implemented through the following steps S11 - S13:

[0038] Step S11: Determine whether the target application has sent the control instructions of the target type to the target device;

[0039] That is to say, it is necessary to determine whether the target application has sent the control instructions of the target type to the target device before the target object issues multiple control instructions of the target type through the target component. Specifically, when the first control instruction issued by the target object is obtained, it is necessary to determine whether the target application has previously sent the control instructions of the target type to the target device. For example: assuming that the target type is the volume adjustment type, it is necessary to determine whether the target application has previously sent the control instructions for volume adjustment to the target device.

[0040] Step S12: When it is determined that the target application has sent the control instructions of the target type to the target device, determine the average time for the target device to historically process the control instructions of the target type as the target processing time;

[0041] Step S13: In the case where it is determined that the target application has not sent a control instruction of the target type to the target device, send the first control instruction to the target device, determine the target time for the target device to process the first control instruction, and determine the target time as the target processing time, where the first control instruction is the control instruction earliest sent by the target object among the multiple control instructions (i.e., the control instruction earliest obtained by the target application).

[0042] It should be noted that by adopting the above technical solution, the target processing time for the target device to process a control instruction of the target type can be accurately and timely obtained.

[0043] In an exemplary embodiment, if the target application can obtain the running log of the target device in real time, the target time for the target device to process the first control instruction can be determined through the following steps S21 - S22:

[0044] Step S21: Determine the first moment when the target device receives the first control instruction from the running log, and determine the second moment when the target device sends a response message from the running log, where the response message is the message that the target device needs to send to the target application after processing the first control instruction;

[0045] Step S22: Determine the target time for the target device to process the first control instruction according to the first moment and the second moment.

[0046] Specifically, subtract the first moment from the second moment to obtain the target time for the target device to process the first control instruction.

[0047] It should be noted that by adopting the above technical solution, the time for the target device to process a control instruction of the target type can be very accurately determined.

[0048] In an exemplary embodiment, if the target application does not obtain the running log of the target device, the target time for the target device to process the first control instruction can be determined through the following steps S31 - S33:

[0049] Step S31: Determine the third moment when the target application sends the first control instruction to the target device;

[0050] Step S32: Determine the fourth moment when the target application receives the response message, where the response message is the message that the target device needs to send to the target application after processing the first control instruction;

[0051] Step S33: Determine the target time for the target device to process the first control instruction according to the third moment and the fourth moment.

[0052] Specifically, subtract the third moment from the fourth moment to obtain the target time for the target device to process the first control instruction.

[0053] It should be noted that since the transmission time for the target application to transmit the control instruction to the target device can be ignored compared to the time for the target device to process the control instruction, thus in the case where the target device is not obtained, by adopting the above technical solution, the time for the target device to process the control instruction of the target type can be determined relatively accurately.

[0054] In an exemplary embodiment, before sequentially sending some of the multiple control instructions to the target device according to the target processing time, the following steps S41 - S42 are further included:

[0055] Step S41: Before the target processing time is determined, collect the control instructions issued to the target object according to the first collection frequency, and cache the collected target control instructions into the instruction sending list;

[0056] It should be noted that the first collection frequency is to collect once every x seconds. When the target object issues multiple control instructions through the target application, if the target processing time has not been determined yet, then first collect the control instructions issued by the user at a relatively fast collection frequency (i.e., the first collection frequency). It should be noted that the interval collection time (x seconds) corresponding to the first collection frequency can be greater than the shortest time for the target device to process the instruction.

[0057] Step S42: After the target processing time is determined, collect the control instructions issued to the target object according to the second collection frequency, and cache the collected target control instructions into the instruction sending list, where the second collection frequency has a corresponding relationship with the target processing time;

[0058] It should be noted that the first collection frequency is greater than the second collection frequency. When the target object issues multiple control instructions through the target application, if the target processing time has been determined, then the control instructions issued to the target object can be collected according to the second collection frequency (collect once every y seconds). It should be noted that the target processing time is positively correlated with the second collection frequency, that is, the longer the target processing time, the longer the interval collection time (y seconds) corresponding to the second collection frequency, and the shorter the target processing time, the shorter the interval collection time (y seconds) corresponding to the second collection frequency.

[0059] It should be noted that in this embodiment, collecting the control instructions continuously sent by the user according to the target processing time can avoid collecting too many useless control instructions.

[0060] After performing the above steps S41 - S42, the above step S204 can be implemented in the following manner: According to the target processing time, sequentially send some of the control instructions in the instruction sending list to the target device.

[0061] In an exemplary embodiment, sequentially sending some of the control instructions in the instruction sending list to the target device according to the target processing time can be implemented in the following manner: Repeatedly execute the following steps S51 - S53 until the instruction sending list is empty:

[0062] Step S51: Determine whether the currently to - be - sent control instruction in the instruction sending list is allowed to be sent according to the target processing time;

[0063] Step S52: When it is determined that it is allowed to be sent, send the currently to - be - sent control instruction to the target application, and determine the next control instruction in the instruction sending list as the currently to - be - sent control instruction;

[0064] Step S53: When it is determined that it is not allowed to be sent, delete the currently to - be - sent control instruction from the instruction sending list, and determine the next control instruction in the instruction sending list as the currently to - be - sent control instruction.

[0065] In an exemplary embodiment, the above step S51 can be implemented through the following steps S61 - S64:

[0066] Step S61: When the control instruction of the target type has not been sent before sending the currently to - be - sent control instruction, determine that the currently to - be - sent control instruction is allowed to be sent;

[0067] Step S62: When the control instruction of the target type has been sent before sending the currently to - be - sent control instruction, and the time interval from the last sending of the control instruction of the target type is greater than or equal to the target processing time, determine that the currently to - be - sent control instruction is allowed to be sent;

[0068] It should be noted that if the time interval from the last sending of the control instruction of the target type is greater than or equal to the target processing time, it means that the target device has processed the last - sent control instruction at this time. Furthermore, the target application can send the currently to - be - sent control instruction to the target device at this time.

[0069] Step S63: Determine that the currently to-be-sent control instruction is not allowed to be sent when the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, the time interval since the last sending of the control instruction of the target type is less than the target processing time, and the next control instruction in the instruction sending list is of the target type;

[0070] It should be noted that if the time interval since the last sending of the control instruction of the target type is less than the target processing time, it means that the target device has not finished processing the last sent control instruction at this time. If the target application sends the currently to-be-sent control instruction to the target device at this time, the target device will not be able to process it in time.

[0071] Step S64: Determine that the currently to-be-sent control instruction is allowed to be sent when the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, the time interval since the last sending of the control instruction of the target type is less than the target processing time, and the next control instruction in the instruction sending list is not of the target type.

[0072] It should be noted that if the next control instruction in the instruction sending list is not of the target type, it means that the currently to-be-sent control instruction is already the last control instruction of the target type. Therefore, in order to complete the user's control requirements and ensure the control effect, the currently to-be-sent control instruction must be sent to the target device.

[0073] It should be noted that by adopting the above solution, it can also be avoided that when the user remotely controls the device page switching through the APP, after the user issues multiple commands on page A and then returns to the upper page or enters the secondary page to control other commands of the device. Since the device has not finished processing the multiple commands issued on page A in time, the previous commands will block the latest command, resulting in the device being unable to process the latest issued command, and causing both the APP and the device to respond slowly.

[0074] Obviously, the above-described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. To better understand the above method, the following will describe the above process in conjunction with embodiments, but it is not used to limit the technical solutions of the embodiments of the present invention. Specifically:

[0075] When remotely controlling a device through an APP, it often issues too many commands in a short period of time, and the device response time is long. In order to give users a relatively good user experience and solve the problem that some commands are issued intensively in a short period of time, but the device and APP response times are long, resulting in a poor user experience when controlling intelligent devices. In an optional embodiment, it can be achieved in the following way:

[0076] Specifically,Figure 3 It is a timing diagram of the method for sending control instructions according to an embodiment of the present invention. When the user opens the APP and enters the device details page (for example, the device details page of a smart light), drags the screen component on the device details page to control the device, the device details page will collect the commands sent by the user, and send the collected commands to the device SDK. Then, after the device SDK processes the multiple commands, it will send the commands to the device. After the device performs relevant processing, it will report the data that needs to be reported after processing to the device details page through the device SDK. Then, the user can see the control result on the device details page by refreshing the UI. It should be noted that both the device SDK and the device details page are located in the APP.

[0077] It should be noted that the device SDK can process multiple commands in the following way: that is, determine the command information to be sent to the device according to the device response time (i.e., the above-mentioned target processing time) and the user operation time (i.e., the time required for the user to send multiple commands). Specifically: it is necessary to obtain the time for the device to process this type of command (if it is determined that this command has been sent through the APP, return the time for the device to process this type of command last time; if it is determined that this command has not been sent through the APP, directly send this command and return the time for the device to process this type of command this time). Then, confirm the number of commands to be sent according to the user operation time and the device response time. Specifically, the number of commands to be sent = the user operation time divided by the device response time.

[0078] It should be noted that the collected commands will be cached in the command queue to be sent. When actually sending the commands in the command queue to the device, it will be judged according to the service whether the latest command needs to be sent after the commands in the command queue are sent. If waiting is required, all the commands in the command queue will be sent in sequence. If waiting is not required, all the commands in the command queue will be cleared and the current command will be sent directly.

[0079] In this embodiment, the number of user commands collected needs to be based on the actual response time of the device, so as to avoid a long device response time caused by collecting too many commands during the control process. At the same time, the sending of commands can also be flexibly controlled according to the service, improving the response speed of the APP and the device.

[0080] That is to say, this embodiment collects the commands sent by the user according to the current actual response time of the device, coordinates the time for controlling the device and the device response speed, solves the problem that the device response time is relatively long in the case of the device sending multiple commands, which will bring a bad experience to the user, and enables the user to enjoy remote control of the device while improving the user experience.

[0081] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions for causing a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present invention.

[0082] In this embodiment, a control instruction sending device is further provided. This device is used to implement the above embodiments and preferred implementation manners, and those that have been described will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.

[0083] Figure 4 is a structural block diagram (one) of the control instruction sending device according to an embodiment of the present invention. The device includes:

[0084] A determination module 42, configured to determine the target processing time for the target device to process control instructions of a target type during the process that the target object continuously issues multiple control instructions through a target component of a target application, where the multiple control instructions are all used to control the target device and the control instruction types are all the target type;

[0085] A sending module 44, configured to sequentially send some of the multiple control instructions to the target device according to the target processing time.

[0086] For the above device, since the application does not send all the multiple control instructions to the target device, but sequentially sends some of the multiple control instructions to the target device according to the time for the device to process the control instructions of the target type, the problem that the application sends multiple control instructions of the same type issued by the user within a short time to the device, resulting in the device being unable to respond in time, is solved. Thus, the device can respond to the user's control instructions in time, improving the user experience.

[0087] In an exemplary embodiment, the determination module 42 is further configured to determine whether the target application has sent a control instruction of the target type to the target device; in the case where it is determined that the target application has sent a control instruction of the target type to the target device, determine the average time for the target device to process the control instruction of the target type as the target processing time; in the case where it is determined that the target application has not sent a control instruction of the target type to the target device, send a first control instruction to the target device, determine the target time for the target device to process the first control instruction, and determine the target time as the target processing time, where the first control instruction is the earliest issued control instruction among the multiple control instructions for the target object.

[0088] In an exemplary embodiment, the determination module 42 is further configured to, when obtaining the operation log of the target device, determine the target time for the target device to process the first control instruction in the following manner: determine a first moment when the target device receives the first control instruction from the operation log, and determine a second moment when the target device sends a response message from the operation log, where the response message is a message that needs to be sent to the target application after the target device processes the first control instruction; determine the target time for the target device to process the first control instruction according to the first moment and the second moment.

[0089] In an exemplary embodiment, the determination module 42 is further configured to, when not obtaining the operation log of the target device, determine the target time for the target device to process the first control instruction in the following manner: determine a third moment when the target application sends the first control instruction to the target device; determine a fourth moment when the target application receives a response message, where the response message is a message that needs to be sent to the target application after the target device processes the first control instruction; determine the target time for the target device to process the first control instruction according to the third moment and the fourth moment.

[0090] In an exemplary embodiment, Figure 5It is a structural block diagram (two) of a control instruction sending device according to an embodiment of the present invention. The above device further includes: an acquisition module 46, configured to, before sequentially sending some of the multiple control instructions to the target device according to the target processing time, and before determining the target processing time, acquire the control instructions sent to the target object according to a first acquisition frequency, and cache the acquired target control instructions into an instruction sending list; after determining the target processing time, acquire the control instructions sent to the target object according to a second acquisition frequency, and cache the acquired target control instructions into the instruction sending list, where the second acquisition frequency has a corresponding relationship with the target processing time; a sending module 44, further configured to sequentially send some of the control instructions in the instruction sending list to the target device according to the target processing time.

[0091] In an exemplary embodiment, the sending module 44 is further configured to repeatedly perform the following operations until the instruction sending list is empty: determine whether the currently to-be-sent control instruction in the instruction sending list is allowed to be sent according to the target processing time; in the case of determining that it is allowed to be sent, send the currently to-be-sent control instruction to the target application, and determine the next control instruction in the instruction sending list as the currently to-be-sent control instruction; in the case of determining that it is not allowed to be sent, delete the currently to-be-sent control instruction from the instruction sending list, and determine the next control instruction in the instruction sending list as the currently to-be-sent control instruction.

[0092] In an exemplary embodiment, the sending module 44 is further configured to determine that the currently to-be-sent control instruction is allowed to be sent when the target type of control instruction has not been sent before sending the currently to-be-sent control instruction; determine that the currently to-be-sent control instruction is allowed to be sent when the target type of control instruction has been sent before sending the currently to-be-sent control instruction and the time interval from the last time the target type of control instruction was sent is greater than or equal to the target processing time; determine that the currently to-be-sent control instruction is not allowed to be sent when the target type of control instruction has been sent before sending the currently to-be-sent control instruction, the time interval from the last time the target type of control instruction was sent is less than the target processing time, and the next control instruction in the instruction sending list is of the target type; determine that the currently to-be-sent control instruction is allowed to be sent when the target type of control instruction has been sent before sending the currently to-be-sent control instruction, the time interval from the last time the target type of control instruction was sent is less than the target processing time, and the next control instruction in the instruction sending list is not of the target type.

[0093] An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to execute the steps in any one of the above method embodiments when running.

[0094] Optionally, in this embodiment, the above storage medium may be configured to store a computer program for executing the following steps:

[0095] S1. During the process that a target object continuously issues multiple control instructions through a target component of a target application, determine the target processing time for the target device to process control instructions of a target type, where the multiple control instructions are all used to control the target device and the types of the control instructions are all the target type;

[0096] S2. Send some of the multiple control instructions to the target device in sequence according to the target processing time.

[0097] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to, various media that can store computer programs such as USB flash drives, read-only memories (ROM for short), random access memories (RAM for short), mobile hard disks, magnetic disks, or optical discs.

[0098] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be repeated here.

[0099] An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0100] Optionally, in this embodiment, the above processor may be configured to execute the following steps through a computer program:

[0101] S1. During the process that a target object continuously issues multiple control instructions through a target component of a target application, determine the target processing time for the target device to process control instructions of a target type, where the multiple control instructions are all used to control the target device and the types of the control instructions are all the target type;

[0102] S2. Send some of the multiple control instructions to the target device in sequence according to the target processing time.

[0103] In an exemplary embodiment, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0104] Specific examples in this embodiment may refer to the examples described in the above embodiments and exemplary embodiments, and will not be elaborated herein.

[0105] Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. They can be implemented by program codes executable by the computing device. Thus, they can be stored in a storage device and executed by the computing device. And in some cases, the steps shown or described can be executed in a different order than here, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module to implement. In this way, the present invention is not limited to any specific combination of hardware and software.

[0106] The above is only the preferred embodiment of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A method for sending control instructions, characterized in that, Including: During the process of continuously sending multiple control instructions by a target component of a target application to a target object, determining a target processing time for the target device to process control instructions of a target type, where the multiple control instructions are all used to control the target device and the types of the control instructions are all the target type; Sequentially sending some of the multiple control instructions to the target device according to the target processing time; Wherein, before sequentially sending some of the multiple control instructions to the target device according to the target processing time, the method further includes: before determining the target processing time, collecting the control instructions sent by the target object according to a first collection frequency and caching the collected target control instructions into an instruction sending list; after determining the target processing time, collecting the control instructions sent by the target object according to a second collection frequency and caching the collected target control instructions into the instruction sending list, where the second collection frequency has a corresponding relationship with the target processing time; the first collection frequency is greater than the second collection frequency; Sequentially sending some of the multiple control instructions to the target device according to the target processing time includes: sequentially sending some of the control instructions in the instruction sending list to the target device according to the target processing time.

2. The method for sending a control instruction according to claim 1, wherein Determining the target processing time for the target device to process control instructions of the target type includes: Determining whether the target application has sent control instructions of the target type to the target device; When it is determined that the target application has sent control instructions of the target type to the target device, determining the average time for the target device to historically process control instructions of the target type as the target processing time; When it is determined that the target application has not sent control instructions of the target type to the target device, sending a first control instruction to the target device, determining the target time for the target device to process the first control instruction, and determining the target time as the target processing time, where the first control instruction is the earliest sent control instruction among the multiple control instructions by the target object.

3. The method for sending a control instruction according to claim 2, wherein When the operation log of the target device is obtained, determining the target time for the target device to process the first control instruction includes: Determining a first moment when the target device receives the first control instruction from the operation log, and determining a second moment when the target device sends a response message from the operation log, where the response message is a message that the target device needs to send to the target application after processing the first control instruction; Determining the target time for the target device to process the first control instruction according to the first moment and the second moment.

4. The method for sending a control instruction according to claim 2, wherein When the operation log of the target device is not obtained, determining the target time for the target device to process the first control instruction includes: Determining a third moment when the target application sends the first control instruction to the target device; Determine a fourth moment when the target application receives a response message, where the response message is a message that needs to be sent to the target application after the target device processes the first control instruction; Determine the target time for the target device to process the first control instruction according to the third moment and the fourth moment.

5. The method for sending a control instruction according to claim 1, wherein Send some control instructions in the instruction sending list to the target device in sequence according to the target processing time, including: Repeatedly execute the following operations until the instruction sending list is empty: Determine whether the currently to-be-sent control instruction in the instruction sending list is allowed to be sent according to the target processing time; When it is determined that it is allowed to be sent, send the currently to-be-sent control instruction to the target application, and determine the next control instruction in the instruction sending list as the currently to-be-sent control instruction; When it is determined that it is not allowed to be sent, delete the currently to-be-sent control instruction from the instruction sending list, and determine the next control instruction in the instruction sending list as the currently to-be-sent control instruction.

6. The method for sending a control instruction according to claim 1, wherein Determine whether the currently to-be-sent control instruction in the instruction sending list is allowed to be sent according to the target processing time, including: When the control instruction of the target type has not been sent before sending the currently to-be-sent control instruction, determine that the currently to-be-sent control instruction is allowed to be sent; When the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, and the time interval from the last time the control instruction of the target type was sent is greater than or equal to the target processing time, determine that the currently to-be-sent control instruction is allowed to be sent; When the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, and the time interval from the last time the control instruction of the target type was sent is less than the target processing time, and the next control instruction in the instruction sending list is of the target type, determine that the currently to-be-sent control instruction is not allowed to be sent; When the control instruction of the target type has been sent before sending the currently to-be-sent control instruction, and the time interval from the last time the control instruction of the target type was sent is less than the target processing time, and the next control instruction in the instruction sending list is not of the target type, determine that the currently to-be-sent control instruction is allowed to be sent.

7. A control instruction sending device, characterized in that, Include: A determination module, configured to determine the target processing time for the target device to process the control instruction of the target type during the process of continuously sending multiple control instructions by the target component of the target application through the target object, where the multiple control instructions are all used to control the target device and the control instruction types are all the target type; A sending module, configured to send some control instructions in the multiple control instructions to the target device in sequence according to the target processing time; Wherein, the device further includes: a collection module, configured to collect the control instructions sent to the target object according to a first collection frequency and cache the collected target control instructions into an instruction sending list before sequentially sending some of the multiple control instructions to the target device according to the target processing time and before the target processing time is determined; after the target processing time is determined, collect the control instructions sent to the target object according to a second collection frequency and cache the collected target control instructions into the instruction sending list, wherein the second collection frequency has a corresponding relationship with the target processing time; the first collection frequency is greater than the second collection frequency; wherein, the sending module is further configured to sequentially send some of the control instructions in the instruction sending list to the target device according to the target processing time.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when running, executes the method according to any one of claims 1 to 6.

9. An electronic device, comprising a memory and a processor, characterized in that, A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.

Citation Information

Patent Citations

  • Equipment control method and associated product

    CN107146616A

  • Device control method, device, electronic device, and storage medium

    CN109725540A