CN102394874A - TUXEDO (Transaction for UNIX has been Extended for Distributed Operation) data protocol conversion method - Google Patents
TUXEDO (Transaction for UNIX has been Extended for Distributed Operation) data protocol conversion method Download PDFInfo
- Publication number
- CN102394874A CN102394874A CN2011103298930A CN201110329893A CN102394874A CN 102394874 A CN102394874 A CN 102394874A CN 2011103298930 A CN2011103298930 A CN 2011103298930A CN 201110329893 A CN201110329893 A CN 201110329893A CN 102394874 A CN102394874 A CN 102394874A
- Authority
- CN
- China
- Prior art keywords
- message
- protocol conversion
- data
- node
- fml32
- 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
Links
Images
Landscapes
- Computer And Data Communications (AREA)
- Communication Control (AREA)
Abstract
The invention provides a TUXEDO (Transaction for UNIX has been Extended for Distributed Operation) data protocol conversion method. The method comprises the following steps of: step 1, initializing a context needed by operating the data protocol conversion; step 2, receiving a message character flow which is input from the outer side; step 3, judging whether the input message character flow needs to be processed by a character set conversion; if so, carrying out the conversion to obtain the length of a message and distribute a corresponding memory block in an FML32 (Field Manipulation Language) buffering area; step 4, analyzing the message and pressing message nodes into the FML32 buffering area; and step 5, inquiring element data to obtain a protocol message template depended by the current message and analyzing a data flow of the FML32 buffering area through circulating the message template to generate the message; and returning the message which is treated by the protocol conversion.
Description
Technical field
The present invention relates to a kind of data transfer device; Relate in particular to a kind of TUXEDO (Transaction forUNIX has been Extended for Distributed Operation is by the UNIX transaction system after the distributed operation expansion) data protocol conversion method.
Background technology
More and more diversified along with the access terminal type, access frequency is more and more frequent, and backstage framework flexibility and high-performance are all brought new challenge.For improving cross-platform operation and high-performance, the backstage selects for use middleware server to become a kind of trend, and middleware TUXEDO is by increasing employing.The TUXEDO backstage adopts exclusive FML (Field Manipulation Language) to handle the data passes of request end and server end; And front end generally adopts JSON (JavaScript Object Notation) or XML (but ExtensibleMarkup Language extension flag language) storing page data, and how converting page data to the FML form becomes the problem that application and development will solve under this framework fast.
Prior art can not directly be changed above-mentioned three kinds of data protocols.Existing mainly is to adopt the correlation technique of resolving to a certain data protocol, as: the API of resolving FML32 (the FieldManipulation Language 32 Bit Version) data manipulation that bag and TUXEDO self provide to the Xerces-C protocol analysis bag of XML protocol analysis, the JSON-c that is directed to JSON; XML is an extend markup language, and it is the same with HTML, all is SGML (Standard Generalized MarkupLanguage, standard generalized markup language).XML is cross-platform in the internet environment, depends on the technology of content, is the strong instrument of current Processing Structure document information.Extending mark language XML is a kind of simple storage language; Use a series of simple mark data of description; And these marks can use easily mode to set up, though the XML occupation space will take more space than binary data, XML extremely simply is easy to grasp and use.JSON is a kind of data interchange format of lightweight, and it is based on the sub-set of JavaScript (Standard ECMA-262 3rd Edition-December 1999).JSON adopts the text formatting that is totally independent of language, but has also used the custom (comprising C, C++, C#, Java, JavaScript, Perl, Python etc.) that is similar to the C family of language.These characteristics make JSON become desirable exchanges data language.Be easy to the people and read and write, also be easy to machine simultaneously and resolve and generate.FML32 (Field Manipulation Language 32 Bit Version) is present the most widely used tuxedo middleware internal data format; It is fast that its advantage is that node inserts inquiry velocity; Simple to operate; Memory usage is high, and the data performance is compact, is the maximum a kind of data structure of present various sector application system employs.
According to existing technology, realize the mutual conversion between above-mentioned three kinds of agreements, need at first certain agreement is carried out protocol analysis according to the 3rd software kit that provide; Just can be transformed into other a kind of data protocol form then.Like the conversion of the data protocol from XML to FML32, need with Xerces-C the XML message to be carried out protocol analysis earlier and form DOM (Document Object Model DOM Document Object Model) tree; Then dom tree is traveled through and just can convert FML32 data protocol form to.Minimum like this needs carry out 2 message circulations.For the first time the XML message is resolved, be only for the second time and carry out the number conversion of real data protocol, also just beaten very big discount on the efficient; Simultaneously, also have higher requirement, promptly need understand the occupation mode of Xerces-C software kit and the mode of operation of dom tree, also need understand the mode of operation of FML32 data protocol form simultaneously, be unfavorable for quick Application and Development for the developer.
Summary of the invention
The objective of the invention is to; A kind of TUXEDO data protocol conversion method is provided; Improve the efficient of xml/json to fml32, fml32 to Data Format Transform between the xml/json; Memory block direct control when realizing protocol conversion, thereby frequent internal memory application and the operation of release during effectively less protocol analysis.
To achieve these goals, the present invention provides a kind of TUXEDO data protocol conversion method, and it comprises the steps:
The context that step 1, initialization data protocol conversion operation is required, it comprises by being used for configuration data deposits protocol massages template that the metadata in path defines and is loaded into character set definition, and the required stack architecture of initialization data protocol conversion that internal memory forms Hash table, obtains protocol massages according to exterior arrangement;
Whether the message character stream that step 3, judgement are imported into need carry out the character set conversion, then changes like needs, obtains the length of message, and in a FML32 buffering area, distributes corresponding memory block;
In the said step 3, the size of institute's storage allocation piece is 1.5 times of character stream length.
Said step 4 comprises: step 4.1, the owner pointer of stack architecture is revert to initial position; Step 4.2, transition status is revert to init state; Step 4.3, the message character stream that begins to circulate and import into are handled each node one by one, and according to the node corresponding data types and according to its relative position in message node are pressed in the FML32 buffering area; Step 4.4, be successfully the time, accomplish protocol conversion when stack pointer revert to stack top location and transition status.
In the said step 4, carry out the stack push operation, directly carry out the operation of popping after the Data Format Transform, finish up to whole message circulation for the message node of text class for element class message node.
Said step 5 comprises: whether the size of the memory block that step 5.1, judgement are opened up in advance satisfies the demand of this conversion, and the memory size demand of this conversion multiply by 1.5 gained according to the character stream length of importing into; Step 5.2, query metadata obtain the message template that current message relied on; Step 5.3, the owner pointer of stack architecture is revert to stack top location; Step 5.4, transition status is revert to init state; The message template that obtains in step 5.5, the circulation step 5.2; In the FML32 buffering area, obtain current node corresponding real data and node title according to node in the message template according to type and the position of node in the message template, and be written in the output buffer; Step 5.6, judge whether whether stack pointer be init state to stack top and transition status, if then change successfully; Step 5.7, return the message that obtains after the conversion.
In the said step 5.2, when the template item is masked as array item, write output buffer by the array mode.
In the said step 1, said context also comprises: judge whether to support multithreading operation, and the size of required memory piece during the conversion of opening up in advance.
Said message is JSON or XML message.
Beneficial effect of the present invention: 1). realized XML to FML32, JSON to the direct protocol conversion between the FML32, improved the efficient of protocol conversion greatly, according to current test result, than adopting traditional independent analytic technique, efficient has improved 3 times;
2). after having realized the direct translation function of data protocol; The developer can directly realize conversion through these API to page list, transmission data, background process logic etc.; Alleviated developer's burden, let the application developer can realize the application of oneself better faster;
3). because what adopt is direct conversion, the input and output of protocol conversion all are the contiguous memory pieces, have improved conversion efficiency and have helped the transmission of network data;
4). adopt metadata technique, solved the compatibility issue of XML, FML and JSON array.
In order further to understand characteristic of the present invention and technology contents, see also following about detailed description of the present invention and accompanying drawing, yet accompanying drawing only provide reference and the explanation usefulness, be not to be used for the present invention is limited.
Description of drawings
Below in conjunction with accompanying drawing, describe in detail through specific embodiments of the invention, will make technical scheme of the present invention and other beneficial effect obvious.
In the accompanying drawing,
Fig. 1 is the schematic flow sheet of TUXEDO data protocol conversion method of the present invention;
Fig. 2 is the flow path switch schematic diagram of TUXEDO data protocol conversion method of the present invention.
Embodiment
Technological means and the effect thereof taked for further setting forth the present invention are described in detail below in conjunction with the preferred embodiments of the present invention and accompanying drawing thereof.
Shown in Fig. 1-2, the present invention provides a kind of TUXEDO data protocol conversion method, and it comprises the steps:
The context that step 1, initialization data protocol conversion operation is required, it comprises by being used for configuration data deposits message template that the metadata in path defines and is loaded into character set definition, and the required stack architecture of initializtion protocol conversion that internal memory forms Hash table, obtains protocol massages according to exterior arrangement; At first the message template is loaded in the step 1 and forms Hash table in the internal memory, realize protocol module quick locating query.Obtain simultaneously the character set definition of protocol transmission message, to be implemented in the conversion of carrying out the inside and outside character set before the protocol conversion according to exterior arrangement.1), the path of metadata configurations deposit data concrete, this context comprises:, model agreement is pre-loaded to internal memory and forms a Hash table and uses for inquiry; 2), the character set requirement, comprise the character set definition of importing message into and the character set definition information of local message; 3), whether support multithreading operation; 4), the size of required memory piece during the conversion of opening up in advance, if the memory block that this is opened up in advance in transfer process can not meet the demands, will expand this memory block in good time.In the whole statement cycle of this module (the statement cycle of this module is that process initiation is to stopping), this memory block can not be released.Support the multithreading operation if desired, this memory block can be bound with thread; 5), the required stack architecture of initializtion protocol conversion.
Whether the message character stream that step 3, judgement are imported into need carry out the character set conversion, then changes like needs, obtains the length of message, and in a FML32 buffering area, distributes corresponding memory block; In the said step 3, the size of institute's storage allocation is 1.5 times of character stream length.
Message is formed in the present invention and level is loaded into internal memory (as shown in Figure 2), and each node all possibly be monodrome type or array type, and array type refers to that possibly there are many piece of data in this node.For example comprise name, sex, children in the message, wherein name and sex are the monodrome types, and children are arrays, and children's attribute possibly comprise name, sex, age, all is monodrome, and the attribute that also possibly comprise array certainly is like hobby.In flow path switch, according to the template item message item of correspondence is changed the back and fill the entering destination buffer.Describe to the example that converts into of FML32 with JSON below: provide the data protocol translation interface to carry out the data protocol conversion.
1. interface definition:
JSON is to the protocol conversion of FML32
void*Json_Trans_To_Fml32(char* json,mpw_int_t len);
Explain: this interface requirement imports the character stream of a json protocol format into.And provide the length of this character stream, and be unit with the byte, what this interface returned is the first address of an internal memory.This internal memory is to organize according to the protocol format of ml32.
Fml32 is to the protocol conversion of json
char* Fml32_Trans_To_Json(void*fml,mpw_int_t *len);
Explain: this interface requirement imports the first address of an internal memory into, and this internal memory is to organize according to the protocol format of FML32, and what this interface returned is the character stream of a JSON protocol format.The length of this character stream is taken back through second parameter l en of interface.
2. handling process:
JSON is to the protocol conversion of FML32:
Whether the size of the memory block that step 2, judgement are opened up in advance satisfies the demand of this conversion, and the memory size demand of this conversion multiply by 1.5 gained according to the character stream length of importing into;
Step 6, be successfully (Success) time when stack pointer revert to stack top location and transition status, data protocol is changed successfully.
FML32 is to the protocol conversion of JSON:
Whether the size of the memory block that step 1, judgement are opened up in advance satisfies the demand of this conversion.The memory size demand of this conversion multiply by 1.5 gained according to the character stream length of importing into;
The message template that obtains in step 5, the circulation step 2; In the FML32 buffering area, obtain current node corresponding real data and node title according to node in the message template according to type and the position of node in the message template, and be written in the output buffer;
Step 6, judge whether whether stack pointer be the eatws init state to stack top and transition status, if then show and change successfully;
Step 7, return the JSON message that obtains after the conversion.
The transfer process of XML to FML32, FML32 to XML in like manner, for example: XML is to FML32, FML32 to the XML interface definition:
void* Xml_Trans_To_Fml32(char?*xml,mpw_int_t len);
char* Fml32_Trans_To_Xml(void*fml,mpw_int_t *len);
Certainly, for the XML protocol analysis also can adopt the analytical tool bag for example rapidxml in addition, the verification of XSD format convention also can be provided to obtain higher efficient for the XML message, the unsuccessful subsequent treatment of then not carrying out of verification is to increase the robustness of using.
The above for the person of ordinary skill of the art, can make other various corresponding changes and distortion according to technical scheme of the present invention and technical conceive, and all these changes and distortion all should belong to the protection range of claim of the present invention.
Claims (8)
1. a TUXEDO data protocol conversion method is characterized in that, comprises the steps:
The context that step 1, initialization data protocol conversion operation is required, it comprises by being used for configuration data deposits protocol massages template that the metadata in path defines and is loaded into character set definition, and the required stack architecture of initialization data protocol conversion that internal memory forms Hash table, obtains protocol massages according to exterior arrangement;
Step 2, the outside message character stream that imports into of reception;
Whether the message character stream that step 3, judgement are imported into need carry out the character set conversion, then changes like needs, obtains the length of message, and in a FML32 buffering area, distributes corresponding memory block;
Step 4, message is resolved and the message node is pressed into the FML32 buffering area;
Step 5, query metadata are obtained current message and are relied on the protocol massages template, so that message is resolved and generated to the data flow of FML32 buffering area, return the message after the protocol conversion through circulation message template.
2. TUXEDO data protocol conversion method as claimed in claim 1 is characterized in that, in the said step 3, the size of institute's storage allocation piece is 1.5 times of character stream length.
3. TUXEDO data protocol conversion method as claimed in claim 1 is characterized in that said step 4 comprises: step 4.1, the owner pointer of stack architecture is revert to initial position; Step 4.2, transition status is revert to init state; Step 4.3, the message character stream that begins to circulate and import into are handled each node one by one, and according to the node corresponding data types and according to its relative position in message node are pressed in the FML32 buffering area; Step 4.4, be successfully the time, accomplish protocol conversion when stack pointer revert to stack top location and transition status.
4. TUXEDO data protocol conversion method as claimed in claim 3; It is characterized in that, in the said step 4, carry out the stack push operation for element class message node; Directly carry out the operation of popping after the Data Format Transform for the message node of text class, finish up to whole message circulation.
5. TUXEDO data protocol conversion method as claimed in claim 1; It is characterized in that; Said step 5 comprises: whether the size of the memory block that step 5.1, judgement are opened up in advance satisfies the demand of this conversion, and the memory size demand of this conversion multiply by 1.5 gained according to the character stream length of importing into; Step 5.2, query metadata obtain the message template that current message relied on; Step 5.3, the owner pointer of stack architecture is revert to stack top location; Step 5.4, transition status is revert to init state; The message template that obtains in step 5.5, the circulation step 5.2; In the FML32 buffering area, obtain current node corresponding real data and node title according to node in the message template according to type and the position of node in the message template, and be written in the output buffer; Step 5.6, judge whether whether stack pointer be init state to stack top and transition status, if then change successfully; Step 5.7, return the message that obtains after the conversion.
6. TUXEDO data protocol conversion method as claimed in claim 5 is characterized in that, in the said step 5.2, when the template item is masked as array item, writes output buffer by the array mode.
7. TUXEDO data protocol conversion method as claimed in claim 1 is characterized in that, in the said step 1, said context also comprises: judge whether to support multithreading operation, and the size of required memory piece during the conversion of opening up in advance.
8. TUXEDO data protocol conversion method as claimed in claim 1 is characterized in that, said message is JSON or XML message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110329893.0A CN102394874B (en) | 2011-10-26 | 2011-10-26 | TUXEDO (Transaction for UNIX has been Extended for Distributed Operation) data protocol conversion method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201110329893.0A CN102394874B (en) | 2011-10-26 | 2011-10-26 | TUXEDO (Transaction for UNIX has been Extended for Distributed Operation) data protocol conversion method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN102394874A true CN102394874A (en) | 2012-03-28 |
CN102394874B CN102394874B (en) | 2014-04-16 |
Family
ID=45862082
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110329893.0A Active CN102394874B (en) | 2011-10-26 | 2011-10-26 | TUXEDO (Transaction for UNIX has been Extended for Distributed Operation) data protocol conversion method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN102394874B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104363184A (en) * | 2014-10-31 | 2015-02-18 | 北京思特奇信息技术股份有限公司 | JSON message processing method and system based on tuxedo communication mode |
CN104410667A (en) * | 2014-10-31 | 2015-03-11 | 北京思特奇信息技术股份有限公司 | Method and system for conversion from XML message to JSON message |
CN105138683A (en) * | 2015-09-15 | 2015-12-09 | 歌尔声学股份有限公司 | Method and system for converting JSON data into two-dimensional array |
CN107301207A (en) * | 2017-06-02 | 2017-10-27 | 北京天融信网络安全技术有限公司 | A kind of parsing XML method and device |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1767524A (en) * | 2004-10-31 | 2006-05-03 | 中兴通讯股份有限公司 | Message processing system and its processing method |
CN101188561A (en) * | 2007-12-20 | 2008-05-28 | 北京大学 | Communication method and system for universal service data based on self-defined template |
US20080294712A1 (en) * | 2007-05-22 | 2008-11-27 | Bea Systems, Inc. | System and method for web services gateway server |
CN102185901A (en) * | 2011-04-19 | 2011-09-14 | 北京神州数码思特奇信息技术股份有限公司 | Client message conversion method |
-
2011
- 2011-10-26 CN CN201110329893.0A patent/CN102394874B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1767524A (en) * | 2004-10-31 | 2006-05-03 | 中兴通讯股份有限公司 | Message processing system and its processing method |
US20080294712A1 (en) * | 2007-05-22 | 2008-11-27 | Bea Systems, Inc. | System and method for web services gateway server |
CN101188561A (en) * | 2007-12-20 | 2008-05-28 | 北京大学 | Communication method and system for universal service data based on self-defined template |
CN102185901A (en) * | 2011-04-19 | 2011-09-14 | 北京神州数码思特奇信息技术股份有限公司 | Client message conversion method |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104363184A (en) * | 2014-10-31 | 2015-02-18 | 北京思特奇信息技术股份有限公司 | JSON message processing method and system based on tuxedo communication mode |
CN104410667A (en) * | 2014-10-31 | 2015-03-11 | 北京思特奇信息技术股份有限公司 | Method and system for conversion from XML message to JSON message |
CN104410667B (en) * | 2014-10-31 | 2017-12-12 | 北京思特奇信息技术股份有限公司 | Conversion method and system of a kind of XML message to JSON messages |
CN104363184B (en) * | 2014-10-31 | 2018-04-17 | 北京思特奇信息技术股份有限公司 | A kind of JSON message processing methods and system based on tuxedo communication patterns |
CN105138683A (en) * | 2015-09-15 | 2015-12-09 | 歌尔声学股份有限公司 | Method and system for converting JSON data into two-dimensional array |
CN105138683B (en) * | 2015-09-15 | 2018-06-15 | 歌尔股份有限公司 | JSON data turn the method and system of two-dimensional array |
CN107301207A (en) * | 2017-06-02 | 2017-10-27 | 北京天融信网络安全技术有限公司 | A kind of parsing XML method and device |
Also Published As
Publication number | Publication date |
---|---|
CN102394874B (en) | 2014-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Ooms | The jsonlite package: A practical and consistent mapping between json data and r objects | |
TWI272492B (en) | Contents conversion system, automatic style sheet selection method and program thereof | |
US7873663B2 (en) | Methods and apparatus for converting a representation of XML and other markup language data to a data structure format | |
CN104699718B (en) | Method and apparatus for being rapidly introduced into business datum | |
Lam et al. | XML document parsing: Operational and performance characteristics | |
US7458022B2 (en) | Hardware/software partition for high performance structured data transformation | |
CN103294652B (en) | A kind of data transfer device and system | |
CN106611044B (en) | SQL optimization method and equipment | |
CN108885632A (en) | High Efficient State Machine for real-time stream programming | |
US7328403B2 (en) | Device for structured data transformation | |
Kaur et al. | An evaluation of protocol buffer | |
WO2013135055A1 (en) | Method for storing xml data into relational database | |
Dai et al. | A 1 cycle-per-byte XML parsing accelerator | |
EP1678643A1 (en) | Expression grouping and evaluation | |
CN102394874B (en) | TUXEDO (Transaction for UNIX has been Extended for Distributed Operation) data protocol conversion method | |
Zunke et al. | Json vs xml: A comparative performance analysis of data exchange formats | |
CN109933331A (en) | Data transfer device and associated component between a kind of client-server | |
JP2014182461A (en) | Communication apparatus, communication method, communication system and program | |
CN104601554B (en) | A kind of method for interchanging data and DEU data exchange unit | |
JP2006221653A (en) | System and method for determining acceptance state in document analysis | |
US8015483B2 (en) | Processing an XML feed with extensible or non-typed elements | |
Izsó et al. | IncQuery-D: incremental graph search in the cloud. | |
Kaur et al. | A Literature Review on Device-to-Device Data Exchange Formats for IoT Applications | |
US9201838B2 (en) | Systems and methods for the efficient exchange of hierarchical data | |
KR102407941B1 (en) | User interface generation method of electronic device calling function or procedure of external device based on remote procedure call(rpc), program and electronic device thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20210506 Address after: 518048 308, block a, shenzhuang general building, 6 Guanglan Road, free trade zone, Futian District, Shenzhen City, Guangdong Province Patentee after: Winbet Technology Co.,Ltd. Address before: 518000 3rd floor, T3 building, Nanqi Road, South District, Shenzhen hi tech Industrial Park, Guangdong Province Patentee before: SHENZHEN TYDIC INFORMATION TECHNOLOGY Co.,Ltd. |
|
TR01 | Transfer of patent right |