Legal claims defining the scope of protection, as filed with the USPTO.
1. A method for processing a task in a smart device, comprising: transmitting, from the smart device to a server, event information including voice input obtained from the smart device, via sustained reusable communication link; receiving service information that has been generated by the server based on the event information, the service information comprising task description information in a predetermined data format and voice information in binary stream format; analyzing the service information based on the predetermined data format to obtain a task attribute and an attribute value; generating a to-be-processed task by encapsulating the obtained task attribute and attribute value; arranging the to-be-processed task into a to-be-processed task queue; and processing a plurality of to-be-processed tasks in the to-be-processed task queue based on a type of the to-be-processed task queue and attribute of the to-be-processed task, the type of the to-be-processed task queue being a concurrent task queue or a serial task queue, wherein the processing includes: (i) implementing a first thread pool having a predetermined number of threads for concurrently processing a plurality of the to-be-processed tasks in the to-be-processed task queue, and (ii) dynamically adjusting the number of the threads in the first thread pool based on the number of the to-be-processed tasks in the to-be-processed task queue and an idle duration of the threads.
2. The method according to claim 1 , wherein the to-be-processed task queue is a concurrent task queue, and the processing a plurality of to-be-processed tasks in the to-be-processed task queue comprises: adding, in response to the to-be-processed task queue being unempty and an idle thread existing in a first thread pool, at least a part of the to-be-processed tasks in the to-be-processed task queue to the first thread pool, wherein a number of the to-be-processed tasks in the at least a part of the to-be-processed tasks is less than or equal to a number of the idle threads in the first thread pool; and removing the at least a part of the to-be-processed tasks from the to-be-processed task queue after completing executing the at least a part of the to-be-processed tasks.
3. The method according to claim 1 , wherein the to-be-processed task queue is a serial task queue, and the processing a plurality of to-be-processed tasks in the to-be-processed task queue comprises: using, in response to an absence of the to-be-processed tasks being executed and the serial task queue being unempty, the to-be-processed task at a head of the serial task queue as a first task and executing following serial processing: executing the first task, and removing the first task from the serial task queue after completing the executing the first task; and using, in response to the serial task queue being unempty, the to-be-processed task at the head of the serial task queue as the first task, and continuing executing the serial processing.
4. The method according to claim 1 , wherein the event information further comprises state change information regarding the change of the operation status of the smart device when executing the to-be-processed tasks.
5. The method according to claim 4 , wherein the event information is sent to the server by following: generating a to-be-uploaded event based on the event information; arranging the to-be-uploaded event into a to-be-uploaded event queue; and sending a plurality of to-be-uploaded events in the to-be-uploaded event queue to the server in a predetermined data format.
6. The method according to claim 5 , wherein the sending a plurality of to-be-uploaded events in the to-be-uploaded event queue to the server in the predetermined data format comprises: adding, in response to the to-be-uploaded event queue being unempty and an idle thread existing in a second thread pool, at least a part of the to-be-uploaded events in the to-be-uploaded event queue to the second thread pool, wherein a number of the to-be-uploaded events in the at least a part of the to-be-uploaded events is less than or equal to a number of idle threads in the second thread pool; and removing the at least a part of the to-be-uploaded events from the to-be-uploaded event queue after completing executing the at least a part of the to-be-uploaded events.
7. An apparatus for processing a task in a smart device, comprising: at least one processor; and a memory storing instructions, the instructions when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising: transmitting, from the smart device to a server, event information including voice input obtained from the smart device, via sustained reusable communication link; receiving service information that has been generated by the server based on the event information, the service information comprising task description information in a predetermined data format and voice information in binary stream format; analyzing the service information based on the predetermined data format to obtain a task attribute and an attribute value; generating a to-be-processed task by encapsulating the obtained task attribute and attribute value; arranging the to-be-processed task into a to-be-processed task queue; and processing a plurality of to-be-processed tasks in the to-be-processed task queue based on a type of the to-be-processed task queue and attribute of the to-be-processed task, the type of the to-be-processed task queue being a concurrent task queue or a serial task queue, wherein the processing includes: (i) implementing a first thread pool having a predetermined number of threads for concurrently processing a plurality of the to-be-processed tasks in the to-be-processed task queue, and (ii) dynamically adjusting the number of the threads in the first thread pool based on the number of the to-be-processed tasks in the to-be-processed task queue and an idle duration of the threads.
8. The apparatus according to claim 7 , wherein the to-be-processed task queue is a concurrent task queue, and the processing a plurality of to-be-processed tasks in the to-be-processed task queue comprises: adding, in response to the to-be-processed task queue being unempty and an idle thread existing in a first thread pool, at least a part of the to-be-processed tasks in the to-be-processed task queue to the first thread pool, wherein a number of the to-be-processed tasks in the at least a part of the to-be-processed tasks is less than or equal to a number of the idle threads in the first thread pool; and removing the at least a part of the to-be-processed tasks from the to-be-processed task queue after completing executing the at least a part of the to-be-processed tasks.
9. The apparatus according to claim 7 , wherein the to-be-processed task queue is a serial task queue, and the processing a plurality of to-be-processed tasks in the to-be-processed task queue comprises: using, in response to an absence of the to-be-processed tasks being executed and the serial task queue being unempty, the to-be-processed task at a head of the serial task queue as a first task and executing following serial processing: executing the first task, and removing the first task from the serial task queue after completing the executing the first task; and using, in response to the serial task queue being unempty, the to-be-processed task at the head of the serial task queue as the first task, and continuing executing the serial processing.
10. The apparatus according to claim 7 , wherein the event information further comprises state change information regarding the change of the operation status of the smart device when executing the to-be-processed tasks.
11. The apparatus according to claim 10 , wherein the event information is sent to the server by following: generating a to-be-uploaded event based on the event information; arranging the to-be-uploaded event into a to-be-uploaded event queue; and sending a plurality of to-be-uploaded events in the to-be-uploaded event queue to the server in a predetermined data format.
12. The apparatus according to claim 11 , wherein the sending a plurality of to-be-uploaded events in the to-be-uploaded event queue to the server in the predetermined data format comprises: adding, in response to the to-be-uploaded event queue being unempty and an idle thread existing in a second thread pool, at least a part of the to-be-uploaded events in the to-be-uploaded event queue to the second thread pool, wherein a number of the to-be-uploaded events in the at least a part of the to-be-uploaded events is less than or equal to a number of idle threads in the second thread pool; and removing the at least a part of the to-be-uploaded events from the to-be-uploaded event queue after completing executing the at least a part of the to-be-uploaded events.
13. A smart device, comprising: one or more processors; and a memory, for storing one or more programs, wherein the one or more programs enable, when executed by the one or more processors, the one or more processors to implement operations, the operations comprising: transmitting, from the smart device to a server, event information including voice input obtained from the smart device, via sustained reusable communication link; receiving service information that has been generated by the server based on the event information, the service information comprising task description information in a predetermined data format and voice information in binary stream format; analyzing the service information based on the predetermined data format to obtain a task attribute and an attribute value; generating a to-be-processed task by encapsulating the obtained task attribute and attribute value; arranging the to-be-processed task into a to-be-processed task queue; and processing a plurality of to-be-processed tasks in the to-be-processed task queue based on a type of the to-be-processed task queue and attribute of the to-be-processed task, the type of the to-be-processed task queue being a concurrent task queue or a serial task queue, wherein the processing includes: (i) implementing a first thread pool having a predetermined number of threads for concurrently processing a plurality of the to-be-processed tasks in the to-be-processed task queue, and (ii) dynamically adjusting the number of the threads in the first thread pool based on the number of the to-be-processed tasks in the to-be-processed task queue and an idle duration of the threads.
14. A non-transitory computer-readable storage medium storing a computer program, the computer program when executed by one or more processors, causes the one or more processors to perform the method according to claim 1 .
Unknown
November 30, 2021
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.