CN105162692A - Efficient data serialization interaction method - Google Patents
Efficient data serialization interaction method Download PDFInfo
- Publication number
- CN105162692A CN105162692A CN201510591457.9A CN201510591457A CN105162692A CN 105162692 A CN105162692 A CN 105162692A CN 201510591457 A CN201510591457 A CN 201510591457A CN 105162692 A CN105162692 A CN 105162692A
- Authority
- CN
- China
- Prior art keywords
- xini
- file
- data
- client
- request
- 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
Abstract
The invention discloses an efficient data serialization interaction method, comprising the following steps: packaging the information of a client through a data interaction format XINI, using a server to receive the information, analyze XINI data and verify the XINI data, packaging the information of the server to XINI, and sending XINI to the client for reception and storage; browsing a server shared file, packaging an access request and an access path through XINI; using the server to scan a file tree under a corresponding path according to the access path, formatting the file tree according to XINI, and using the client to rebuild the file tree; carrying out play access on a corresponding file according to the file tree, formatting a demultiplexing request and the accessed file path according to XINI, using the server to receive the demultiplexing request, building a demultiplexing module and a data sending module according to the file path, and replying an XINI formatted ready message to the client; and carrying out play, frame skip, stop and sending on the file through an XINI formatting request, sending request data to the server, and using the server to execute a command according to a corresponding request and replying the client.
Description
Technical field
The present invention relates to the method for packing of data interaction, specifically, relate to a kind of Data Serialization exchange method efficiently.
Background technology
In distributed player, communicate and need a large amount of data interactions between end with end, as shown in Figure 1, the network information of such as holding, shares data message, control command information etc.During current data is mutual, no matter the most frequently used form of network or this locality is exactly XML, XML was wanted to replace HTML originally, was mainly used in transfer of data, configuration file etc. afterwards.
Can data very easily in encapsulation of data reciprocal process by XML language; but in xml; mark (Tag) must occur in pairs; packet is trapped among centre; therefore XML first must find mark (Tag) above when resolving and encapsulating; and then find mark below (Tag) that the content that element tundish contains could be determined; the parsing of XML will jumping over back and forth in a stream; this slowly, can affect performance very much under large complications especially for large Data Analysis.
Summary of the invention
For solving the problems of the technologies described above, the invention provides a kind of Data Serialization exchange method efficiently, comprising step:
Connect, the information of client of being packed by data interaction form XINI, comprise the network information of end, system information, service end receives information, resolve XINI data, effect information, and become XINI send to client to receive and preserve the network information of service end, system information and shared information package;
Browse described service end shared file, the path of packed by XINI access request and access; Described service end scans the file tree under local respective path according to the path of described access, is formatd by described file tree according to XINI, then beams back described client reset file tree;
According to described file tree, broadcasting access is carried out to corresponding file, XINI formats the file path of demultiplexing request and access, service end receives described demultiplexing request, demultiplexing module and data transmission blocks is set up according to file path, and that formats to client reply XINI gets out Ready message, client builds data receiver, data decode and rendering module after receiving and getting out Ready message, then notifies that UI layer is play;
Carry out the broadcasting of file, frame-skipping, stopping and file by XINI formatted requests to send, then request msg is sent to service end, service end according to after corresponding request execution command, then replys client.
Preferably, described data interaction form XINI, is further: the data interaction form improvement encapsulated by XML in distributed player is data interaction form XINI.
Preferably, the syntax format of described data interaction form XINI comprises:
Mark, is used for defining element term and Property Name;
Element, is made up of element term and element content;
Attribute, is made up of Property Name and property content, and each unit have a special attribute, represents the number of the daughter element comprised, and is positioned at last attribute;
The inclusion relation of element;
Empty element, sleazy element;
Statement;
And annotation.
Compared with prior art, efficient Data Serialization exchange method of the present invention, reaches following effect:
(1) new data interaction encapsulation format is more directly perceived, can very easily by the scanning of a pass coding, and complete the parsing to whole data flow and encapsulation, greatly the structure of expedited data element-tree, the parsing comparing XML and JSON can be fast 3 ~ 5 times.
(2) carry out coded data easily at Email, to transmit in the agreements such as HTTP, and be ciphertext display.
Accompanying drawing explanation
Accompanying drawing described herein is used to provide a further understanding of the present invention, forms a part of the present invention, and schematic description and description of the present invention, for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is the data interaction figure between the end of prior art and end;
Fig. 2 is the data interaction figure between end of the present invention and end.
Embodiment
As employed some vocabulary to censure specific components in the middle of specification and claim.Those skilled in the art should understand, and hardware manufacturer may call same assembly with different noun.This specification and claims are not used as with the difference of title the mode distinguishing assembly, but are used as the criterion of differentiation with assembly difference functionally." comprising " as mentioned in the middle of specification and claim is in the whole text an open language, therefore should be construed to " comprise but be not limited to "." roughly " refer to that in receivable error range, those skilled in the art can solve the technical problem within the scope of certain error, reach described technique effect substantially.In addition, " couple " word and comprise directly any and indirectly electric property coupling means at this.Therefore, if describe a first device in literary composition to be coupled to one second device, then represent described first device and directly can be electrically coupled to described second device, or be indirectly electrically coupled to described second device by other devices or the means that couple.Specification subsequent descriptions is for implementing better embodiment of the present invention, and right described description is to illustrate for the purpose of rule of the present invention, and is not used to limit scope of the present invention.Protection scope of the present invention is when being as the criterion depending on the claims person of defining.
Below in conjunction with accompanying drawing, the present invention is described in further detail, but not as a limitation of the invention.
Embodiment 1:
Present embodiments provide a kind of Data Serialization exchange method efficiently, comprise step:
Step 101: connect, the information of client of being packed by data interaction form XINI, comprise the network information of end, system information, service end receives information, resolve XINI data, effect information, and become XINI send to client to receive and preserve the network information of service end, system information and shared information package;
Information format is such as:
Step 102: browse described service end shared file, the path of packed by XINI access request and access; Described service end scans the file tree under local respective path according to the path of described access, is formatd by described file tree according to XINI, then beams back described client reset file tree;
Step 103: broadcasting access is carried out to corresponding file according to described file tree, XINI formats the file path of demultiplexing request and access, service end receives described demultiplexing request, demultiplexing module and data transmission blocks is set up according to file path, and that formats to client reply XINI gets out (Ready) message, client builds data receiver, data decode and rendering module after receiving and getting out (Ready) message, then notifies that UI layer is play;
Form is such as:
Step 104: carry out the broadcasting of file, frame-skipping, stopping and file by XINI formatted requests and send, then request msg is sent to service end, service end according to after corresponding request execution command, then replys client.
Described data interaction form XINI, is further: the data interaction form improvement encapsulated by XML in distributed player is data interaction form XINI.
The syntax format of described data interaction form XINI comprises:
Mark, is used for defining element term and Property Name;
Element, is made up of element term and element content;
Attribute, is made up of Property Name and property content, and each unit have a special attribute, represents the number of the daughter element comprised, and is positioned at last attribute;
The inclusion relation of element;
Empty element, sleazy element;
Statement;
And annotation.
The present invention is the data interaction form improvement encapsulated by XML in distributed player is the more quick data interaction form of one, being named as XINI, accelerating the parsing when holding data interaction when communicating between end and multiplexing speed.
Embodiment 2:
On the basis of embodiment 1, the present embodiment is Application Example:
The syntax format of XINI with XML the spitting image of, also comprise as follows:
Mark (Tag): be used for defining element term and Property Name;
Element (Element): be made up of element term and element content;
Attribute (Attribute): be made up of Property Name and property content.Each unit have a special attribute and SON, represents the number of the daughter element comprised, and is positioned at last attribute;
The inclusion relation of element: element (attribute, daughter element (attribute, daughter element));
Empty element: sleazy element;
Statement (Declaration);
And annotation.
The example of XINI is as follows:
<?xini:version="1.0";encoding="UTF-8";>
<!Mydoc="mydoc.data";>
<mydoc=dadf;5>
<title=XINIDoc;>
<author=kkk;>
<email=kkkgoogle.com;>
<date=20150802;>
<dn=95;3;>
<val-0=
95*Vpe6VpmCguqyFK+YCKiYJeq8Aumgzeyxz2Vjt65Kp2VyuiVdpiV4rT9xpmRLr;>
<val-1=
yUOc34QbA94dP8Mk2VoczoQbA51gOVaon1xrClPpiV3i5cJiB1ebARMd49xbCRMd;>
<val-2=00;>
Above-mentioned is that the transfer process of data format XINI is as follows alternately by data format XML:
1) XML is resolved to independently element-tree, comprise attribute.
2) according to the element relation in this tree, be encapsulated as new XINI form, the mark (Tag) of element is the same with the element flag (Tag) in XML, and element content is connected by "=", and "=" is element content below; Connect attribute of an element after element content, the content of element property is also connected by "=", between element property by "; " separate, last attribute of element is the number comprising daughter element, by integer representation.
3) the data type character supported, integer, floating-point, long, double-precision floating point, array, binary system, BASE64 type, in transfer process, element corresponding in XML is converted to XINI element, XINI element format is following 4 ~ 8 entries.
4) element of character types is formed: < marks (Tag)+"="+character value >.
5) element of integer, floating-point, long, double-precision floating point is formed: < marks (Tag)+"="+value and is converted to character >.
6) array type element is formed: < marks (Tag)+"="+" { "+v0, v1, v2+ " } " >.
7) binary element is formed:
< marks (Tag)+"="+binary element length >
< daughter element mark (Tag)+"="+binary data is converted into the value > after character
< daughter element mark (Tag)+"="+binary data is converted into the value > after character
Wherein, the value after binary data is converted into character is cut into multiple daughter element according to 64 alignment thereof.
8) Base64 element is formed:
< marks (Tag)+"="+BASE64 length of element >
< daughter element mark (Tag)+"="+be converted into BASE64 content >
< daughter element mark (Tag)+"="+be converted into BASE64 content >
Wherein, the value of element is converted into BASE64 content, and is cut into multiple daughter element according to 64 alignment thereof.
Element content be binary value or multibyte coding as in the situations such as gb2312, utf-8, gbk, usually adopt BASE64 types of elements to build, very easily at Email, can transmit in the agreements such as HTTP like this, and be that ciphertext shows.
Contrast experiment:
In prior art, distributed player communicates between respectively holding needs to experience following steps usually:
1) connect; The information of client of being packed by XML, comprises the network information of end, system information etc.; Service end receives information, analyzing XML data, effect information, and the network information of service end, system information, share information etc. and be packaged into XML and send to client, client receives these information and preserves.Information format is such as:
<?xmlversion="1.0"standalone="yes"encoding="UTF-8"?>
<XREQUESTtype="conn">
<USERID>982F699EA9F19E287462864A3C035E7B7089280C</USERID>
<MACADDR>ACE0119CCD45</MACADDR>
<IPADDR>192.168.40.163</IPADDR>
<SRVPORT>30000</SRVPORT>
..............
</XREQUEST>
2) browsing service end shared file; To be packed by XML the path of access request and access; Service end scans the file tree under local respective path according to access path, by these file trees according to XML format, then sends back to client after receiving data.Client receives XML data reset file tree.Form is such as:
3) according to described file tree information, broadcasting access is carried out to corresponding file; XML format dissolves the file path of multiplexing request and access, and service end receives request, sets up demultiplexing module and data transmission blocks according to file path; And the Ready message of XINI format is replied to client; Client builds data receiver, data decode and rendering module after receiving Ready message, then notifies that UI layer is play.
4) broadcasting of file, frame-skipping, stopping, file sends is all first by XML format request, and then request msg is sent to service end, service end, according to corresponding request execution command, then replys client.
Wherein, XML format is described below:
1) XML document comprises following three parts: an XML document statement; A definition about Doctype; By the content that XML tag creates
2) XML document term:
Mark (Tag): be used for defining element term and Property Name.In xml, mark must occur in pairs, and packet is trapped among centre.
Element (Element): be made up of element term and element content.An element is defined by a mark, comprises and starts and terminate mark and content wherein.
Attribute (Attribute): be made up of Property Name and property content.Attribute further describes and demonstrates element, and an element can have multiple attribute.Attribute a kind ofly adds the mechanism of descriptive information for element.
The inclusion relation of element: element (attribute, daughter element (attribute, daughter element)).
Empty element: sleazy element.Format write is <Element></Eleme nt> or <Element/>.
Statement (Declaration): have an XML statement in the first provisional capital of all XML document.This statement represents that this document is an XML document, and its represents that what follow is the version of which XML specification.
DTD (document type definition): DTD is used to define the relation in XML document between element, attribute and element.XML document structure can be detected by dtd file whether correct, but set up XML document and might not need dtd file.
Well-formedXML (XML of good form): one observes XML syntax rule, and the document of observing XML specification is referred to as " good form ".
ValidXML (XML of valid format): one observes XML syntax rule, and the XML document observing corresponding dtd file specification is called effective XML document.
3) XML example:
<?xmlversion="1.0"standalone="yes"encoding="UTF-8"?>
<!mydoc"mydoc.data">
<mydoc>
<title>XMLDoc</title>
<author>kkk</author>
<email>kkkgoogle.com</email>
<date>20150802</date>
</mydoc>
Wherein, the first row <? xmlversion=" 1.0 "? > is exactly the statement of an XML document, second row illustrates that this document mydoc.data is to define Doctype, and the statement below the third line is exactly content body part.
During current data is mutual, no matter the most frequently used form of network or this locality is exactly XML, XML was wanted to replace HTML originally, was mainly used in transfer of data, configuration file etc. afterwards.
Compared with prior art, efficient Data Serialization exchange method of the present invention, reaches following effect:
(1) new data interaction encapsulation format is more directly perceived, can very easily by the scanning of a pass coding, and complete the parsing to whole data flow and encapsulation, greatly the structure of expedited data element-tree, the parsing comparing XML and JSON can be fast 3 ~ 5 times.
(2) carry out coded data easily at Email, to transmit in the agreements such as HTTP, and be ciphertext display.
Above-mentioned explanation illustrate and describes some preferred embodiments of the present invention, but as previously mentioned, be to be understood that the present invention is not limited to the form disclosed by this paper, should not regard the eliminating to other embodiments as, and can be used for other combinations various, amendment and environment, and can in invention contemplated scope described herein, changed by the technology of above-mentioned instruction or association area or knowledge.And the change that those skilled in the art carry out and change do not depart from the spirit and scope of the present invention, then all should in the protection range of claims of the present invention.
Claims (3)
1. an efficient Data Serialization exchange method, is characterized in that, comprise step:
Connect, the information of client of being packed by data interaction form XINI, comprise the network information of end, system information, service end receives information, resolve XINI data, effect information, and become XINI send to client to receive and preserve the network information of service end, system information and shared information package;
Browse described service end shared file, the path of packed by XINI access request and access; Described service end scans the file tree under local respective path according to the path of described access, is formatd by described file tree according to XINI, then beams back described client reset file tree;
According to described file tree, broadcasting access is carried out to corresponding file, XINI formats the file path of demultiplexing request and access, service end receives described demultiplexing request, demultiplexing module and data transmission blocks is set up according to file path, and that formats to client reply XINI gets out Ready message, client builds data receiver, data decode and rendering module after receiving and getting out Ready message, then notifies that UI layer is play;
Carry out the broadcasting of file, frame-skipping, stopping and file by XINI formatted requests to send, then request msg is sent to service end, service end according to after corresponding request execution command, then replys client.
2. efficient Data Serialization exchange method according to claim 1, is characterized in that, described data interaction form XINI, is further: the data interaction form improvement encapsulated by XML in distributed player is data interaction form XINI.
3. efficient Data Serialization exchange method according to claim 1, is characterized in that, the syntax format of described data interaction form XINI comprises:
Mark, is used for defining element term and Property Name;
Element, is made up of element term and element content;
Attribute, is made up of Property Name and property content, and each unit have a special attribute, represents the number of the daughter element comprised, and is positioned at last attribute;
The inclusion relation of element;
Empty element, sleazy element;
Statement;
And annotation.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510591457.9A CN105162692B (en) | 2015-09-16 | 2015-09-16 | A kind of efficient Data Serialization exchange method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510591457.9A CN105162692B (en) | 2015-09-16 | 2015-09-16 | A kind of efficient Data Serialization exchange method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105162692A true CN105162692A (en) | 2015-12-16 |
CN105162692B CN105162692B (en) | 2018-08-10 |
Family
ID=54803451
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510591457.9A Active CN105162692B (en) | 2015-09-16 | 2015-09-16 | A kind of efficient Data Serialization exchange method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105162692B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106101114A (en) * | 2016-06-27 | 2016-11-09 | 浪潮(苏州)金融技术服务有限公司 | A kind of Modes of Sharing Resources of serializing |
CN111813395A (en) * | 2020-07-06 | 2020-10-23 | 广东海洋大学 | Communication protocol information description general model based on XML format and design method thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020087915A1 (en) * | 1999-12-23 | 2002-07-04 | Jesse Perla | Error handler method and system for internet-based applications |
WO2003058938A1 (en) * | 2001-12-28 | 2003-07-17 | V-Enable, Inc. | Information retrieval system including voice browser and data conversion server |
CN101937572A (en) * | 2010-09-14 | 2011-01-05 | 北京神州泰岳软件股份有限公司 | Flash synthesis method |
CN101944133A (en) * | 2010-09-28 | 2011-01-12 | 山东中创软件工程股份有限公司 | XML metadata objectification analytic method and system |
-
2015
- 2015-09-16 CN CN201510591457.9A patent/CN105162692B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020087915A1 (en) * | 1999-12-23 | 2002-07-04 | Jesse Perla | Error handler method and system for internet-based applications |
WO2003058938A1 (en) * | 2001-12-28 | 2003-07-17 | V-Enable, Inc. | Information retrieval system including voice browser and data conversion server |
CN101937572A (en) * | 2010-09-14 | 2011-01-05 | 北京神州泰岳软件股份有限公司 | Flash synthesis method |
CN101944133A (en) * | 2010-09-28 | 2011-01-12 | 山东中创软件工程股份有限公司 | XML metadata objectification analytic method and system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106101114A (en) * | 2016-06-27 | 2016-11-09 | 浪潮(苏州)金融技术服务有限公司 | A kind of Modes of Sharing Resources of serializing |
CN106101114B (en) * | 2016-06-27 | 2019-06-04 | 浪潮金融信息技术有限公司 | A kind of resource sharing system and method for serializing |
CN111813395A (en) * | 2020-07-06 | 2020-10-23 | 广东海洋大学 | Communication protocol information description general model based on XML format and design method thereof |
CN111813395B (en) * | 2020-07-06 | 2024-01-30 | 广东海洋大学 | Communication protocol information description universal model based on XML format and design method thereof |
Also Published As
Publication number | Publication date |
---|---|
CN105162692B (en) | 2018-08-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8458467B2 (en) | Method and apparatus for adaptive application message payload content transformation in a network infrastructure element | |
CN104850602B (en) | A kind of rendering refreshing implementation method and device based on internet web page | |
US11842150B2 (en) | Delivering auto-play media content element from cross origin resources | |
CN104410667B (en) | Conversion method and system of a kind of XML message to JSON messages | |
US9270730B2 (en) | Providing an interface to multiple cloud computing systems | |
CN107124430B (en) | Page hijacking monitoring method, device, system and storage medium | |
EP2842052B1 (en) | File transfer using xml | |
US8683320B2 (en) | Processing module, a device, and a method for processing of XML data | |
CN102447726A (en) | Method and system for page access | |
Pollard | HTTP/2 in Action | |
CN102694830A (en) | Method, system and apparatus for realizing network content sharing | |
US20030105806A1 (en) | Service facilitator for automating object conversions and communication connections in client-server systems | |
US8725834B2 (en) | Access of resources by way of hypertext transfer protocol | |
US20100287247A1 (en) | Method and system for secure web service data transfer | |
US9558164B1 (en) | Methods and system for converting WSDL documents into XML schema | |
CN105162692A (en) | Efficient data serialization interaction method | |
CN101588376A (en) | Information releasing method, device and system | |
CN107040613A (en) | A kind of message transmitting method and system | |
US20120151330A1 (en) | Method and apparatus for encoding and decoding xml documents using path code | |
US8001212B2 (en) | Method and data processing system for providing XML data | |
RU2294012C2 (en) | Data structure and methods for transforming stream of bits to electronic document and generation of bit stream from electronic document based on said data structure | |
US7571196B2 (en) | Type evolution | |
KR20180083089A (en) | An Extension-XML Parser for Wireless Device | |
KR20170085711A (en) | An Extension-XML Parser for Wireless Device | |
CN101184057B (en) | System and method of transferring event information in IMS system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 100191 Beijing, Xueyuan Road No. 51, the first to enjoy the science and technology building, floor 6, Applicant after: Storm group Limited by Share Ltd Address before: 100191 Beijing, Xueyuan Road No. 51, the first to enjoy the science and technology building, floor 6, Applicant before: Beijing Baofeng Technology Co., Ltd. |
|
COR | Change of bibliographic data | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
PP01 | Preservation of patent right | ||
PP01 | Preservation of patent right |
Effective date of registration: 20190705 Granted publication date: 20180810 |