CN113032010B - Command transmission control method, terminal and computer readable storage medium - Google Patents

Command transmission control method, terminal and computer readable storage medium Download PDF

Info

Publication number
CN113032010B
CN113032010B CN202110267869.2A CN202110267869A CN113032010B CN 113032010 B CN113032010 B CN 113032010B CN 202110267869 A CN202110267869 A CN 202110267869A CN 113032010 B CN113032010 B CN 113032010B
Authority
CN
China
Prior art keywords
command
application
result
queue
layer
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110267869.2A
Other languages
Chinese (zh)
Other versions
CN113032010A (en
Inventor
舒舢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN202110267869.2A priority Critical patent/CN113032010B/en
Publication of CN113032010A publication Critical patent/CN113032010A/en
Application granted granted Critical
Publication of CN113032010B publication Critical patent/CN113032010B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30094Condition code generation, e.g. Carry, Zero flag

Abstract

The invention discloses a command transmission control method, a terminal and a computer readable storage medium, wherein the command transmission control method comprises the following steps: after receiving an application command sent by an application layer, sending the application command to a control layer; adding the application command to a waiting result queue corresponding to the application command; after receiving a command result fed back by a control layer, searching an application command corresponding to the command result in the waiting result queue; and after the application command corresponding to the command result is found in the waiting result queue, sending the command result to the application corresponding to the application command found in the application layer. The invention can solve the technical problem of low command transmission efficiency in the communication process.

Description

Command transmission control method, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a command transmission control method, a terminal, and a computer-readable storage medium.
Background
Currently, a Hardware Abstraction Layer (HAL) and a Micro Control Unit (MCU) in a terminal device such as a watch or a bracelet both adopt a form based on Serial Peripheral Interface (SPI) communication. Each time the HAL receives the feedback information of the MCU, it needs to traverse the commands in the wait result queue to determine the upper layer application that sends the commands and send the feedback information to the upper layer application, but when there are many commands in the wait result queue, the traversal time is long, resulting in low command transmission efficiency during communication.
Disclosure of Invention
The invention mainly aims to provide a command transmission control method, a terminal and a computer readable storage medium, aiming at solving the problem of low command transmission efficiency in the communication process.
In order to achieve the above object, the present invention provides a command transmission control method, including:
after receiving an application command sent by an application layer, sending the application command to a control layer;
adding the application command to a waiting result queue corresponding to the application command;
after receiving a command result fed back by a control layer, searching an application command corresponding to the command result in the waiting result queue;
and after the application command corresponding to the command result is found in the waiting result queue, sending the command result to the application corresponding to the application command found in the application layer.
Optionally, the step of sending the application command to a control layer includes:
packaging the obtained application command;
adding the packaged application command to a queue to be sent;
and when the control layer is in an idle state, sending the application command in the queue to be sent to the control layer.
Optionally, the step of adding the application command to the queue of waiting results corresponding to the application command includes:
acquiring the category of an interface corresponding to the application command;
determining the waiting result queue corresponding to the category;
and adding the application commands in the queue to be sent to the waiting result queue corresponding to the category.
Optionally, after receiving the application command sent by the application layer, the step of sending the application command to the control layer includes:
and creating a command queue, wherein the command queue comprises the queue to be sent and the queue waiting for the result.
Optionally, the step of searching for the application command corresponding to the command result in the wait result queue includes:
analyzing the command result to obtain the category of the command result;
and searching the application command in the waiting result queue corresponding to the category.
Optionally, after receiving the application command sent by the application layer, the step of sending the application command to the control layer includes:
determining the category of each interface;
creating the waiting result queue corresponding to the category according to the category;
associating the category with the waiting result queue.
Optionally, the step of determining the category to which each interface belongs includes:
acquiring the use times and types of each interface;
and classifying the interfaces according to the using times and the types so as to determine the category of each interface.
Optionally, the number of the wait result queues is smaller than the number of the interfaces.
In addition, in order to achieve the above object, the present invention further provides a terminal device, which includes a memory, a processor, and a transmission control program of commands stored in the memory and executable on the processor, wherein the transmission control program of commands implements the steps of the transmission control method of commands described in any one of the above when executed by the processor.
Further, to achieve the above object, the present invention provides a computer-readable storage medium having stored thereon a transmission control program of commands, which when executed by a processor, implements the steps of the transmission control method of commands described in any one of the above.
The invention provides a command transmission control method, a terminal and a computer readable storage medium, wherein after receiving an application command sent by an application layer, the application command is sent to the control layer, the application command is added to a waiting result queue corresponding to the application command, after receiving a command result fed back by the control layer, the waiting result queue corresponding to the command result is searched according to the command result, the application command corresponding to the command result is searched in the waiting result queue, and after the application command corresponding to the command result is searched in the waiting result queue, the command result is sent to an application corresponding to the application command in the application layer. According to the scheme, the application commands sent by the application layer are respectively stored in different waiting result queues, after the fed-back command results are received, the corresponding waiting result queues are searched according to the command results, and as only a part of the application commands sent by the application layer are stored in the searched waiting result queues, but not all the application commands, the queues needing to be traversed are short, the application commands are fewer, the traversing and searching time is shortened, and the problem of low command transmission efficiency in the communication process is solved.
Drawings
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of a hardware architecture of a terminal device according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a command transmission control method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a command transmission control method according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of a command transmission control method according to the present invention;
FIG. 5 is a flowchart illustrating a fourth embodiment of a command transmission control method according to the present invention;
fig. 6 is a flowchart illustrating a fifth embodiment of a command transmission control method according to the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: after receiving an application command sent by an application layer, sending the application command to the control layer, adding the application command to a waiting result queue corresponding to the application command, after receiving a command result fed back by the control layer, searching the waiting result queue corresponding to the command result according to the command result, searching the application command corresponding to the command result in the waiting result queue, and after searching the application command corresponding to the command result in the waiting result queue, sending the command result to an application corresponding to the application command in the application layer. According to the scheme, the application commands sent by the application layer are respectively stored in different waiting result queues, after the fed-back command results are received, the corresponding waiting result queues are searched according to the command results, and as only a part of the application commands sent by the application layer are stored in the searched waiting result queues, but not all the application commands, the queues needing to be traversed are short, the application commands are fewer, the traversing and searching time is shortened, and the problem of low command transmission efficiency in the communication process is solved.
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
For better understanding of the above technical solutions, the following detailed descriptions will be provided in conjunction with the drawings and the detailed description of the embodiments.
As shown in fig. 1, fig. 1 is a schematic diagram of a hardware architecture of a terminal device according to an embodiment of the present invention.
As shown in fig. 1, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a non-volatile memory), such as a disk memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the terminal device shown in fig. 1 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system and a transmission control program of commands.
In the terminal device shown in fig. 1, the processor 1001 may be configured to call a transmission control program of a command stored in the memory 1005, and perform the following operations:
after receiving an application command sent by an application layer, sending the application command to a control layer;
adding the application command to a waiting result queue corresponding to the application command;
after receiving a command result fed back by a control layer, searching an application command corresponding to the command result in the waiting result queue;
and after the application command corresponding to the command result is found in the waiting result queue, sending the command result to the application corresponding to the application command found in the application layer.
Further, the processor 1001 may call a transfer control program of the command stored in the memory 1005, and also perform the following operations:
packaging the obtained application command;
adding the packaged application command to a queue to be sent;
and when the control layer is in an idle state, sending the application command in the queue to be sent to the control layer.
Further, the processor 1001 may call a transfer control program of the command stored in the memory 1005, and also perform the following operations:
acquiring the category of an interface corresponding to the application command;
determining the waiting result queue corresponding to the category;
and adding the application commands in the queue to be sent to the waiting result queue corresponding to the category.
Further, the processor 1001 may call a transfer control program of the command stored in the memory 1005, and also perform the following operations:
and creating a command queue, wherein the command queue comprises the queue to be sent and the queue waiting for the result.
Further, the processor 1001 may call a transfer control program of the command stored in the memory 1005, and also perform the following operations:
analyzing the command result to obtain the category of the command result;
and searching the application command in the waiting result queue corresponding to the category.
Further, the processor 1001 may call a transfer control program of the command stored in the memory 1005, and also perform the following operations:
determining the category of each interface;
creating the waiting result queue corresponding to the category according to the category;
associating the category with the wait for result queue.
Further, the processor 1001 may call a transfer control program of the command stored in the memory 1005, and also perform the following operations:
acquiring the use times and types of each interface;
and classifying the interfaces according to the using times and the types so as to determine the category of each interface.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a command transmission control method according to the present invention, where the command transmission control method includes the following steps:
step S10, after receiving the application command sent by the application layer, sending the application command to the control layer;
in this embodiment, the method for controlling command transmission according to the present invention can be applied to a terminal device, where the terminal device is a hardware device having a computer infrastructure, and the computer infrastructure can be described by using a von neumann structure, that is, the computer infrastructure includes an arithmetic logic unit, a control circuit, a memory, and an input/output device, such as a smart watch, a smart bracelet, or a smart phone.
In this embodiment, the terminal device includes an application Layer, an HAL (Hardware Abstraction Layer) and an MCU (micro controller Unit), where the MCU is also called a control Layer, the application Layer is a Layer for storing functional applications, the application Layer includes various functional applications APP, and the application Layer can generate an application command and send the application command through a call interface; the hardware abstraction layer is an interface layer positioned between an operating system kernel and a hardware circuit, and is provided with a service platform which can provide various services of the hardware abstraction layer, such as the service of providing an interface and the service of processing or forwarding an application command; the control layer is a data processing and control center and can process application commands to generate command results. The application layer is in communication connection with the hardware abstraction layer, the hardware abstraction layer is in communication connection with the control layer, namely the application layer and the hardware abstraction layer can interact with each other, the hardware abstraction layer and the control layer can interact with each other, the application layer and the control layer interact with each other through the hardware abstraction layer, in an actual application scene, the application layer generates an application command, the application command is sent to a service platform of the hardware abstraction layer through an interface provided by the service platform of the hardware abstraction layer, the application command is sent to the control layer after the application command is processed by the service platform of the hardware abstraction layer, a command result corresponding to the application command is generated after the control layer receives the application command, and the command result is fed back to the application layer through the service platform of the hardware abstraction layer to issue the application of the application command.
In this embodiment, the application command is an instruction issued by an application in the application layer, the application commands corresponding to different applications in the application layer are different, and the same application may also issue different application commands, for example, for a sports-type function application, it may issue a command for checking a duration of a movement, it may also issue a command for setting a type of a movement, and for a system time function application, it may issue a command for checking a system time. In this embodiment, a service platform of a hardware abstraction layer in the terminal device receives an application command sent by an application layer, and sends the application command to a control layer.
Specifically, under the trigger operation of a user, an application in an application layer generates an application command, a service platform of a hardware abstraction layer provides an interface for the application layer, the application layer calls the interface provided by the service platform of the hardware abstraction layer, the generated application command is sent to the service platform of the hardware abstraction layer through the interface, and the service platform of the hardware abstraction layer receives the application command sent by the application layer and sends the received application command to a control layer.
Step S20, adding the application command to a waiting result queue corresponding to the application command;
in this embodiment, the waiting result queue is a command queue for storing the application command, the application command stored in the waiting result queue is the application command that has been sent to the control layer, and the waiting control layer feeds back the command result. The waiting result queue is created by a service platform of a hardware abstraction layer, the waiting result queue comprises a plurality of queues, each queue corresponds to a number or a name, the types of the application commands stored in different queues are different, for example, a certain queue stores application commands related to a motion class, and another queue stores application commands related to a system class, that is, the application commands have a corresponding relationship with the queue, the application commands of different classes are stored in different queues, and each queue stores a plurality of application commands, the application commands may be the same application command or different application commands belonging to the same class. And after the service platform of the hardware abstraction layer sends the received application command to the control layer, the application command sent to the control layer is added to a waiting result queue corresponding to the application command.
Specifically, the service platform of the hardware abstraction layer creates a plurality of waiting result queues before receiving the application command sent by the application layer, determines the category of the application command after sending the received application command to the control layer, and adds the application command to the corresponding waiting result queue according to the category of the application command.
Step S30, after receiving the command result fed back by the control layer, searching the application command corresponding to the command result in the waiting result queue;
in this embodiment, the command result is a processing result of the control layer on the application command, for example, for an application command for viewing the system time, the command result is the system time queried by the control layer according to the application command. The command results correspond to the application commands one to one. And after receiving the command result fed back by the control layer, the service platform of the hardware abstraction layer searches the application command corresponding to the command result in the waiting result queue.
Specifically, after the service platform of the hardware abstraction layer sends the received application command to the control layer, the control layer generates a command result according to the received application command, and feeds the command result back to the service platform of the hardware abstraction layer. After receiving the command result, the service platform of the hardware abstraction layer finds a waiting result queue corresponding to the command result, and traverses the application commands in the waiting result queue to find the application commands corresponding to the command result.
Step S40, after finding the application command corresponding to the command result in the waiting result queue, sending the command result to the application corresponding to the application command found in the application layer.
In this embodiment, after the application command corresponding to the command result is found in the waiting result queue, the command result is sent to the application corresponding to the application command found in the application layer. For example, the application command for checking the system time is issued by the system time function application, the application command is stored in a waiting result queue, the command result is the system time searched by the control layer, the control layer generates the command result of the application command after the system time is searched, the command result is fed back to the service platform of the hardware abstraction layer, the service platform of the hardware abstraction layer finds the corresponding waiting result queue according to the command result, the application command for checking the system time is searched in the waiting result queue, and after the application command for checking the system time is found, the command result, that is, the searched system time is sent to the system time function application in the application layer.
In the technical scheme provided by this embodiment, after receiving an application command sent by an application layer, the application command is sent to the control layer, the application command is added to a waiting result queue corresponding to the application command, after receiving a command result fed back by the control layer, a waiting result queue corresponding to a command result is searched according to the command result, the application command corresponding to the command result is searched in the waiting result queue, and after finding the application command corresponding to the command result in the waiting result queue, the command result is sent to an application corresponding to the application command in the application layer. According to the scheme, the application commands sent by the application layer are respectively stored in different waiting result queues, after the fed-back command results are received, the corresponding waiting result queues are searched according to the command results, and as only a part of the application commands sent by the application layer are stored in the searched waiting result queues, but not all the application commands, the queues needing to be traversed are short, the application commands are fewer, the traversing and searching time is shortened, and the problem of low command transmission efficiency in the communication process is solved.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of the command transmission control method according to the present invention, wherein based on the first embodiment, the step of S10 includes:
step S11, after receiving the application command sent by the application layer, packaging the obtained application command;
in this embodiment, the attributes and implementation details of the application command are encapsulated or hidden, the interface is only exposed to the outside, the access level of reading and modifying the attributes in the program is controlled, and the abstracted data and behaviors (or functions) are combined to form an organic whole, that is, the data and the source code of the operation data are organically combined.
In this embodiment, after receiving an application command sent by an application layer, a service platform of a hardware abstraction layer encapsulates the obtained application command to hide partial attributes or details of the application command, and on one hand, encapsulating the application command can improve the security and privacy of the application command, and on the other hand, integrating the application command for facilitating transmission.
Step S12, adding the packaged application command to a queue to be sent;
in this embodiment, the queue to be sent is a command queue for storing application commands that are not yet sent to the control layer, and the queue to be sent is also created by a service platform of the hardware abstraction layer. Before receiving an application command sent by an application layer, a service platform of a hardware abstraction layer creates a plurality of waiting result queues and a queue to be sent.
Specifically, after receiving an application command sent by an application layer and encapsulating the application command, a service platform of a hardware abstraction layer adds the encapsulated application command to a queue to be sent for storage.
Step S13, when the control layer is in an idle state, sending the application command in the queue to be sent to the control layer.
In this embodiment, the control layer being in the idle state refers to a state where the control layer completes one read/write task, and the control layer being in the idle state indicates that the control layer completes processing operation on a previous application command and can perform processing on a next application command.
In this embodiment, when the service platform of the hardware abstraction layer adds the encapsulated application command to the queue to be sent and the control layer is in an idle state, the service platform of the hardware abstraction layer sends the application command in the queue to be sent to the control layer, so that the control layer generates a command result according to the application command. The application command of the queue to be sent is sent to the control layer through a Serial Peripheral Interface (SPI), which is a synchronous Serial Interface technology and is a high-speed, full-duplex, synchronous communication bus.
And after the service platform of the hardware abstraction layer sends the application commands in the queue to be sent to the control layer, adding the application commands to a waiting result queue to wait for the command results of the application commands.
In the technical scheme provided by this embodiment, the obtained application command is encapsulated, the encapsulated application command is added to the queue to be sent, and when the control layer is in an idle state, the application command in the queue to be sent is sent to the control layer. Therefore, according to the scheme, the application commands are packaged, so that the safety in the transmission process of the application commands is improved, and meanwhile, when the control layer is in an idle state, the application commands in the queue to be sent are sent to the control layer, so that the control layer is prevented from receiving a plurality of application commands at the same time, and the normal work of the control layer is ensured.
Referring to fig. 4, fig. 4 is a flowchart illustrating a third embodiment of the command transmission control method according to the present invention, and based on the second embodiment, the step of S20 includes:
step S21, obtaining the category of the interface corresponding to the application command;
in this embodiment, the class to which the interface belongs is a classification group in which the service platform of the hardware abstraction layer provides the interface, which is provided by the application layer and transmits the current application command, to which the interfaces provided by the service platform of the hardware abstraction layer belong, that is, each interface provided by the service platform of the hardware abstraction layer corresponds to a class, for example, the interface transmitting the application instruction of the motion class corresponds to the class belonging to the motion class. It should be noted that one interface may correspond to one category, or multiple interfaces may correspond to one category, for example, for a certain common interface, the interface may be categorized into one category, and for an interface that is not common, multiple interfaces that are not common may be categorized into one category. The interface categories may be named by name or numbered by number, i.e. each interface category has a name or number.
Specifically, after the service platform of the hardware abstraction layer receives the application command of the application layer and sends the application command to the control layer, the service platform of the hardware abstraction layer automatically acquires the category to which the interface for transmitting the application command belongs.
Step S22, determining the waiting result queue corresponding to the category;
in this embodiment, each interface type corresponds to a waiting result queue, and an application command transmitted through an interface in the interface type is sent to the control layer and then added to the waiting result queue corresponding to the interface type. The application commands transmitted by a certain interface are fixedly stored in a certain fixed waiting result queue, and cannot be destroyed after the waiting result queue is established. The time to find the waiting result queue according to the interface can be saved.
Specifically, after the service platform of the hardware abstraction layer obtains the class of the interface corresponding to the application command, the service platform determines a waiting result queue corresponding to the class according to the class of the interface of the application command.
Step S23, add the application command in the queue to be sent to the queue of waiting results corresponding to the category.
In this embodiment, after the service platform of the hardware abstraction layer determines the waiting result queue corresponding to the interface type, the application command in the queue to be sent is added to the waiting result queue corresponding to the interface type.
In the technical scheme provided by this embodiment, after the service platform of the hardware abstraction layer receives the application command of the application layer and sends the application command to the control layer, the waiting result queue corresponding to the category is determined by obtaining the category to which the interface corresponding to the application command belongs, and the application command in the queue to be sent is added to the waiting result queue corresponding to the category. Therefore, the application commands corresponding to a certain interface are stored in the waiting result queues corresponding to the types of the interface, so that the number of the application commands in a single waiting result queue is similar, the situation that too many or too few application commands are stored in a certain waiting result queue is prevented, the traversal time is favorably shortened, and the efficiency is improved.
Referring to fig. 5, fig. 5 is a flowchart illustrating a fourth embodiment of the command transmission control method according to the present invention, where based on the first embodiment, the step of S30 includes:
step S31, after receiving the command result fed back by the control layer, analyzing the command result to obtain the category to which the command result belongs;
in this embodiment, after receiving the command result fed back by the control layer, the service platform of the hardware abstraction layer parses the command result, and by parsing the command result, the type to which the command result belongs may be determined. For example, for the queried command result of the system time, by parsing the command result, the command result can be determined as the category in which the system application is located.
Step S32, searching the waiting result queue corresponding to the category for the application command.
In this embodiment, the type of the command result corresponds to the type of the interface corresponding to the application command, and further, the type of the command result corresponds to the waiting result queue, and the corresponding waiting result queue can be found according to the type of the command result.
Specifically, after the service platform of the hardware abstraction layer obtains the category of the command result, the service platform searches the waiting result queue of the category according to the category of the command result, and after the waiting result queue of the category is found, the service platform traverses the found waiting result queue according to the command result to find the application command corresponding to the command result.
In the technical scheme provided by this embodiment, after the command result fed back by the control layer is received, the class to which the command result belongs is obtained by analyzing the command result, and the application command is searched in the waiting result queue corresponding to the class. Therefore, the waiting result queue is determined firstly, and then the application command is searched, so that the time of single traversal is effectively shortened, meanwhile, invalid repeated traversal can be reduced, and the efficiency is improved.
Referring to fig. 6, fig. 6 is a flowchart illustrating a fifth embodiment of the command transmission control method according to the present invention, and based on the fourth embodiment, the step of S10 includes:
step S50, determining the category of each interface;
in this embodiment, the interfaces called by the application layer are all provided by the service platform of the hardware abstraction layer, and before the service platform of the hardware abstraction layer receives the application command sent by the application layer and sends the application command to the control layer, all the interfaces that can be provided by the service platform of the hardware abstraction layer are obtained, and the interfaces are classified to determine the category to which each interface belongs.
Specifically, the number of times and the type of use of each interface are obtained, and the interfaces are classified according to the number of times and the type of use to determine the category to which each interface belongs. Based on functional application, some interfaces are frequently used and are used for more times, correspondingly transmitted application commands are more, and some interfaces are used for less times and correspondingly transmitted application commands are less in interfaces provided by a service platform of a hardware abstraction layer; or some interfaces often transmit a certain type of command, therefore, the interfaces may be classified according to the number of times of use and the type of the interfaces to determine the category to which each interface belongs, for example, for an interface with a larger number of times of use or an interface often transmitting a certain type of application command, the interface may be independently set as one category, and for an interface with a smaller number of times of use, a plurality of interfaces with a smaller number of times of use may be set as one category.
Step S60, creating the waiting result queue corresponding to the category according to the category;
in this embodiment, after determining the category to which each interface belongs, the service platform of the hardware abstraction layer creates a waiting result queue according to the set category, where each category correspondingly creates a waiting result queue, and each waiting result queue may set a name or a number, and the specific name and number may be determined according to an actual situation, which is not limited in this embodiment.
It should be noted that the number of the created wait result queues is less than the number of the interfaces, the number of the created wait result queues is not too large, and the new application command can be normally stored and the old application command can be returned without causing the new application command to be unable to be stored due to the full queue. The actual number can be confirmed from the actual test results. This embodiment can reduce the time of seeking the result queue of waiting through the number of reasonable control result queue, raises the efficiency, satisfies actual need assurance practicality again simultaneously.
Step S70, associating the category with the waiting result queue.
In this embodiment, after creating the waiting result queues corresponding to the respective categories, the service platform of the hardware abstraction layer associates the categories with the waiting result queues, that is, the waiting result queues corresponding to the categories can be found through the categories.
In the technical solution provided in this embodiment, the service platform of the hardware abstraction layer establishes a waiting result queue corresponding to a category according to the category by determining the category to which each interface belongs, and associates the category with the waiting result queue. Therefore, the method and the device classify the interfaces provided by the service platform of the hardware abstraction layer, create the waiting result queues corresponding to all the classes, and ensure that the application commands in all the waiting result queues are similar in number.
Based on the foregoing embodiment, the present invention further provides a terminal device, where the terminal device may include a memory, a processor, and a transmission control program of a command that is stored in the memory and is executable on the processor, and when the processor executes the transmission control program of the command, the steps of the transmission control method of a command according to any one of the foregoing embodiments are implemented.
Based on the foregoing embodiments, the present invention further provides a computer-readable storage medium, on which a transmission control program of commands is stored, and when the transmission control program of commands is executed by a processor, the steps of the transmission control method of commands according to any one of the foregoing embodiments are implemented.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A transmission control method of a command is applied to a terminal device, the terminal device comprises an application layer, a hardware abstraction layer and a control layer, the hardware abstraction layer provides a service of an interface, processes or forwards an application command, the control layer processes the application command to generate a command result, and the transmission control method of the command comprises the following steps:
after receiving an application command sent by the application layer, sending the application command to the control layer;
acquiring the category of an interface corresponding to the application command;
determining a waiting result queue corresponding to the category;
adding the application commands in the queue to be sent to the waiting result queue corresponding to the category;
after receiving a command result fed back by a control layer, searching an application command corresponding to the command result in the waiting result queue;
and after the application command corresponding to the command result is found in the waiting result queue, sending the command result to the application corresponding to the application command found in the application layer.
2. The method of claim 1, wherein the step of sending the application command to a control layer comprises:
packaging the obtained application command;
adding the packaged application command to the queue to be sent;
and when the control layer is in an idle state, sending the application command in the queue to be sent to the control layer.
3. The method for controlling transmission of commands according to claim 2, wherein the step of sending the application command to the control layer after receiving the application command sent by the application layer comprises:
and creating a command queue, wherein the command queue comprises the queue to be sent and the queue waiting for the result.
4. The method for controlling command transmission according to claim 1, wherein the step of searching the application command corresponding to the command result in the waiting result queue comprises:
analyzing the command result to obtain the category of the command result;
and searching the application command in the waiting result queue corresponding to the category.
5. The method for controlling transmission of commands according to claim 4, wherein the step of sending the application command to the control layer after receiving the application command sent by the application layer comprises:
determining the category of each interface;
creating the waiting result queue corresponding to the category according to the category;
associating the category with the wait for result queue.
6. The method for controlling transmission of commands according to claim 5, wherein the step of determining the category to which each interface belongs comprises:
acquiring the use times and types of each interface;
and classifying the interfaces according to the using times and the types so as to determine the category of each interface.
7. The method for controlling transmission of a command according to any one of claims 1 to 6, wherein the number of the queue of waiting results is smaller than the number of the interfaces.
8. A terminal device comprising a memory, a processor, and a transmission control program of commands stored on the memory and executable on the processor, the transmission control program of commands implementing the steps of the transmission control method of commands according to any one of claims 1 to 7 when executed by the processor.
9. A computer-readable storage medium, characterized in that a transmission control program of commands is stored on the computer-readable storage medium, which when executed by a processor implements the steps of the transmission control method of commands according to any one of claims 1 to 7.
CN202110267869.2A 2021-03-12 2021-03-12 Command transmission control method, terminal and computer readable storage medium Active CN113032010B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110267869.2A CN113032010B (en) 2021-03-12 2021-03-12 Command transmission control method, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110267869.2A CN113032010B (en) 2021-03-12 2021-03-12 Command transmission control method, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN113032010A CN113032010A (en) 2021-06-25
CN113032010B true CN113032010B (en) 2022-09-20

Family

ID=76469893

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110267869.2A Active CN113032010B (en) 2021-03-12 2021-03-12 Command transmission control method, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN113032010B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA1152222A (en) * 1981-05-15 1983-08-16 Jega A. Arulpragasam Cached multiprocessor system with pipeline timing
CN112148387A (en) * 2020-10-14 2020-12-29 中国平安人寿保险股份有限公司 Method and device for preloading feedback information, computer equipment and storage medium
CN112204524A (en) * 2018-05-24 2021-01-08 赛灵思公司 Embedded scheduling of hardware resources for hardware acceleration

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060559B (en) * 2007-05-29 2011-06-22 中兴通讯股份有限公司 A man-machine command queue management system and method
CN101267342B (en) * 2008-04-10 2011-04-13 深圳国人通信有限公司 A polling realization method and device for network management monitoring system
CN102404404B (en) * 2011-09-07 2017-07-28 航天科工仿真技术有限责任公司 A kind of distributed WEB is applied and remote equipment information communication method
EP3194601B1 (en) * 2014-09-16 2021-10-27 Genzyme Corporation Adeno-associated viral vectors for treating myocilin (myoc) glaucoma

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CA1152222A (en) * 1981-05-15 1983-08-16 Jega A. Arulpragasam Cached multiprocessor system with pipeline timing
CN112204524A (en) * 2018-05-24 2021-01-08 赛灵思公司 Embedded scheduling of hardware resources for hardware acceleration
CN112148387A (en) * 2020-10-14 2020-12-29 中国平安人寿保险股份有限公司 Method and device for preloading feedback information, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
《Model order reduction and approximation analysis for control system design》;Mohit Garg;《2017 4th International Conference on Signal Processing, Computing and Control (ISPCC)》;20171231;第473页-第476页 *
《网络监控系统控制命令传输方案的设计》;徐佳健;《浙江工业大学信息工程学院》;20121015(第5期);第171页-第174页 *

Also Published As

Publication number Publication date
CN113032010A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
CN107729139B (en) Method and device for concurrently acquiring resources
US7877091B2 (en) Method and system for executing a container managed application on a processing device
US10303529B2 (en) Protocol for communication of data structures
CN111221630B (en) Business process processing method, device, equipment, readable storage medium and system
CN113448756B (en) Inter-process communication system and method and computing device
CN111258565A (en) Method, system, server and storage medium for generating small program
CN110851248A (en) Asynchronous task data processing method and device and computer readable storage medium
CN112395107A (en) Tax control equipment control method and device, storage medium and electronic equipment
CN107977260B (en) Task submitting method and device
CN110674205B (en) Single table query method, device, terminal and readable storage medium
CN111736923A (en) Data processing method and device, electronic equipment and readable storage medium
US20220245080A1 (en) Method for communication of a componentized application, computing device and computer storage medium
CN108845800B (en) Method, device, equipment and storage medium for realizing component extension function
CN113032010B (en) Command transmission control method, terminal and computer readable storage medium
CN101819524B (en) Access method of RFID (Radio Frequency Identification Device) reader and interface driving device thereof
CN108595160B (en) Method and storage medium for calling native object by JS
US9659041B2 (en) Model for capturing audit trail data with reduced probability of loss of critical data
CN113626001A (en) API dynamic editing method and device based on script
CN112817600A (en) Program annotation compiling method and corresponding device, equipment and medium
CN108804236B (en) AIDL file sharing method and system
CN117076149A (en) Inter-process communication method and related equipment
US20110247009A1 (en) Distributing events between an integrated development environment process and another process
CN115437804A (en) Message service processing method, device, equipment and storage medium
CN115373638A (en) Data processing method, device and equipment for front end and back end and storage medium
CN117749857A (en) Communication method and device of client and server and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant