CN102624894A - Method and system for depacketize and message analysis - Google Patents

Method and system for depacketize and message analysis Download PDF

Info

Publication number
CN102624894A
CN102624894A CN2012100616245A CN201210061624A CN102624894A CN 102624894 A CN102624894 A CN 102624894A CN 2012100616245 A CN2012100616245 A CN 2012100616245A CN 201210061624 A CN201210061624 A CN 201210061624A CN 102624894 A CN102624894 A CN 102624894A
Authority
CN
China
Prior art keywords
message
xml
markup language
extend markup
class
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
CN2012100616245A
Other languages
Chinese (zh)
Other versions
CN102624894B (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.)
BEIJING DIGITAL CHINA SI-TECH INFORMATION TECHNOLOGY Co Ltd
Original Assignee
BEIJING DIGITAL CHINA SI-TECH INFORMATION TECHNOLOGY 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 BEIJING DIGITAL CHINA SI-TECH INFORMATION TECHNOLOGY Co Ltd filed Critical BEIJING DIGITAL CHINA SI-TECH INFORMATION TECHNOLOGY Co Ltd
Priority to CN201210061624.5A priority Critical patent/CN102624894B/en
Publication of CN102624894A publication Critical patent/CN102624894A/en
Application granted granted Critical
Publication of CN102624894B publication Critical patent/CN102624894B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a method and system for depacketize and message analysis. The method is characterized by packaging all operations of XML (Extensible Markup Language) messages in an XML Parser class in a province first-class system by adopting Java technique and Jdom analysis technique, and calling according to the following steps: (1) public String proc MessageTo XML, organizing a plurality of filled value objects into a XML message, and (2) public void proc XML ToMessage, analyzing XML Str according to a control file filaName, and respectively storing mesHead and msgBody in the hash of mesHead and the hash of msgBody.

Description

A kind of message assembling and the method and system of resolving
Technical field
The present invention relates to Java technology and extend markup language (XML) technology, concrete a kind of extend markup language (XML) message assembling and analytic method and the system of relating to.
Background technology
In the one-level BOSS of China Mobile Communication Group Co., Ltd. pivoting system, the message when each province BOSS system and each business platform and center one-level BOSS hinge carry out service data interaction all is to use extend markup language (XML) message format to carry out.In move when group issues one-level BOSS new demand at every turn and all the corresponding interface standard can be provided, stipulated each business transaction extend markup language (XML) form in the standard.Economizing interface specification that BOSS need provide according to group when realizing that this type is professional dresses up the data set of accepting of this type business extend markup language (XML) message and sends to center one-level BOSS hinge and carry out data interaction with other provinces BOSS.
Just be based on the demand of this type business, developing a kind of assembling of extend markup language (XML) message and the method for resolving to the one-level BOSS of China Mobile interface specification.This method has effectively solved loaded down with trivial details extend markup language (XML) message assembling process; Only need just can assemble out corresponding extend markup language (XML) message according to different business standard configuration control corresponding file; Need not be each professional independent extend markup language (XML) message assembly program of writing; Compare with the analytic message program with traditional assembling, saved a large amount of size of codes, improved the efficient of exploitation greatly.The technology that exploitation the method is used is Java technology and Jdom analytic technique; Its Core Feature is can populated several values object be become to be organized into extend markup language (XML) message automatically; Also can deposit in the Ha shMap data structure simultaneously according to the automatic parsing extend markup language of control documents (XML) message and with the data message of resolving; Carry out data interaction very easily and obtain; Also have certain fail safe simultaneously, can encrypt according to the data field that configuration is maintained secrecy to needs.
Because one-level BOSS business needs frequent carrying out alternately with other provinces BOSS or business platform in the process that realizes, and in mutual process, message is all expressed with extend markup language (XML) message format.For this reason; Developed a trocar to assembling of the one-level BOSS of China Mobile Communication Group Co., Ltd. interface specification and parsing extend markup language (XML) method of message; This method only needs to write control documents and VO class according to the interface specification that group provides; The VO class is the java value object, can generate automatically according to control documents, uses the VO class to embody the OO thought of java; Just can assemble automatically through method call and parsing extend markup language (XML) message.This cover analytic method has good public character simultaneously; Reusability is high; No matter much how complicated message node level is, can both assemble automatically and resolve, saved the assembling of direct use JDOM technology and numerous and diverse property of resolving; Software quality is significantly improved, promoted the competitive advantage in of the same trade.
Summary of the invention
Technical scheme of the present invention is following:
The present invention provides a kind of message assembling and resolution system method, it is characterized in that:
Use Java technology and Jdom analytic technique, the operation with extend markup language (XML) message in economizing branch one level system all is encapsulated in extend markup language (XML) the Parser class, and adopts following method to supply to call:
(1) public String procMessageTo extend markup language (XML) is made into extend markup language (XML) message with populated several values group of objects;
(2) public void proc extend markup language (XML) ToMessage according to control documents filaName analytic message extend markup language (XML) Str, leaves heading and message body among msgHead and two hash of msgBody in respectively.
Wherein need accomplish following steps before at call method (1):
Set 3 parameters, first Parameter H aspMap data type is represented heading, and second Parameter H ashMap data type represented the message body, and what the 3rd parameter S tring type represented is the control documents title.
The data of wherein depositing among the HaspMap all are to assemble content of message, and key assignments just is being the node of assembling message, and the HashMap data generate through Automatic Program, and corresponding Vo class is called the propertyToHash method of oneself.
Wherein each Vo class all need realize the Message interface.
The Vo class need realize that all the Message interface can adopt property value with the Vo class to be put among the HashMap or according to the data assignment that HashMap deposits and give the field attribute of Vo class, and the two is reverse each other.
The field attribute of Vo class is the element term of each business transaction message of group's normalized definition.
Wherein need accomplish following steps before at call method (2):
Proc extend markup language (XML) ToMessage is extend markup language (XML) message that analytical center returns; And the data of resolving are deposited among the Ha shMap, set extend markup language (XML) message, control documents that 4 parameters represent respectively to receive, deposit the HashMap of heading and deposit the HashMap of message body.
Method (1) and (2) reverse process each other wherein.
The present invention also provides a kind of message assembling and resolution system, it is characterized in that:
Adopt Java technology and Jdom analytic technique, the operation with extend markup language (XML) message in economizing branch one level system all is encapsulated in extend markup language (XML) the Parser class, and adopts following method call module:
The first method calling module: public String procMessageTo extend markup language (XML) is made into extend markup language (XML) message with populated several values group of objects;
The second method calling module: public void proc extend markup language (XML) ToMessage; According to control documents filaName analytic message extend markup language (XML) Str, respectively heading and message body are left among msgHead and two hash of msgBody.
Wherein before calling the first method calling module, need to accomplish following steps:
Set 3 parameters, first Parameter H aspMap data type is represented heading, and second Parameter H ashMap data type represented the message body, and what the 3rd parameter S tring type represented is the control documents title.
The data of wherein depositing among the HaspMap all are to assemble content of message, and key assignments just is being the node of assembling message, and the HashMap data generate through Automatic Program, and corresponding Vo class is called the propertyToHash method of oneself.
Wherein each Vo class all need realize the Message interface.
The Vo class need realize that all the Message interface can adopt property value with the Vo class to be put among the HashMap or according to the data assignment that HashMap deposits and give the field attribute of Vo class, and the two is reverse each other.
The field attribute of Vo class is the element term of each business transaction message of group's normalized definition.
Wherein before calling the second method calling module, need to accomplish following steps:
Proc extend markup language (XML) ToMessage is extend markup language (XML) message that analytical center returns; And the data of resolving are deposited among the HashMap, set extend markup language (XML) message, control documents that 4 parameters represent respectively to receive, deposit the Ha shMap of heading and deposit the Ha shMap of message body.
The first method calling module and second method calling module reverse process each other wherein.
Description of drawings
Fig. 1 is that the message sketch map is shut down in the definition strange land in the group provided by the invention standard;
Fig. 2 is that the schematic diagram data that inserts is shut down in strange land provided by the invention;
Fig. 3 is the information sketch map of handling the strange land shutdown service of filling in provided by the invention;
Embodiment
This assembling mainly is to use Java technology and Jdom analytic technique with the method for parsing extend markup language (XML); Operation to extend markup language (XML) message in economizing branch one level system all is encapsulated in extend markup language (XML) the Parser class, and the method that wherein mainly contains two cores supplies to call:
(1) public String procMessageTo extend markup language (XML) (HashMap msgHead, HashMap msgBody, String fileName) is made into extend markup language (XML) message with populated several values group of objects
(2) public void proc extend markup language (XML) ToMessage (String extend markup language (XML) Str; String fileName; HashMap msgHead; HashMap msgBody), respectively heading and message body are left among msgHead and two hash of msgBody according to control documents filaName analytic message extend markup language (XML) Str
From the parameter of these two methods, before call method, need do some preparations, first method procMessageTo extend markup language (XML) invocation step is following:
Be ready to 3 parameters, first Parameter H a spMap data type is represented heading, and second Parameter H ashMap data type represented the message body, and what the 3rd parameter S tring type represented is the control documents title.The data of depositing among the HaspMap all are to assemble content of message, and key assignments will be assembled the node of message just, and these HashMap data also generate through Automatic Program certainly, and the propertyToHash method that only needs corresponding Vo class to call oneself gets final product.This shows, the most important thing is before to want populated value object Vo class at the assembling message, and the professional just data of accepting of the data that the Vo class is deposited just need to carry out mutual data with other province BOSS or business platform.Each Vo class all need realize the Message interface when design, and the Message interface code is following:
Figure BDA0000141871900000071
It contains two methods, and one is that property value with the Vo class is put among the HashMap, and another is to give the field attribute of Vo class according to the data assignment that HashMap deposits, and the two is reverse each other.
Mention here, so clearly assemble the message the very important point and write the Vo class exactly, the Vo class is to write according to what group's standard was come, and the field attribute of Vo class is the element term of each business transaction message of group's normalized definition just.The title of control documents also is unique simultaneously, contains the coding of each transaction in the title, and the transaction coding is by group's normalized definition; Each transaction generally all needs two control documents; One is used for initiating transaction, and one is used to land transaction, before assembling extend markup language (XML) message; Program also can find the control documents of needs certainly according to configuration; General these required configuration informations all have been placed in the SOBOPERCODE table, and SOBOPERCODE is the service configuration information table, and each necessary information of concluding the business has been deposited in the inside.
In view of this, before calling this method assembling extend markup language (XML) message of procMessageTo extend markup language (XML), the work that needs us to do is exactly with Vo class assignment, and other information needed all have program to help us to accomplish automatically.After being ready to these parameter calls procMessageTo extend markup language (XML) method; What specifically use is exactly the process of utilizing Java technology and Jdom analytic technique and professional characteristics own to assemble message, the thought of the recurrence that the inside includes, and whole assemble method is not limited to certain business; Be applicable to all transaction; Have good public property, here its concrete realization details is not just being narrated, in our program code, realized this function.
Second method proc extend markup language (XML) ToMessage is extend markup language (XML) message that analytical center returns; And the data of resolving are deposited among the HashMap; 4 parameters are represented extend markup language (XML) message, control documents, the HashMap that deposits heading that receives, the HashMap that deposits the message body respectively; This method is a process reverse each other with first method procMessageTo extend markup language (XML); Concrete implementation is similar, and its concrete implementation procedure is not being given unnecessary details.
The above is merely preferred embodiment of the present invention, and is in order to restriction the present invention, not all within spirit of the present invention and principle, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.
It below is an embodiment of technical scheme according to the present invention
1, the business norms that issue according to group are finished writing initiation and two extend markup languages (XML) control documents that lands.
2, finish writing corresponding VO class according to group's standard or control documents.
3, in service allocation list SOBOPERCODE, dispose data according to certain business information that defines in group's standard.
4, call procMessageTo extend markup language (XML) (HashMap msgHead in extend markup language (XML) the Parser class; HashMap msgBody; String fileName) method is organized message or proc extend markup language (XML) ToMessage (String extend markup language (XML) Str; String fileName, HashMap msgHead, HashMapmsgBody) method analytic message (these two methods are explained in the technical scheme in front).
5, can check extend markup language (XML) message that assembles and the detailed process of analytic message through the backstage daily record.
Enumerate a real case below, the invoked procedure of this method is described, enumerate the assembling process that message is shut down in the strange land.It is as shown in Figure 1 that message is shut down in the definition strange land in group's standard:
At first write out following control documents according to message:
Figure BDA0000141871900000091
Figure BDA0000141871900000111
Figure BDA0000141871900000121
Figure BDA0000141871900000131
After control documents is finished writing, upload to respective directories and get final product.To write out following 2 Vo classes according to interface specification or control documents simultaneously:
Figure BDA0000141871900000132
Figure BDA0000141871900000141
Figure BDA0000141871900000151
Figure BDA0000141871900000161
Figure BDA0000141871900000171
Also need at last in service allocation list SOBOPERCODE, to insert data according to the information in the interface specification, it is as shown in Figure 2 that the data of inserting are shut down in the strange land.
After being ready to above work, just can call method the assembling message, at first handle the strange land shutdown service from front page layout, it is as shown in Figure 3 to fill in the information of handling the strange land shutdown service:
Can see that from the backstage message after the assembling sends after clicking affirmation.
Above message generates through calling the said extend markup language of this paper (XML) message assemble method.Simultaneously can see the response message that the center is returned
Figure BDA0000141871900000201
Figure BDA0000141871900000211
Program also can be resolved the message that this returns according to our control documents of replying of configuration automatically, and the information of resolving is returned to front page layout.
More than be exactly the process of strange land shutdown service assembling message, the service message assembling of other province one level systems all is this process, therefrom can find out and utilize this method can assemble easily and parsing extend markup language (XML) message.

Claims (16)

1. a message is assembled and the resolution system method, it is characterized in that:
Use Java technology and Jdom analytic technique, the operation with extend markup language (XML) message in economizing branch one level system all is encapsulated in extend markup language (XML) parsing program (Parser) class, and adopts following method to supply to call:
(1) common characters string manipulation message (public String procMessage) is made into extend markup language (XML) message to extend markup language (XML) with populated several values group of objects;
(2) the public idle extend markup language (public void procXML) of handling is to message (Message); According to control documents filaName analytic message extend markup language (XML) Str, respectively heading and message body are left in heading (msgHead) and two hashes of message body (msgBody) (hash).
2. method according to claim 1, wherein need accomplish following steps before at call method (1):
Set three parameters, first Parameter H aspMap data type is represented heading, and second Parameter H ashMap data type represented the message body, and what the 3rd parameter S tring type represented is the control documents title.
3. like the said method of claim 2, the data of wherein depositing among the HaspMap all are to assemble content of message, and key assignments just is being the node of assembling message, and the HashMap data generate through Automatic Program, and corresponding Vo class is called the propertyToHash method of oneself.
4. like the said method of claim 3, wherein each Vo class all need realize the Message interface.
5. like the said method of claim 4, the Vo class need realize that all the Message interface can adopt property value with the Vo class to be put among the HashMap or according to the data assignment that HashMap deposits and give the field attribute of Vo class, and the two is reverse each other.
6. like the arbitrary said method of claim 1-5, the field attribute of Vo class is the element term of each business transaction message of group's normalized definition.
7. method according to claim 1, wherein need accomplish following steps before at call method (2):
Handle extend markup language (XML) message that extend markup language returns for analytical center to message (procXML ToMessage); And the data of resolving are deposited among the HashMap, set extend markup language (XML) message, control documents that 4 parameters represent respectively to receive, deposit the HashMap of heading and deposit the HashMap of message body.
8. method according to claim 1, wherein method (1) and (2) reverse process each other.
9. a message is assembled and resolution system, it is characterized in that:
This system adopts the Java technology to assemble and resolve with the Jdom analytic technique, and the operation with extend markup language (XML) message in economizing branch one level system all is encapsulated in extend markup language (XML) the Parser class, and adopts following method call module:
The first method calling module: common characters string manipulation message (public String procMessage) is made into extend markup language (XML) message to extend markup language (XML) with populated several values group of objects;
The second method calling module: the public idle extend markup language (public void procXML) of handling is to message (Message); According to control documents filaName analytic message extend markup language (XML) Str, respectively heading and message body are left in heading (msgHead) and two hashes of message body (msgBody) (hash).
10. like the said system of claim 9, wherein before calling the first method calling module, need to accomplish following steps:
Set three parameters, first Parameter H aspMap data type is represented heading, and second Parameter H ashMap data type represented the message body, and what the 3rd parameter S tring type represented is the control documents title.
11. like the said system of claim 10; The data of wherein depositing among the HaspMap all are to assemble content of message; Key assignments just is being the node of assembling message, and the HashMap data generate through Automatic Program, and corresponding Vo class is called the propertyToHash method of oneself.
12. like the said system of claim 11, wherein each Vo class all need realize the Message interface.
13. like the said system of claim 12, the Vo class need realize that all the Message interface can adopt property value with the Vo class to be put among the HashMap or according to the data assignment that HashMap deposits and give the field attribute of Vo class, the two is reverse each other.
14. like the arbitrary said system of claim 9-13, the field attribute of Vo class is the element term of each business transaction message of group's normalized definition.
15., wherein before calling the second method calling module, need to accomplish following steps like the said system of claim 9:
Proc extend markup language (XML) ToMessage is extend markup language (XML) message that analytical center returns; And the data of resolving are deposited among the HashMap, set extend markup language (XML) message, control documents that 4 parameters represent respectively to receive, deposit the HashMap of heading and deposit the HashMap of message body.
16. like the said system of claim 9, the first method calling module and second method calling module reverse process each other wherein.
CN201210061624.5A 2012-03-09 2012-03-09 Method and system for depacketize and message analysis Active CN102624894B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210061624.5A CN102624894B (en) 2012-03-09 2012-03-09 Method and system for depacketize and message analysis

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210061624.5A CN102624894B (en) 2012-03-09 2012-03-09 Method and system for depacketize and message analysis

Publications (2)

Publication Number Publication Date
CN102624894A true CN102624894A (en) 2012-08-01
CN102624894B CN102624894B (en) 2014-10-22

Family

ID=46564576

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210061624.5A Active CN102624894B (en) 2012-03-09 2012-03-09 Method and system for depacketize and message analysis

Country Status (1)

Country Link
CN (1) CN102624894B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646015A (en) * 2013-12-06 2014-03-19 中国银行股份有限公司 Method and system for sending, receiving and transmitting XML message
CN105279032A (en) * 2015-11-24 2016-01-27 浪潮(北京)电子信息产业有限公司 Method and apparatus for synchronizing interface message and javaBean
CN106406825A (en) * 2015-07-27 2017-02-15 中兴通讯股份有限公司 Command line processing method and device
CN112785284A (en) * 2020-12-31 2021-05-11 银清科技有限公司 Message storage method and device based on structured document
CN113037727A (en) * 2021-02-26 2021-06-25 北京北信源信息安全技术有限公司 Message information processing method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009015569A1 (en) * 2007-07-27 2009-02-05 Huawei Technologies Co., Ltd. Data format verification method and device
US20100100537A1 (en) * 2008-10-22 2010-04-22 Fwix, Inc. System and method for identifying trends in web feeds collected from various content servers
CN102185901A (en) * 2011-04-19 2011-09-14 北京神州数码思特奇信息技术股份有限公司 Client message conversion method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009015569A1 (en) * 2007-07-27 2009-02-05 Huawei Technologies Co., Ltd. Data format verification method and device
US20100100537A1 (en) * 2008-10-22 2010-04-22 Fwix, Inc. System and method for identifying trends in web feeds collected from various content servers
CN102185901A (en) * 2011-04-19 2011-09-14 北京神州数码思特奇信息技术股份有限公司 Client message conversion method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646015A (en) * 2013-12-06 2014-03-19 中国银行股份有限公司 Method and system for sending, receiving and transmitting XML message
CN103646015B (en) * 2013-12-06 2017-07-28 中国银行股份有限公司 Transmission, the method and system for receiving and transmitting XML message
CN106406825A (en) * 2015-07-27 2017-02-15 中兴通讯股份有限公司 Command line processing method and device
CN105279032A (en) * 2015-11-24 2016-01-27 浪潮(北京)电子信息产业有限公司 Method and apparatus for synchronizing interface message and javaBean
CN112785284A (en) * 2020-12-31 2021-05-11 银清科技有限公司 Message storage method and device based on structured document
CN113037727A (en) * 2021-02-26 2021-06-25 北京北信源信息安全技术有限公司 Message information processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN102624894B (en) 2014-10-22

Similar Documents

Publication Publication Date Title
CN100489774C (en) Structured code automatic configuration method and device
CN103970737B (en) A kind of data configuration method and apparatus
CN106599104A (en) Mass data association method based on redis cluster
CN102624894B (en) Method and system for depacketize and message analysis
CN103123631B (en) The generation of official documents and correspondence, the methods of exhibiting of webpage official documents and correspondence, device and Website server
CN104484216A (en) Method and device for generating service interface document and on-line test tool
CN101515929B (en) Message format conversion method, network device and agent device
AU2015331025A1 (en) Emulating manual system of filing using electronic document and electronic file
CN105760534A (en) User-defined serializable data structure, hadoop cluster, server and application method thereof
CN102810057A (en) Log recording method
CN102708203A (en) Database dynamic management method based on XML metadata
CN104461531B (en) A kind of implementation method of reporting system SQL
CN105637478A (en) Computer-aided development of native mobile application code
CN101739452A (en) Data exchange interface and realizing method thereof
CN101963990A (en) Digital modeling and searching method for personal relationships and events
CN101316296B (en) Method and system for managing generation of multiple electronic work orders
CN105005543A (en) Interface generation apparatus and method
CN102004787A (en) Method for combining multiple application scene forms based on office software plugins
CN106557307A (en) The processing method and processing system of business datum
CN102999329B (en) The Active Directory interface exploitation method of configuration is mapped based on extend markup language
CN108804241A (en) Cross-platform method for scheduling task, system, computer equipment and storage medium
CN109413131A (en) A kind of method and device of log parsing
CN106407288A (en) Method and system for synchronously updating information
CN101320453B (en) Electronic official document circulation automatization method based on Web service
CN101794223B (en) Design method of WADE service message architecture

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C53 Correction of patent of invention or patent application
CB02 Change of applicant information

Address after: 100085 Haidian District, Zhongguancun, South Street, No. 6,, building information, floor, No. 16

Applicant after: SI-TECH Information Technology Ltd.

Address before: 100085 Haidian District, Zhongguancun, South Street, No. 6,, building information, floor, No. 16

Applicant before: Beijing Digital China SI-TECH Information Technology Co., Ltd.

COR Change of bibliographic data

Free format text: CORRECT: APPLICANT; FROM: BEIJING DIGITAL CHINA SI-TECH INFORMATION TECHNOLOGY LTD. TO: BEIJING SI-TECH INFORMATION TECHNOLOGY LTD.

C14 Grant of patent or utility model
GR01 Patent grant