CN101035372A - Fast matching method of AT instruction identifier - Google Patents

Fast matching method of AT instruction identifier Download PDF

Info

Publication number
CN101035372A
CN101035372A CNA2007100782371A CN200710078237A CN101035372A CN 101035372 A CN101035372 A CN 101035372A CN A2007100782371 A CNA2007100782371 A CN A2007100782371A CN 200710078237 A CN200710078237 A CN 200710078237A CN 101035372 A CN101035372 A CN 101035372A
Authority
CN
China
Prior art keywords
node
character
instruction identifier
identifier
pointer
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.)
Granted
Application number
CNA2007100782371A
Other languages
Chinese (zh)
Other versions
CN101035372B (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.)
Keen (Chongqing) Microelectronics Technology Co., Ltd.
Original Assignee
CHORGYOU XINKE Co Ltd CHONGQING
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 CHORGYOU XINKE Co Ltd CHONGQING filed Critical CHORGYOU XINKE Co Ltd CHONGQING
Priority to CN200710078237A priority Critical patent/CN101035372B/en
Publication of CN101035372A publication Critical patent/CN101035372A/en
Application granted granted Critical
Publication of CN101035372B publication Critical patent/CN101035372B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention is a matching method in a 'children-brothers' mode, only arranging the known characters of AT instruction identifier in sequence into a tree structure, and in the matching course, as long as matching with some node, not matching for follow-up brother nodes of this node and children nodes of the brother nodes any more, largely reducing the matching comparison objects, effectively shortening searching time for matching and raising matching efficiency.

Description

A kind of fast matching method of AT instruction identifier
Technical field
The present invention relates to terminal equipment in a kind of mobile communication system (abbreviating TE as) and terminal adapter (abbreviating TA as), perhaps the method for when using the AT instruction to communicate, the AT instruction identifier being mated fast between data terminal equipment (abbreviating DTE as) and the data circuit termination equipment (abbreviating DCE as).
Background technology
AT instruction is sent to DCE to TA or DTE by TE as a kind of information communication mode, and the operation by AT commands for controlling portable terminal (abbreviating MT as), realizes and the service interaction of GSM/UMTS network.The user can be by AT instruction the carrying out operation or the control of aspects such as function setting, calling, note, phone directory, data service, fax.
The AT instruction that sends when at present, TE communicates by letter with TA is with the byte-by-byte transmission of form of character stream.Therefore, TA must be at first assembles the character stream of the AT instruction that receives, and then, is which kind of operational order by what resolve that the AT instruction identifier acknowledges receipt of, comprehensively after the type and parameter of this AT instruction, could initiate corresponding operation requests to MT.So-called AT instruction identifier is that (length is that 3 or 3 are more than the character by preceding several characters of AT instruction or complete AT instruction, but generally can not surpass 10 characters) form, it can uniquely show certain operation, is combined by different letter and numbers usually.
The method of prior art matching instruction identifier is that the identifier with all AT instruction of current support is preset in the buffering area, when receiving AT instruction character stream, begin with character string mode relatively (as realizing from first byte with the C language, can use the character string comparison command in the java standard library) it is compared one by one with the AT instruction identifier that prestores in the buffering area, after searching out identical AT instruction identifier, confirm that instruction identifier is complementary.Prior art needs one by one the AT instruction identifier that is preset in the buffer area to be compared, up to the instruction identifier that searches out coupling.Obviously, the maximum times that the prior art matching process compares is the sum that is preset at the instruction identifier in the buffer area, under the more situation of AT number of instructions, will be comparatively consuming time, and efficient is lower, has prolonged the response time.
Summary of the invention
For overcoming the lower deficiency of prior art coupling AT instruction identifier efficient, the present invention proposes a kind of fast matching method of AT instruction identifier, can effectively shorten the match time of AT instruction identifier, raises the efficiency, and shortens the response time.
Matching process of the present invention is divided into general format and special format two classes with the AT instruction identifier of being supported, adopt tree that the character row of the AT instruction identifier of general format is become an ordered tree, each character in the AT instruction identifier is arranged on the node of different levels of tree according to the order of sequence, node is represented a character in the AT instruction identifier, mate one by one by pointer that points to tree node character respectively and the pointer that points to the AT instruction identifier character that receives character, until matching identical AT instruction identifier the AT instruction identifier.
Matching process of the present invention will not be the AT instruction identifier that begins with " AT " character, though perhaps begin with " AT " character, but the AT instruction identifier that is contained in (or having comprised another AT instruction identifier) in another AT instruction identifier fully is defined as the special format identifier, otherwise, be defined as the general format identifier.
The ground floor node character of the tree of matching process AT instruction identifier character of the present invention is for " A " and have only a node, second layer node character is for " T " and have only a node, three-layered node point is arranged according to the lexicographic order of the 3rd character of general format AT instruction identifier, the 4th layer of node arranged and come with the three-layered node point that is under the jurisdiction of an AT instruction identifier down according to the lexicographic order of the 4th character of general format AT instruction identifier, if the 4th layer of node do not exist, then this branch of tree finishes, the rest may be inferred, up to " ordered tree " that form an AT instruction identifier character.
Because the AT instruction identifier of general format is known before " tree " arranged, therefore, when arranging, only the character of all AT instruction identifiers of being supported is arranged tree.For example: in the AT instruction identifier, have " AT﹠amp; W ", 4 identifiers such as " AT+CSQ ", " AT+CBC ", " ATA ", only “ ﹠amp can appear then on three-layered node point; ", "+" and 3 characters such as " A ", therefore, just on three-layered node point, only arrange above-mentioned 3 characters.In like manner, on the 4th layer of node, only arrange " W " and " C " 2 characters, and character " W " only is arranged in three-layered node point “ ﹠amp; " below, character " C " be arranged in three-layered node point "+" below, below the promptly so-called node that belongs to same AT instruction identifier.Do not have the 4th layer of node below the character " A ", this branch finishes.The rest may be inferred, arranges " S " and " B " 2 characters on the layer 5 node, they all come the 4th layer of node " C " below.Arranged " Q " and " C " 2 characters on the layer 6 node, wherein character " Q " come layer 5 node " S " below, character " C " come layer 5 node " B " below.So promptly constituted an AT instruction ordered tree.
The digital value (abbreviating ID as) of storage AT instruction identifier in last one deck node of each branch of matching process tree of the present invention is confirmed this identifier and is returned ID when inquiring last one deck node of this identifier, to confirm this AT instruction.
The tree of matching process AT instruction identifier character of the present invention can be regarded as the chained list description scheme of what is called " child-brother ", and the descriptor that comprises in each node has: node character, child's node, sibling.Wherein the node character is meant the some characters in the AT instruction identifier.Child's node is to be under the jurisdiction of an AT instruction identifier together with this node, but is in the node of following one deck of tree.Descending one deck node according to first nearest character node of character sortord, i.e. first child's node of current node.Sibling is meant with this node and is not under the jurisdiction of an AT instruction identifier, still belongs to the node of same one deck of tree.In with one deck node according to character sortord the character late node of close this node, i.e. " right side " sibling of current node.
Matching process of the present invention is when carrying out AT instruction identifier coupling, judge that at first the AT instruction identifier that receives is general format or special format, if special format then adopts prior art to mate, if general format then adopts following method to mate: a pointer (hereinafter to be referred as pointer A) points to the root node of the character tree of AT instruction identifier in the buffer area, another pointer (hereinafter to be referred as pointer B) points to the initial character of the AT instruction identifier that receives, relatively whether the character of two pointed is identical, and according to both whether identical execution in step 1 or 2 respectively, step 1: pointer B points to second character of the AT instruction identifier that receives, pointer A points to the first node (promptly so-called first child's node) of the second layer, compare once more, the rest may be inferred, point to last character of AT instruction identifier up to pointer B, when pointer B points to the character of last character of AT instruction identifier and two pointed when identical, child's node that pointer A points to this position takes out ID and returns; Step 2: pointer A points to the next node (being so-called right sibling) of same level, compare once more, repeating step 1 if both are identical, point to next brother node again as then pointer A inequality still, compare once more, the rest may be inferred, point to last sibling up to pointer A, as still inequality, then it fails to match in explanation, searches end.
AT instruction identifier for special format, (be generally single character ‘ r ' as the command for stopping identifier, be carriage return character), repetitive instruction identifier (being generally single character '/'), identifier ' AT+CR ' and ' AT+CRC ', adopt matching process of the present invention can not correctly return matching result.Because the instruction identifier number of special format is less, when receiving the AT identifier, can judge earlier that the method that re-uses the character string comparison is mated.
Matching process of the present invention adopts " child-brother " mode, only the character to known AT instruction identifier is arranged in tree according to the order of sequence, and in matching process, as long as match a certain node, just no longer the follow-up sibling of this node and child's node of sibling are mated, significantly reduce the contrast object of coupling, shortened the match search time effectively, improved the coupling operating efficiency.
Description of drawings
Fig. 1: prior art AT instruction identifier coupling FB(flow block);
Fig. 2: matching process AT instruction identifier character tree of the present invention (part) schematic diagram;
Fig. 3: the AT instruction identifier coupling FB(flow block) of matching process embodiment of the present invention.
Embodiment
Fig. 1 is a prior art AT instruction identifier coupling FB(flow block).Concrete enforcement is that all the AT instruction identifiers that will be supported are formulated for table according to the order of sequence, is stored in the preset buffer.When receiving the character stream of AT instruction identifier, first identifier from table begins coupling, if the AT instruction identifier of receiving is identical with current identifier, has then matched corresponding AT instruction, exports the ID of this AT instruction.If it is inequality, and the current AT instruction identifier that is compared is not in the table last, then next AT instruction identifier in the AT instruction identifier that receives and the table is compared, the rest may be inferred, last AT instruction identifier in table, as still inequality, then search end, return mistake.Hence one can see that, and required comparison maximum times of AT instruction identifier of prior art coupling is the sum of AT instruction identifier in the preset buffer.
Fig. 2 is matching process AT instruction identifier character tree of the present invention (part) schematic diagram.As seen from the figure, in the tree only the AT instruction identifier to known general format arrange, and only to arranging with the child's node that is under the jurisdiction of an AT instruction identifier.And, according in the AT instruction with the overwhelming majority that accounts for of " AT " character beginning, therefore, first and second layer is arranged as A and T respectively, object search and time when having reduced coupling again to a great extent.Among the figure, child's node of the node " C " in the 4th layer of node does not all draw, and has only listed preceding four child's nodes among the figure.
Fig. 3 is a matching process embodiment A T instruction identifier coupling FB(flow block) of the present invention.
In the present embodiment, defined the node of describing the AT ordered tree as the listed structure type of following table AtCommandTreeNode, concrete information about firms is as follows:
Member's name Data type Describe
charVal unsigned char The character value of node
*firstChild Point to the pointer of AtCommandTreeNode structure type First child's node of node
*nextSibling Point to the pointer of AtCommandTreeNode structure type The next brother node of node
atCmdId unsigned int The digital value of instruction identifier
Wherein, the character content of charVal storage present tree node; FirstChild and nextSibling are the structure pointers of AtCommandTreeNode type, and firstChild points to first child's node of this node; Pointer nextSibling points to this node " right side " sibling.Increased the digital value (abbreviating ID as) of member atCmdId storage AT instruction identifier during enforcement in node, different AT instruction identifiers has different digital values to describe, and it and AT instruction identifier are for concerning one to one.AtCmdId is only just meaningful at " last one deck " node (promptly storing the node of last character of AT instruction identifier) of tree, and for all the other nodes, the atCmdId value is invalid.Hence one can see that, can know the digital value of the current AT instruction identifier of receiving when having access to " last one deck " node of tree, promptly is which AT instruction identifier.The firstChild pointer of " last one deck " node is a null pointer.
For the AT instruction of general format, the coupling step is as follows:
Step 1, at first define two pointers, one is the pointer A of AtCommandTreeNode type, point to the root node of AT instruction ordered tree, another is the pointer B of unsigned char type, the bebinning character of the AT instruction identifier that sensing TA receives carries out the comparison of the character content of the character content of pointer B sensing and the node that pointer A points to then;
Whether the character of step 2, the current sensing of pointer B is identical with the character content (charVal value) of the node that pointer A points to, if identical then execution in step 3, otherwise execution in step 4;
Step 3, if the firstChild in the structure that pointer A points to be a null pointer, then pointer B points to character late, first child's node of pointer A sensing current node, if the content of the current sensing of pointer B is not empty, then repeating step 2, otherwise it fails to match, search end;
If the firstChild in the structure that pointer A points to is a null pointer, then matched corresponding AT instruction, the ID of this AT instruction identifier is the value of the atCmdId member in the node of current pointer A sensing, returns this member's value, coupling finishes;
Step 4, if the nextSibling in the structure that pointer A points to is not a null pointer, " right side " sibling of A pointed current node then, the sensing of pointer B remains unchanged, repeating step 2, otherwise it fails to match, searches end.
The inventive method also can have other various embodiments; without departing from the spirit and substance of the case in the method for the present invention; those skilled in the art work as can make various corresponding changes or distortion according to the inventive method, but these corresponding changes or distortion all belong to claim protection range of the present invention.

Claims (5)

1, a kind of AT instruction identifier matching process, it is characterized in that: the AT instruction identifier of being supported is divided into general format identifier and special format identifier two classes, adopt prior art that the special format identifier is mated, adopt tree that the character row of general format AT instruction identifier is become an ordered tree, each character in the AT instruction identifier is arranged on the node of different levels of tree according to the order of sequence, node is represented a character in the AT instruction identifier, mate one by one by pointer that points to tree node character respectively and the pointer that points to the AT instruction identifier character that receives character, until matching identical AT instruction identifier the AT instruction identifier.
2, according to the described matching process of claim 1, it is characterized in that it not to be the AT instruction identifier that begins with " AT " character, though perhaps begin with " AT " character, but the AT instruction identifier that is contained in (or having comprised another AT instruction identifier) in another AT instruction identifier fully is defined as the special format identifier, otherwise, be defined as the general format identifier.
3, according to the described matching process of claim 1, the ground floor node character that it is characterized in that the tree of AT instruction identifier character is " A " and have only a node, second layer node character is for " T " and have only a node, three-layered node point is arranged according to the lexicographic order of the 3rd character of general format AT instruction identifier, the 4th layer of node arranged and come with the three-layered node point that is under the jurisdiction of an AT instruction identifier down according to the lexicographic order of the 4th character of general format AT instruction identifier, if the 4th layer of node do not exist, then this branch of tree finishes, the rest may be inferred, up to " ordered tree " that form an AT instruction identifier character.
4, according to the described matching process of claim 1, the digital value (abbreviating ID as) that it is characterized in that storage AT instruction identifier in last one deck node of each branch of tree, when inquiring last one deck node of this identifier, confirm this identifier and return ID, to confirm this AT instruction.
5, according to the described matching process of claim 1, it is characterized in that when carrying out AT instruction identifier coupling, judge that at first the AT instruction identifier that receives is general format or special format, if special format then adopts prior art to mate, if general format then adopts following method to mate: a pointer (hereinafter to be referred as pointer A) points to the root node of the character tree of AT instruction identifier in the buffer area, another pointer (hereinafter to be referred as pointer B) points to the initial character of the AT instruction identifier that receives, relatively whether the character of two pointed is identical, and according to both whether identical execution in step 1 or 2 respectively, step 1: pointer B points to second character of the AT instruction identifier that receives, pointer A points to the first node (promptly so-called first child's node) of the second layer, compare once more, the rest may be inferred, point to last character of AT instruction identifier up to pointer B, when pointer B points to the character of last character of AT instruction identifier and two pointed when identical, child's node that pointer A points to this position takes out ID and returns; Step 2: pointer A points to the next node (being so-called right sibling) of same level, compare once more, repeating step 1 if both are identical, point to next brother node again as then pointer A inequality still, compare once more, the rest may be inferred, point to last sibling up to pointer A, as still inequality, then it fails to match in explanation, searches end.
CN200710078237A 2007-02-15 2007-02-15 Fast matching method of AT instruction identifier Active CN101035372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200710078237A CN101035372B (en) 2007-02-15 2007-02-15 Fast matching method of AT instruction identifier

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200710078237A CN101035372B (en) 2007-02-15 2007-02-15 Fast matching method of AT instruction identifier

Publications (2)

Publication Number Publication Date
CN101035372A true CN101035372A (en) 2007-09-12
CN101035372B CN101035372B (en) 2010-05-26

Family

ID=38731610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200710078237A Active CN101035372B (en) 2007-02-15 2007-02-15 Fast matching method of AT instruction identifier

Country Status (1)

Country Link
CN (1) CN101035372B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447056A (en) * 2014-09-28 2016-03-30 重庆重邮信科通信技术有限公司 Method for searching attention (AT) instruction identifiers, and communication devices
CN105550215A (en) * 2015-12-03 2016-05-04 深圳市欧克勒亚科技有限公司 Storing and quick searching method for randomness and relevance of vehicle diagnosis conditions
CN110049003A (en) * 2019-03-01 2019-07-23 上海数创医疗科技有限公司 The method and device that AT instruction is divided by frame
CN112818087A (en) * 2021-02-04 2021-05-18 北京数衍科技有限公司 Printer instruction head and tail analysis method and device, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2832583B1 (en) * 2001-11-16 2004-02-27 Cit Alcatel METHOD FOR ACCESSING AN INTERNAL APPLICATION OF A RADIO COMMUNICATION TERMINAL AND TERMINAL IMPLEMENTING THIS METHOD

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105447056A (en) * 2014-09-28 2016-03-30 重庆重邮信科通信技术有限公司 Method for searching attention (AT) instruction identifiers, and communication devices
CN105550215A (en) * 2015-12-03 2016-05-04 深圳市欧克勒亚科技有限公司 Storing and quick searching method for randomness and relevance of vehicle diagnosis conditions
CN105550215B (en) * 2015-12-03 2019-02-01 深圳市欧克勒亚科技有限公司 A kind of storage and the method for quickly retrieving of vehicle diagnosis condition randomness and relevance
CN110049003A (en) * 2019-03-01 2019-07-23 上海数创医疗科技有限公司 The method and device that AT instruction is divided by frame
CN112818087A (en) * 2021-02-04 2021-05-18 北京数衍科技有限公司 Printer instruction head and tail analysis method and device, equipment and storage medium

Also Published As

Publication number Publication date
CN101035372B (en) 2010-05-26

Similar Documents

Publication Publication Date Title
EP0537894B1 (en) An apparatus and method for a federated naming system
CN1086090C (en) Automatic prefix dialing system and methods for mobile radiotelephones
CN1152515C (en) Network management system based on strategy
CN100388675C (en) A method for implementing foreground data configuration in network management system
CN1806414A (en) A method, a controller, an arrangement and a computer program for managing a configuration of clustered computers
CN101035372A (en) Fast matching method of AT instruction identifier
CN1682520A (en) System and method for accessing contact information on a communication device
CN101163043A (en) Network management function configuring method and system
JP2947111B2 (en) Exchange data transfer method and system
CN1967574A (en) Method and system to realize generating of integrated communications platform process
EP1517449A2 (en) Compression of XML documents
CN100341270C (en) Method for reflecting task progress of message based distributed platform client
CN101754155A (en) Call bill format conversion method and device and call bill processing method and system
CN101202785B (en) Method and system for searching electronic telephone directory incoming call telephone number
CN1741655A (en) Data access method for mobile communication terminal
CN1571541A (en) Short message transmitting method for PCS short message system
CN102158582B (en) Mobile terminal and number matching method thereof
CN1622083A (en) Patent download system and method
JPH07160617A (en) Multimedia server
CN1599388A (en) Equipment and method for adding network storage and search for phonebook of mobile phone
CN1764121A (en) The communication means and the communication terminal that are used for star network
JP3443135B2 (en) Record conversion processor
CN101610498B (en) Method and device for updating equipment management object at mobile terminal
CN101141289A (en) Network management system compatible method and system
CN1462135A (en) Communication message treatment equipment based on class template like management apparatus and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
ASS Succession or assignment of patent right

Owner name: CHONGQING CYIT COMMUNICATION TECHNOLOGY CO., LTD.

Free format text: FORMER OWNER: CHONGQING CHONGYOU XINKE (GROUP) CO., LTD.

Effective date: 20081017

C41 Transfer of patent application or patent right or utility model
TA01 Transfer of patent application right

Effective date of registration: 20081017

Address after: Huang Chongqing Nan'an District No. 1 Wu Fort Park Post encoding: 400065

Applicant after: Chongqing City Communication & Technology Co., Ltd.

Address before: B, 4 floor, zone 401147, Neptune science building, Chongqing, Yubei District

Applicant before: Chongqing cyit (Group) Limited by Share Ltd

C14 Grant of patent or utility model
GR01 Patent grant
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: Fast matching method of AT instruction identifier

Effective date of registration: 20141117

Granted publication date: 20100526

Pledgee: Chongqing cyit (Group) Limited by Share Ltd

Pledgor: Chongqing City Communication & Technology Co., Ltd.

Registration number: 2014500000017

PLDC Enforcement, change and cancellation of contracts on pledge of patent right or utility model
PC01 Cancellation of the registration of the contract for pledge of patent right

Date of cancellation: 20161020

Granted publication date: 20100526

Pledgee: Chongqing cyit (Group) Limited by Share Ltd

Pledgor: Chongqing City Communication & Technology Co., Ltd.

Registration number: 2014500000017

PLDC Enforcement, change and cancellation of contracts on pledge of patent right or utility model
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20170426

Address after: Nanping Street 400060 Chongqing Nan'an District Nancheng Road No. 199 left attached to the floor 403

Patentee after: Keen (Chongqing) Microelectronics Technology Co., Ltd.

Address before: 400065 Chongqing Nan'an District huangjuezhen pass Fort Park No. 1

Patentee before: Chongqing City Communication & Technology Co., Ltd.