Movatterモバイル変換


[0]ホーム

URL:


CN102264047A - AT command processing device and method - Google Patents

AT command processing device and method
Download PDF

Info

Publication number
CN102264047A
CN102264047ACN2010101838925ACN201010183892ACN102264047ACN 102264047 ACN102264047 ACN 102264047ACN 2010101838925 ACN2010101838925 ACN 2010101838925ACN 201010183892 ACN201010183892 ACN 201010183892ACN 102264047 ACN102264047 ACN 102264047A
Authority
CN
China
Prior art keywords
instruction
data
task
command
module
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.)
Pending
Application number
CN2010101838925A
Other languages
Chinese (zh)
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.)
Shanghai Simcom Wireless Solutions Co Ltd
Original Assignee
Shanghai Simcom Wireless Solutions 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 Shanghai Simcom Wireless Solutions Co LtdfiledCriticalShanghai Simcom Wireless Solutions Co Ltd
Priority to CN2010101838925ApriorityCriticalpatent/CN102264047A/en
Publication of CN102264047ApublicationCriticalpatent/CN102264047A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

The invention discloses an AT command processing device and method. The device comprises a transmitting module, a receiving module and an application processing module, wherein the transmitting module is used for transmitting an AT command, and only transmitting one AT command at any time; the receiving module is used for receiving and analyzing the AT command, triggering tasks of different application layers according to different situations under which characters are received, and simultaneously, implementing a data receiving method based on a timeout mechanism of mu COS-II; and the application processing module is used for analyzing contents of short messages in the AT command, and executing corresponding operations according to different contents of the short messages. With the method and the device, loss probability of AT reply data is effectively reduced, and the reliability of receiving the AT reply data is increased; moreover, AT command transmission is completely separated from data analysis under the mu COS-II; and the possibility of mixing of the AT command and the data in the data receiving process is reduced, and complexity in analyzing the AT command is reduced. The method and the device are based on a principle that AT command transmission, data analysis and application processing tasks are all separated, and simultaneously, facilitate subsequent addition of applications.

Description

AT instruction processing unit and method thereof
Technical field
The present invention relates to a kind of AT instruction processing unit and method thereof, particularly relate to a kind of based on AT instruction transmission, data parsing and use AT instruction processing unit and the method thereof that Processing tasks is separated has realized a kind of data receive method of the timeout mechanism based on μ COS-II simultaneously.
Background technology
Because the regulation of gsm protocol, in the answer message after the wireless module execution AT instruction, each instruction does not have unified end mark, and this has added difficulty for the parsing of replying message.The method of traditional parsing AT instruction is the probable value that all transmission AT instructions of storage are returned, and resolves according to the line feed terminating symbol of return messages.Owing to a large amount of AT instructions is arranged in using usually, need in program, take big quantity space.Simultaneously, after multi-channel A T instruction sent, there was the possibility of mixing in the data of the different rows that different AT instructions are returned.
Summary of the invention
The technical problem to be solved in the present invention is that multi-channel A T receives the defective that data are mixed mutually, and a kind of AT instruction processing unit and method thereof that AT replys the reliability of data that receive that increase is provided for after overcoming in the prior art multi-channel A T instruction and sending.
The present invention solves above-mentioned technical problem by following technical proposals:
A kind of AT instruction processing unit, its characteristics are that it comprises:
Sending module is used to send the AT instruction, and any one has only an AT instruction to be sent out constantly;
Receiver module is used for receiving and parsing AT instruction, and triggers the task of different application layers according to the different situations that receive character; Simultaneously, receiver module has also been realized a kind of data receive method of the timeout mechanism based on μ COS-II.
Application processing module is used for the parsing of AT instruction short message content, carries out corresponding operation according to the different content of note.
Preferably, this device is the device based on real-time multi-task operating system.
Preferably, this real-time multi-task operating system is μ COS-II.
Preferably, described AT instruction comprises: GPRS and tcp state query statement, send and the short message reading instruction, and send the tcp data instruction.
Another technical scheme of the present invention is: a kind of AT command processing method of described device, and its characteristics are that it may further comprise the steps:
S1, sending module sends the AT instruction, and any one has only an AT instruction to be sent out constantly;
S2, receiver module receives and resolve the AT instruction, and triggers the task of different application layers according to the different situations that receive character;
S3, application processing module resolves the short message content in the AT instruction, carries out corresponding operation according to the different content of note.
Preferably, step S1In, after sending module sends data, have only wait for predetermined timeout interval after, just send next bar data, to guarantee the end of wireless module transmission data.
Preferably, described AT instruction comprises: GPRS and tcp state query statement, send and the short message reading instruction, and send the tcp data instruction.
Preferably, step S2In, the process that receives the AT instruction adopts the mode of character reception one by one, after hardware based interruption has determined data, utilizes semaphore to notify receiver module.
Preferably, step S2In, receiver module triggers the task of different application layers by semaphore and mailbox.
Preferably, step S3In the operation carried out comprise: according to the switch of short message content control LED, multichannel inquiry and the control of LED on the development board.
Positive progressive effect of the present invention is: the present invention takes the mode of character reception one by one to receive data, the main Data Receiving of using based on the timeout mechanism of μ COS-II, and this method is different from traditional data receive mode.The present invention effectively reduces the losing probability that AT replys data, increases to receive the reliability that AT replys data.Further, realized under μ COS-II that AT instructs separating fully of transmission and data parsing.Reduced receiving the possibility that the AT director data mixes in the data, reduced the complexity of resolving the AT instruction.Instruction sends based on AT, and the principle that data parsing and application Processing tasks are separated is added for simultaneously follow-up application and having been stayed convenience.
Description of drawings
Fig. 1 is the schematic diagram of AT instruction processing unit of the present invention.
Fig. 2 is the flow chart of AT command processing method of the present invention.
Fig. 3 is the switching flow figure between each task of the present invention.
Fig. 4 is the Data Receiving flow chart of the timeout mechanism based on μ COS-II of the present invention.
Embodiment
Provide preferred embodiment of the present invention below in conjunction with accompanying drawing, to describe technical scheme of the present invention in detail.
As everyone knows, when carrying out the exploitation of wireless module, need utilize between MCU or single-chip microcomputer and the wireless module to communicate.The present invention just is based on a kind of exploitation on this framework, and that the MCU in the present embodiment adopts is ARM.As shown in Figure 1, AT instruction processing unit 1 of the present invention comprises: sending module 11, be used to send the AT instruction, and any one has only constantly an AT instruction to be sent out; Receiver module 12 is used for receiving and parsing AT instruction, and triggers the task of different application layers according to the different situations that receive character; Application processing module 13 is used for the parsing of AT instruction short message content, carries out corresponding operation according to the different content of note.Wherein, described AT instruction can be GPRS and tcp state query statement, sends and the short message reading instruction, sends the tcp data instruction.In the present embodiment, adopted μ COS-II as real time operating system, those skilled in the art also can adopt the operating system of other types certainly, and it has the real-time that most real time operating systems have, the task property seized, it has littler EMS memory occupation simultaneously.In specific implementation, each task of aforesaid module respective operations system sends such as all AT and all to be placed on task A and task B is responsible for the data processing that all receive, and resolves this task that all is placed on.Task C is an application task, and it is used for handling the relevant task of note.Task B comes control task C by semaphore and mailbox, and follow-up application can realize that follow-up task is unified communicates by letter with task B by the form of adding independent task.
Fig. 2 is the AT command processing method of device of the present invention, and it may further comprise the steps:
Step 101, sending module send the AT instruction, and any one has only an AT instruction to be sent out constantly.Wherein, because of employing in the present embodiment is μ COS-II operating system, the waiting-timeout mechanism that provides by μ COS-II operating system, after having guaranteed the transmission data, (this overtime time can be definite through test after having only wait timeout, and can guarantee the reception fully of data), judge that according to this opposite end (being the data that wireless module is issued ARM) sends the end of data; After this, sending module just can send next bar data.Taked in the present embodiment to send data, received data, sent the principle of data again.Wherein, the mutual exclusion of overtime reception data and AT order is sent as key technology means of the present invention place.
Step 102, receiver module receive and resolve the AT instruction, and trigger the task of different application layers according to the different situations that receive character;
Step 103, application processing module are resolved the short message content in the AT instruction, carry out corresponding operation according to the different content of note.
Above-mentionedsteps 102~103 specific implementation in practice is the state of the art, is not inventive point of the present invention place.
As shown in Figure 3, in concrete design, need to send multiple AT instruction: as GPRS and tcp state query statement, send and the short message reading instruction, send tcp data instruction or the like according to multiple different situation.The present embodiment unification is put into these instructions among the task A of having limit priority, and the mutual exclusion of the state flag bit that constantly changes in using by each guarantees that any one has only an AT instruction just to be sent out among the task A constantly.The strategy of Shi Xianing also is based on former experiments like this, and the AT instruction of high amount of traffic amount mixes under the situation about sending, and there is the situation of mixing in the data that receive, and it is more difficult resolving under these circumstances and receiving data.
The processing unification from the data of wireless module that receives is placed among the task B of time high priority, and the mode that the process of reception adopts character one by one to receive adopts the interruption receive mode of serial ports.In case after hardware based interruption has determined data, utilize semaphore to notify task B, after a period of time did not receive data, system is overtime to be returned, and began to send next bar AT instruction.Simultaneously in task B, trigger the task of different application layers according to the various situation that receives character by semaphore and mailbox, in the design of present embodiment task C.Such as: the ARM development board receives character ">" expression from wireless module can send data, receives " CMT " expression and has received new note or the like.Simultaneously, send order, for this class AT command analysis, judge unified being placed among the task B especially if added new AT.
Task C mainly is responsible for the parsing of short message content in the design, carries out corresponding operating according to the different content of note.For example control switch of LED or the like according to short message content.Simultaneously, in interruption, can also realize regularly,, send data to the TCP server on this basis in the mid-or clear corresponding marker bit of interrupt handling routine.The idiographic flow that each task among Fig. 3 is switched is:
Step 201, task A hangs up self by mailbox, and notice task B, and an AT instruction is sent out, and prepares to accept data.
Step 202, the data that task B handle receives send to task C with the form of mailbox, hang up itself with semaphore simultaneously.
Step 203, task C is with the form notice task B of semaphore, and data are finished dealing with.Hang-up task C, the switching of finishing the work of notice kernel.
Step 204, task B notice task A, data finish receiving, and request sends next bar AT instruction, and the notice kernel carries out task and switches.Self-defining title when scheming Chinese and English phrase for programming is only for giving an example.
A kind of new data receive method that Fig. 4 proposes for the present invention.In the reception of the serial ports interrupt handling routine of ARM development board is interrupted, send semaphore to system.In receiver function, use the timeout mechanism of μ COS-II, after after having surpassed certain clock cycle, still not receiving character from wireless module, the serial ports hardware FIFO of ARM development board still is empty words simultaneously, hang up the reception task so and (in system of the present invention, will move other task of limit priority A this time; Send next bar AT instruction).Before not using said method, in traditional technology, after many places or a plurality of local transmission AT instruction, last the corresponding reception data of AT instruction often instruct corresponding reception data mixing to be in the same place with a back AT; At this moment resolving the data that wireless module provides is comparison difficulties, and the loss of data phenomenon often occurs.After using this new data receive method, test result shows that compare additive method, this method has increased substantially the Data Receiving reliability, has reduced the probability of obliterated data.As figure, idiographic flow is as follows:
Step 301, operating system initialization.
Step 302, multitask environment is created.
Step 303, the Target Board initialization.
Step 304 after μ COS-II system wait is overtime, does not also receive character and then hangs up reception task (task A will move).
After step 305, wireless module receive a character, send semaphore.
Wherein, self-defining title when scheming Chinese and English phrase for programming is only for giving an example.
Those skilled in the art can realize the real-time detection of GPRS and tcp state when test is of the present invention, and the BEEP prompting is arranged; Realize multichannel inquiry and the control of note to the LED on the ARM development board; Realize regularly reporting of led state to PC end TCP server.
The process of concrete test is as follows, and 1, the development board of serial ports of ARM development board and wireless module is coupled together; 2, another serial ports and the PC of ARM development board are coupled together, open PC and go up the serial ports receiving tool, in order to monitor GPRS state and tcp state; 3, wireless module is by the led state on the note control ARM development board.During inquiry, message reply.4, regularly report led state to the TCP server on the PC.
Can realize the function that the present invention is whole by test, with stylish AT analytic method and framework, clear layer has reduced the parsing complexity of data, has avoided the situation of the AT data mixing that receives that can occur usually.Stayed convenience for simultaneously the interpolation of new function.
Though more than described the specific embodiment of the present invention, it will be understood by those of skill in the art that these only illustrate.Protection scope of the present invention is limited by appended claims.Those skilled in the art can make numerous variations or modification to these execution modes under the prerequisite that does not deviate from principle of the present invention and essence, but these changes and modification all fall into protection scope of the present invention.

Claims (10)

CN2010101838925A2010-05-252010-05-25AT command processing device and methodPendingCN102264047A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN2010101838925ACN102264047A (en)2010-05-252010-05-25AT command processing device and method

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN2010101838925ACN102264047A (en)2010-05-252010-05-25AT command processing device and method

Publications (1)

Publication NumberPublication Date
CN102264047Atrue CN102264047A (en)2011-11-30

Family

ID=45010463

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN2010101838925APendingCN102264047A (en)2010-05-252010-05-25AT command processing device and method

Country Status (1)

CountryLink
CN (1)CN102264047A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103118181A (en)*2013-01-172013-05-22深圳市中兴移动通信有限公司Method and device for processing synchronous attention (AT) instructions
CN104053252A (en)*2014-06-042014-09-17青岛海信移动通信技术股份有限公司AT instruction processing method, device and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050227682A1 (en)*2002-06-202005-10-13Frederic MilliotMethod of supplying service configuration data to a mobile telephony device by means of a computerized terminal
CN101030975A (en)*2007-02-152007-09-05重庆重邮信科股份有限公司Processing method for increasing responding speed of protocol AT commands
CN101068404A (en)*2006-09-262007-11-07中兴通讯股份有限公司Slave module controlling system and method in double-mode mobile terminal
CN101287226A (en)*2008-05-222008-10-15德信无线通讯科技(北京)有限公司Controlling method and system for mobile communication terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20050227682A1 (en)*2002-06-202005-10-13Frederic MilliotMethod of supplying service configuration data to a mobile telephony device by means of a computerized terminal
CN101068404A (en)*2006-09-262007-11-07中兴通讯股份有限公司Slave module controlling system and method in double-mode mobile terminal
CN101030975A (en)*2007-02-152007-09-05重庆重邮信科股份有限公司Processing method for increasing responding speed of protocol AT commands
CN101287226A (en)*2008-05-222008-10-15德信无线通讯科技(北京)有限公司Controlling method and system for mobile communication terminal

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103118181A (en)*2013-01-172013-05-22深圳市中兴移动通信有限公司Method and device for processing synchronous attention (AT) instructions
CN103118181B (en)*2013-01-172015-12-02努比亚技术有限公司A kind of method and device processing synchronous AT instruction
CN104053252A (en)*2014-06-042014-09-17青岛海信移动通信技术股份有限公司AT instruction processing method, device and system
CN104053252B (en)*2014-06-042017-08-11青岛海信移动通信技术股份有限公司A kind of AT command processing methods, apparatus and system

Similar Documents

PublicationPublication DateTitle
EP3298824B1 (en)Method and apparatus for managing buffer in wireless communication system
CN105807788A (en)Unmanned aerial vehicle monitoring method, system, unmanned aerial vehicle and ground station
CN104079599A (en)Real-time message synchronizing method and container wharf operation system
CN107743137A (en)A kind of file uploading method and device
CN101751291A (en)Method of sharing one serial port by application programs and device
US20010011296A1 (en)Method and apparatus for providing multiple commands to a server
CN101119306B (en)Method and component for implementing interface index transmission
CN101141742A (en)Application communication method of terminal
CN115794313B (en)Virtual machine debugging method, system, electronic device and storage medium
CN103077140A (en)Communication method and communication device for motion control card of robot and host
CN102264047A (en)AT command processing device and method
CN105530155A (en)1553B bus universe message triggering control method
CN105868030A (en)Log data communication processing apparatus and method as well as mobile terminal
CN110177030B (en)Industrial gateway control test method
CN102200770B (en)Information interactive system and method based on PCI (Peripheral Component Interconnect) and upper computer
CN103593239B (en)The method and device of application process command process in LINUX system
CN108737397A (en)A kind of method for realizing data interaction between business and protocol stack in router
CN101873257B (en)Method and system for receiving messages
CN108509257B (en)Message processing method and device based on multithreading
US7853713B2 (en)Communication interface device and communication method
CN109756503B (en)Communication protocol design method of fire-fighting robot
US9866501B2 (en)Virtual switch enabling communication between external objects and simulation objects
CN100571268C (en) A protocol compatibility processing method and device
CN104079658A (en) Real-time control method of environmental protection Internet of Things based on pool technology in Web environment
US6459706B1 (en)Message-passing communication system generating task for monitoring a specific communication path

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C02Deemed withdrawal of patent application after publication (patent law 2001)
WD01Invention patent application deemed withdrawn after publication

Application publication date:20111130


[8]ページ先頭

©2009-2025 Movatter.jp