AT command processing method, device, terminal and terminal equipment
By matching AT instructions with the hash list and determining the type and parameter information through the target data verification interface, the problem of AT instruction code needs to be developed separately on different platforms is solved, and the virtual call and code reusability of AT instructions are improved.
Patent Information
- Application Number
- CN202211100387.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-08
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2042-09-08
AI Technical Summary
AT instruction codes on different platforms in the prior art need to be developed separately, resulting in poor code reusability, long development cycle and high maintenance.
By matching the received AT instruction with the pre-generated hash list, the target AT instruction is determined, and the type and parameter information of the AT instruction are determined through the target data verification interface, and the AT instruction is then executed.
It realizes virtual call of AT instructions, decouples AT instruction execution and physical serial port, provides a unified and standardized interface, eliminates the platform relevance of business-side code, and improves code reusability and development efficiency.
Smart Images

Figure CN117708036B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to an AT command processing method, device, terminal and terminal equipment. Background Art
[0002] Since the software architectures of various chip vendors are different, the AT command processing methods are different, and the baseband chip standards provided by different vendors are also different, if the AT processing architecture of the same platform is used, the AT command code needs to be rewritten repeatedly on each chip, including the core code and AT logic code on the business side. As a result, it is impossible to standardize AT commands from the root and guarantee the compatibility of AT commands on different modules; at the same time, if the AT processing architecture of different platforms is used, the AT command codes on different platforms need to be developed separately, and the code serving AT commands has poor reusability, a long development cycle, and is difficult to maintain. Summary of the invention
[0003] The purpose of the present invention is to provide an AT command processing method, apparatus, terminal and terminal equipment to solve the problem in the prior art that AT command codes on different platforms need to be developed separately and the code reusability serving AT commands is poor.
[0004] To achieve the above object, an embodiment of the present invention provides an AT command processing method, comprising:
[0005] Matching the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set;
[0006] Determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command;
[0007] According to the type and parameter information of the first AT command, the first AT command is executed, an execution result is obtained, and the execution result is output.
[0008] Furthermore, before matching the received first AT instruction with the hash list, the following steps are included:
[0009] Receive a set of AT commands in a preset format;
[0010] Obtaining prefix information of each AT command in the AT command set of the preset format, and determining an AT feature set according to the prefix information;
[0011] Generate the hash list and the first hash algorithm according to the AT feature set;
[0012] The data information of the AT command set in the preset format is loaded into the hash list.
[0013] Furthermore, before matching the received first AT command with the hash list, the method further includes:
[0014] At least one data verification interface and at least one data structure are generated according to the AT feature set.
[0015] Furthermore, the AT commands in the AT command set of the preset format include:
[0016] Prefix information and data information;
[0017] The data information includes at least one of the following: instruction type, instruction entry, parameter type, parameter range and default description.
[0018] Further, matching the received first AT instruction with the hash list to obtain a target AT instruction matching the first AT instruction includes:
[0019] Calculate the instruction prefix of the first AT instruction by using the first hash algorithm to obtain a calculation result;
[0020] The calculation result is compared with the hash list to determine a target AT instruction in the hash list corresponding to a hash value matching the calculation result.
[0021] Further, the determining the type and parameter information of the first AT command through the target data verification interface corresponding to the target AT command includes:
[0022] Determine a target data verification interface corresponding to the target AT command according to the at least one data verification interface;
[0023] Determine a target data structure corresponding to the target data verification interface;
[0024] The first AT command is parameter-checked through the target data structure to obtain the type and parameter information of the first AT command.
[0025] To achieve the above object, an embodiment of the present invention further provides an AT command processing device, comprising:
[0026] A matching module, configured to match the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set;
[0027] A determination module, configured to determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command;
[0028] The execution module is used to execute the first AT command according to the type and parameter information of the first AT command, obtain an execution result and output the execution result.
[0029] To achieve the above object, an embodiment of the present invention further provides a terminal, including a processor and a transceiver, wherein:
[0030] The transceiver is used to match the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set;
[0031] The processor is used to determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command;
[0032] According to the type and parameter information of the first AT command, the first AT command is executed, an execution result is obtained, and the execution result is output.
[0033] To achieve the above-mentioned purpose, an embodiment of the present invention further provides a terminal device, comprising a transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; when the processor executes the program or instruction, the AT command processing method as described above is implemented.
[0034] To achieve the above object, an embodiment of the present invention provides a readable storage medium on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps in the AT instruction processing method described above are implemented.
[0035] The beneficial effects of the above technical solution of the present invention are as follows:
[0036] The AT instruction processing method of the embodiment of the present invention matches the received first AT instruction with the hash list, and after determining the target AT instruction, determines the target data verification interface corresponding to the target AT instruction, and then determines the type and parameter information of the first AT instruction; and executes the first AT instruction according to the type and parameter information of the first AT instruction. The solution of the present invention can realize the virtual call of the AT instruction by matching the virtual data verification interface according to the first AT instruction and decoupling the AT instruction execution from the physical serial port. A unified and standardized interface is provided for different platforms to eliminate the platform relevance of the business side code. It solves the problem in the prior art that the AT instruction codes on different platforms need to be developed separately, and the code reusability serving the AT instruction is poor. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Schematic diagram of the process of the AT command processing method according to an embodiment of the present invention;
[0038] Figure 2 A schematic diagram of a flow chart of preprocessing an AT command set in a preset format according to an embodiment of the present invention;
[0039] Figure 3 A logical schematic diagram of an AT command processing method according to an embodiment of the present invention;
[0040] Figure 4 A schematic diagram of the structure of the AT command processing method according to the embodiment of the present invention;
[0041] Figure 5 It is a module intention of the AT command processing device of an embodiment of the present invention;
[0042] Figure 6 is a schematic diagram of the structure of a terminal according to an embodiment of the present invention;
[0043] Figure 7 The figure is a schematic diagram of the structure of a terminal device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0045] It should be understood that the references to "one embodiment" or "an embodiment" throughout the specification mean that the specific features, structures, or characteristics associated with the embodiment are included in at least one embodiment of the present invention. Therefore, the references to "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0046] In various embodiments of the present invention, it should be understood that the size of the serial numbers of the following processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0047] Additionally, the terms "system" and "network" are often used interchangeably herein.
[0048] In the embodiments provided in the present application, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B according to A does not mean determining B only according to A, and B can also be determined according to A and / or other information.
[0049] like Figure 1 As shown, an AT command processing method according to an embodiment of the present invention includes the following steps:
[0050] Step 101: Match a received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set.
[0051] Step 102: Determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command.
[0052] Step 103: execute the first AT command according to the type and parameter information of the first AT command, obtain an execution result, and output the execution result.
[0053] Optionally, executing the first AT command according to the type and parameter information of the first AT command includes:
[0054] According to the type of the first AT command, a target execution strategy is acquired, and the parameter information is processed according to the target execution strategy.
[0055] In one embodiment of the present invention, after receiving the first AT instruction, the communication module matches the hash list through a hash algorithm, and after matching the target AT instruction, the tail data of the first AT instruction is brought into the target data verification interface corresponding to the target AT instruction to obtain the type and parameter information of the first AT instruction; the first AT instruction is executed according to the type of the first AT instruction (the data corresponding to the parameter information is processed in the entity function), the execution result is obtained and the execution result is output in the form of an output parameter. The AT instruction processing method of the embodiment of the present invention can realize the virtual call of the AT instruction (non-serial port call, i.e., virtual AT channel). Standardize the parameter processing process, eliminate the chip interface difference, realize the transmission mode, data mode, escape string, Json string and other transmission modes, and decouple the AT instruction from the serial port component.
[0056] The AT instruction processing method of the embodiment of the present invention matches the received first AT instruction with the hash list, and after determining the target AT instruction, determines the target data verification interface corresponding to the target AT instruction, and then determines the type and parameter information of the first AT instruction; and executes the first AT instruction according to the type and parameter information of the first AT instruction. The solution of the present invention can realize the virtual call of the AT instruction by matching the virtual data verification interface according to the first AT instruction and decoupling the AT instruction execution from the physical serial port. A unified and standardized interface is provided for different platforms to eliminate the platform relevance of the business side code. It solves the problem in the prior art that the AT instruction codes on different platforms need to be developed separately, and the code reusability serving the AT instruction is poor.
[0057] Optionally, before matching the received first AT instruction with the hash list, the following steps are included:
[0058] Receive a set of AT commands in a preset format;
[0059] Obtaining prefix information of each AT command in the AT command set of the preset format, and determining an AT feature set according to the prefix information;
[0060] Generate the hash list and the first hash algorithm according to the AT feature set;
[0061] The data information of the AT command set in the preset format is loaded into the hash list.
[0062] Optionally, generating the hash list according to the AT feature set includes:
[0063] A hash calculation is performed on the prefix information of each AT instruction in the AT feature set, and the hash list is generated according to the calculation result.
[0064] Optionally, loading the data information of the AT command set in the preset format into the hash list includes:
[0065] Matching the data information of the AT command in the AT command set of the preset format with the hash value in the hash list;
[0066] The data information of each AT command matches the hash value corresponding to the prefix information of the AT command.
[0067] In one embodiment of the present invention, the preset format AT instruction set can be an AT instruction set saved in the format of an XML file, wherein the format of the XML file includes: an instruction prefix, an instruction type, an instruction entry, a parameter type, a parameter range, a default description, etc. of the AT instruction; at the same time, a Python parser can be used to import the preset format AT instruction set, and identify the description information according to the received XML file, automatically generate a parameter specification list (including a variety of data structures) and a parameter verification interface, and create a source file to store the corresponding data structure and interface, and extract the instruction prefix to form an AT feature set.
[0068] The AT command processing method of the embodiment of the present invention can automatically generate a large number of AT parameter verification codes through a preprocessing process by means of XML file description, thereby simplifying the development process of AT commands, standardizing the input and output of AT commands, and ensuring that AT commands between modules are compatible with each other.
[0069] like Figure 2As shown, in one embodiment of the present invention, before matching the received first AT command with the hash list, it is necessary to pre-process the received AT command set in a preset format:
[0070] After receiving the loaded AT command set in XML file format, generating an AT feature set according to prefix information of each AT command in the AT command set;
[0071] At least one data verification interface, at least one data structure, a hash list and a first hash algorithm MPHF are generated according to the AT feature set.
[0072] In one embodiment of the present invention, a hash list (minimum perfect hash list) and a first hash algorithm are generated according to the AT feature set; and data information in the AT instruction set is loaded into the hash list. Compared with the sequence table, the space complexity of AT information storage does not change, and the additional overhead of the embedded system is not increased. The average time complexity of AT instruction matching is reduced from O(n) to O(1), and does not change with the increase in the number of AT instructions.
[0073] Optionally, before matching the received first AT instruction with the hash list, the method further includes:
[0074] At least one data verification interface and at least one data structure are generated according to the AT feature set.
[0075] It should be noted that the data verification interface is a virtual interface.
[0076] The AT command processing method of the embodiment of the present invention pregenerates a parameter verification interface, simplifies the development process of AT commands, and standardizes the stimulus response of the system, and can realize mutual compatibility and alternative use of AT commands between different communication modules.
[0077] Optionally, the AT command in the preset format AT command set includes:
[0078] Prefix information and data information;
[0079] The data information includes at least one of the following: instruction type, instruction entry, parameter type, parameter range and default description.
[0080] Optionally, matching the received first AT instruction with a hash list to obtain a target AT instruction matching the first AT instruction includes:
[0081] Calculate the instruction prefix of the first AT instruction by using the first hash algorithm to obtain a calculation result;
[0082] The calculation result is compared with the hash list to determine a target AT instruction in the hash list corresponding to a hash value matching the calculation result.
[0083] The AT command processing method of the embodiment of the present invention adopts a hash algorithm to match AT commands, which reduces the average time of AT command query, and the time required for matching does not change with the amount of data information carried in the AT command, thereby improving the processing efficiency of the AT command.
[0084] Optionally, determining the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command includes:
[0085] Determine a target data verification interface corresponding to the target AT command according to the at least one data verification interface;
[0086] Determine a target data structure corresponding to the target data verification interface;
[0087] The first AT command is parameter-checked through the target data structure to obtain the type and parameter information of the first AT command.
[0088] Optionally, parameter verification is performed on the first AT command through the target data structure on the target data verification interface.
[0089] The AT command processing method of the embodiment of the present invention only needs to match the virtual data verification interface, and the execution process is isolated from the port, thereby realizing the decoupling of AT command execution from the physical serial port, providing a unified and standardized interface for different platforms, and eliminating the platform relevance of the service side code. This solves the problem that the AT command codes on different platforms in the prior art need to be developed separately, and the code reusability serving the AT command is poor.
[0090] like Figure 3 The logic of the AT command processing method of the embodiment of the present invention is as follows:
[0091] Enter AT commands on the port of the communication module;
[0092] Read the command prefix of the AT command and match it in the AT hash list;
[0093] After matching the target AT command, determine the target data verification interface and target data structure;
[0094] Perform parameter verification on the MC AT command through the target data structure at the target data verification interface to obtain the type and parameter information of the first AT command;
[0095] After the parameter verification is successful, determining the execution strategy according to the target data verification interface, and executing the first AT command;
[0096] The execution result is obtained and outputted in the form of an output parameter.
[0097] It should be noted that the AT command processing method of the embodiment of the present invention can be implemented by the following architecture:
[0098] It includes communication modules of platform layer, abstract interface layer, AT service layer and business layer, such as Figure 4 shown.
[0099] Specifically, in one embodiment of the present invention, the software of the communication module is evolved from the original 2-layer structure (platform layer and AT layer) to a 4-layer structure. When the code of the AT instruction is developed on different chip platforms, only the abstract interface layer needs to be adapted, and the AT service layer and the business layer can be directly reused.
[0100] The communication module of the embodiment of the present invention decouples the business side code from the chip platform through core ideas such as software layering and dependency inversion, thereby improving the cohesion of the business side code. It can achieve good cross-platform characteristics of AT command processing. When developing a new communication module, developers only need to implement board-level adaptation of the abstract interface, and the upper-level code can be directly reused.
[0101] Optionally, performing parameter verification on the first AT command through the abstract interface layer;
[0102] Preprocessing the received AT Zhilin trace in the preset format through the AT service layer;
[0103] The first AT command is executed through the service layer according to the type and parameter information of the first AT command.
[0104] The AT layer dependency inversion principle is abstracted into an abstract interface layer to provide chip platform board-level adaptation and business layer interface dependency:
[0105] In one embodiment of the present invention, the abstract interface layer includes: at least one of: a CMOS interface, an Asyn Socket interface, an Asyn DNS interface, an Asyn SSL interface, and a general interface;
[0106] Among them, the CMOS interface is a developed CMOS standard interface, which shields the differences in the use of operating systems and memory stacks, realizes the decoupling of native systems and applications, and improves the cohesion of applications;
[0107] In the Asyn Socket interface, Asyn DNS interface and Asyn SSL interface, asynchronous sockets and abstract interfaces are uniformly implemented to realize the asynchronous event-driven model of sockets and encryption and decryption, as well as asynchronous domain name resolution; at the same time, these abstract interfaces provide standardized asynchronous processing entrances and exits for application layer data services, avoiding problems such as thread resource consumption and increased power consumption caused by blocking methods in multi-service situations;
[0108] By abstracting hardware interfaces and common interfaces, the platform dependency of applications is completely eliminated, such as serial port input and output, file system access, etc.
[0109] In one embodiment of the present invention, the APP program of the AT service layer adopts the "strategy mode" to virtualize the APP management execution strategy. The business layer code that meets the strategy can be replaced at any time, reducing the coupling between the AT service layer and the business layer, and realizing the simultaneous use of the AT layer APP and the business layer functions.
[0110] In one embodiment of the present invention, the business side code (AT command code of the business layer) relies on the basic abstract interface and can be placed on the GitLab server for unified iterative maintenance in package management mode. When developing the communication module software, it is only necessary to complete the board-level adaptation of the abstract interface layer. After determining the target parameter verification interface, the AT business side code is obtained from the GitLab warehouse on demand according to the target parameter verification interface. The AT command processing method of the embodiment of the present invention standardizes the stimulus response behavior of the AT system, improves the reusability of the code, and ensures compatibility and substitutability between modules.
[0111] like Figure 5 As shown, the embodiment of the present invention further provides an AT command processing device 500, including:
[0112] A matching module 501 is used to match the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set;
[0113] A determination module 502, configured to determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command;
[0114] The execution module 503 is used to execute the first AT command according to the type and parameter information of the first AT command, obtain an execution result and output the execution result.
[0115] The AT instruction processing device of the embodiment of the present invention matches the received first AT instruction with the hash list, and after determining the target AT instruction, determines the target data verification interface corresponding to the target AT instruction, and then determines the type and parameter information of the first AT instruction; and executes the first AT instruction according to the type and parameter information of the first AT instruction. The scheme of the present invention can realize the virtual call of the AT instruction by matching the virtual data verification interface according to the first AT instruction and decoupling the AT instruction execution from the physical serial port. A unified and standardized interface is provided for different platforms to eliminate the platform relevance of the business side code. It solves the problem in the prior art that the AT instruction codes on different platforms need to be developed separately, and the code reusability serving the AT instruction is poor.
[0116] Optionally, the AT command processing device further includes:
[0117] A receiving module, used for receiving a set of AT commands in a preset format;
[0118] An acquisition module, used to acquire prefix information of each AT command in the AT command set of the preset format, and determine an AT feature set according to the prefix information;
[0119] A first generating module, configured to generate the hash list and the first hash algorithm according to the AT feature set;
[0120] The loading module is used to load the data information of the AT command set in the preset format into the hash list.
[0121] Optionally, the AT command processing device further includes:
[0122] The second generating module is used to generate at least one data verification interface and at least one data structure according to the AT feature set.
[0123] Optionally, the matching module is further used for:
[0124] Calculate the instruction prefix of the first AT instruction by using the first hash algorithm to obtain a calculation result;
[0125] The calculation result is compared with the hash list to determine a target AT instruction in the hash list corresponding to a hash value matching the calculation result.
[0126] Optionally, the determining module is further used for:
[0127] Determine a target data verification interface corresponding to the target AT command according to the at least one data verification interface;
[0128] Determine a target data structure corresponding to the target data verification interface;
[0129] The first AT command is parameter-checked through the target data structure to obtain the type and parameter information of the first AT command.
[0130] like Figure 6 As shown, a mobile terminal 600 according to an embodiment of the present invention includes a processor 610 and a transceiver 620, wherein:
[0131] The transceiver is used to match the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set;
[0132] The processor is used to determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command;
[0133] According to the type and parameter information of the first AT command, the first AT command is executed, an execution result is obtained, and the execution result is output.
[0134] A terminal device according to another embodiment of the present invention, such as Figure 7 As shown, it includes a transceiver 710, a processor 700, a memory 720, and a program or instruction stored in the memory 720 and executable on the processor 700; when the processor 700 executes the program or instruction, the above-mentioned method for processing AT instructions is implemented.
[0135] The transceiver 710 is used to receive and send data under the control of the processor 700.
[0136] Among them, Figure 7 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically one or more processors represented by processor 700 and various circuits of memory represented by memory 720 are linked together. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 710 may be a plurality of components, namely, a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. For different user devices, the user interface 730 may also be an interface capable of externally and internally connecting required devices, and the connected devices include but are not limited to a keypad, a display, a speaker, a microphone, a joystick, and the like.
[0137] The processor 700 is responsible for managing the bus architecture and general processing, and the memory 720 can store data used by the processor 700 when performing operations.
[0138] A readable storage medium according to an embodiment of the present invention stores a program or instruction thereon. When the program or instruction is executed by a processor, the steps in the AT instruction processing method described above are implemented and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0139] The processor is the processor in the terminal device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0140] It should be further explained that the terminals described in this specification include but are not limited to smart phones, tablet computers, etc., and many of the functional components described are called modules in order to more particularly emphasize the independence of their implementation methods.
[0141] In the embodiment of the present invention, the module can be implemented with software so that it can be executed by various types of processors. For example, an executable code module of an identification can include one or more physical or logical blocks of computer instructions, for example, it can be constructed as an object, process or function. Nevertheless, the executable code of the identified module does not need to be physically located together, but can include different instructions stored in different positions, and when these instructions are logically combined together, it constitutes a module and realizes the specified purpose of the module.
[0142] In fact, executable code module can be a single instruction or many instructions, and can even be distributed on a plurality of different code segments, distributed among different programs, and distributed across a plurality of memory devices. Similarly, operating data can be identified in the module, and can be implemented and organized in the data structure of any appropriate type according to any appropriate form. The operating data can be collected as a single data set, or can be distributed in different locations (including on different storage devices), and can only be present on a system or network as an electronic signal at least in part.
[0143] When a module can be implemented by software, considering the level of existing hardware technology, a person skilled in the art can build a corresponding hardware circuit to implement the corresponding function of the module that can be implemented by software without considering the cost. The hardware circuit includes a conventional very large scale integration (VLSI) circuit or gate array and existing semiconductors such as logic chips, transistors, or other discrete components. The module can also be implemented by a programmable hardware device, such as a field programmable gate array, a programmable array logic, a programmable logic device, etc.
[0144] The above exemplary embodiments are described with reference to the accompanying drawings, and many different forms and embodiments are feasible without departing from the spirit and teachings of the present invention. Therefore, the present invention should not be constructed as a limitation of the exemplary embodiments proposed herein. More specifically, these exemplary embodiments are provided so that the present invention will be perfect and complete, and the scope of the present invention will be conveyed to those who are familiar with the technology. In these figures, the component sizes and relative sizes may be exaggerated for clarity. The terms used here are only based on the purpose of describing specific exemplary embodiments and are not intended to be limiting. As used herein, unless the text clearly indicates otherwise, the singular forms "one", "an" and "the" are intended to include these multiple forms. It will be further understood that the terms "including" and / or "comprising" when used in this specification indicate the presence of the features, integers, steps, operations, components and / or components, but do not exclude the presence or increase of one or more other features, integers, steps, operations, components, components and / or their groups. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of that range and any subranges therebetween.
[0145] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing an AT command, characterized in that: include: Matching the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set; Determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command; Execute the first AT command according to the type and parameter information of the first AT command, obtain an execution result and output the execution result; Before matching the first received AT command with the hash list, including: Receive a set of AT commands in a preset format; Obtaining prefix information of each AT command in the AT command set of the preset format, and determining an AT feature set according to the prefix information; Generate the hash list and the first hash algorithm according to the AT feature set; Loading data information of the AT command set in the preset format into the hash list; The step of matching the received first AT instruction with the hash list to obtain a target AT instruction matching the first AT instruction includes: Calculate the instruction prefix of the first AT instruction by using the first hash algorithm to obtain a calculation result; The calculation result is compared with the hash list to determine a target AT instruction in the hash list corresponding to a hash value matching the calculation result.
2. The AT command processing method according to claim 1, characterized in that: Before matching the received first AT command with the hash list, the following steps are also included: At least one data verification interface and at least one data structure are generated according to the AT feature set.
3. The AT command processing method according to claim 1 or 2, characterized in that: The AT commands in the AT command set of the preset format include: Prefix information and data information; The data information includes at least one of the following: instruction type, instruction entry, parameter type, parameter range and default description.
4. The AT command processing method according to claim 2, characterized in that: The determining the type and parameter information of the first AT command through the target data verification interface corresponding to the target AT command includes: Determine a target data verification interface corresponding to the target AT command according to the at least one data verification interface; Determine a target data structure corresponding to the target data verification interface; The first AT command is parameter-checked through the target data structure to obtain the type and parameter information of the first AT command.
5. An AT command processing device, characterized in that: include: A matching module, configured to match the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set; A determination module, configured to determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command; An execution module, configured to execute the first AT command according to the type and parameter information of the first AT command, obtain an execution result, and output the execution result; The matching module is also used for: Receive a set of AT commands in a preset format; Obtaining prefix information of each AT command in the AT command set of the preset format, and determining an AT feature set according to the prefix information; Generate the hash list and the first hash algorithm according to the AT feature set; Loading data information of the AT command set in the preset format into the hash list; Calculate the instruction prefix of the first AT instruction by using the first hash algorithm to obtain a calculation result; The calculation result is compared with the hash list to determine a target AT instruction in the hash list corresponding to a hash value matching the calculation result.
6. A terminal, characterized in that: include: transceivers and processors; The transceiver is used to match the received first AT command with a hash list to obtain a target AT command matching the first AT command, wherein the hash list is pre-generated according to an AT feature set; The processor is used to determine the type and parameter information of the first AT command through a target data verification interface corresponding to the target AT command; Execute the first AT command according to the type and parameter information of the first AT command, obtain an execution result and output the execution result; The transceiver is also used for: Receive a set of AT commands in a preset format; Obtaining prefix information of each AT command in the AT command set of the preset format, and determining an AT feature set according to the prefix information; Generate the hash list and the first hash algorithm according to the AT feature set; Loading data information of the AT command set in the preset format into the hash list; Calculate the instruction prefix of the first AT instruction by using the first hash algorithm to obtain a calculation result; The calculation result is compared with the hash list to determine a target AT instruction in the hash list corresponding to a hash value matching the calculation result.
7. A terminal device, comprising: A transceiver, a processor, a memory, and a program or instruction stored in the memory and executable on the processor; wherein the processor implements the AT instruction processing method according to any one of claims 1 to 4 when executing the program or instruction.
8. A readable storage medium having a program or instruction stored thereon, characterized in that: When the program or instruction is executed by the processor, the steps in the AT instruction processing method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
AT instruction processing method, terminal adapter and computer readable storage medium
CN110351715A
File processing method and device, computer readable storage medium and electronic equipment
CN111026466A