Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
In order to technical solutions according to the invention are described, be described below by specific embodiment.
embodiment one:
Fig. 1 shows the realization flow of the unified Dynamic Data Model implementation method that the embodiment of the present invention one provides, and details are as follows for the method process:
In step S101, set up and initialization data memory model.
In the present embodiment, described datarams model is the red-black balancing tree structure (Left-leaning Red-Black Trees, LLRB) learnt left.
In step s 102, compressed XML data stream is read.
In the present embodiment, described compressed XML data stream is Multiway Tree Structure, its root node <qd> represents main structure, metadata container node <qs> is had under <qd>, multiple metadata node <ti> is had under <qs>, each <ti> defines the full detail of metadata by the multiple element leaf node <ci> under it,
Described metadata is the data describing <qs> node, and each leaf node <ci> defines the title of this associated metadata elements, type, proof test value and default value.
Wherein, the core of this compressed XML form is that root node <qd> is fixed with two nodes, is metadata container node <rs> and data capsule node <rd> respectively;
Described metadata container node <rs> represents the metadata of each data fragments, each data fragments is represented by a metadata node <ti>, described <ti> node comprises data name and the compression abbreviated character corresponding with described data name, described <ti> has multiple element leaf node <ci>, wherein element leaf node <ci> form is predefined for:
<ci cn=element term 1ty=element type cv=element proof test value cd=element default value/>
[…];
Described predetermined format comprises the title of element, type, proof test value and default value.The set of multiple element just represents a data fragments, is realized by its superior node <ti> node.Compression abbreviated character has wherein been used for associating of this table and its record.The set of an as much data fragments, has been come by the superior node <rs> of <ti>.
Described data capsule node <rd> represents the record of all data in each data fragments, and record format is predefined for:
< data name abbreviated character > field name 1 respective value | [... ] </ data name abbreviated character >
[…]。
Compression abbreviated character corresponding to described data name calculates by predetermined data name transfer algorithm and obtains, described compression abbreviated character can be single character, each data name is represented by a compression abbreviated character, to save the size of communications packet, when data volume is very large, its space saved is extremely considerable.
Because above-mentioned form uses context-free or Backus normal form (BNF) (Backus-Naur Form, BNF) representation to describe, compared with the data syntax of traditional X-ray ML canonical representation, simplify the syntactic representation of data greatly.
The present embodiment effectively can save the representation space of traditional X-ray ML by the data stream of described compressed XML mode, can also be used for representing the semantic triple of OWL, facilitates OWL semantic processes technology to carry out semantic analysis to data.
In addition, also it should be noted that, OWL(Ontology Word Language) be a body vocabulary language international standard, define the lexical semantic of data, conveniently semanteme is carried out to data and resolve.Described semantic triple is a kind of mode that OWL represents data, and namely each data is represented by subject term predicate predicate.
In step s 103, read the metadata container node under the root node of described data stream, and the metadata node information read under described metadata container node, described metadata node information comprises data name and compression abbreviated character corresponding to described data name.
In the present embodiment, described metadata node information comprises compression abbreviated character corresponding to the data name of metadata node, data name, and the title of each node element <ci> under metadata node, type, proof test value and default value information etc.
In step S104, according to described compression abbreviated character, read the data record node in the data capsule node under the root node of described data stream, and described data record node is associated with in the metadata node information that described compression abbreviated character identifies, to obtain the relevant information of described data record node, comprise each element term, element type, element proof test value, default value information and element value, and distribute an one dimension HASH record sheet to store the relevant information of described data record node.
In the present embodiment, the cryptographic hash in described one dimension HASH record sheet calculates by each element term and obtains.
In step S105, using described one dimension HASH record sheet as in the structure of datarams model described in a data node city, obtain unified Dynamic Data Model, the structure of described unified Dynamic Data Model is support the balancing tree structure of multidimensional HASH inquiry, in tree, each leaf node is a back end, i.e. one dimension HASH record sheet.
The present embodiment realizes multikey data query structure (i.e. unified Dynamic Data Model (Generalized Dynamic Data Model1.0, GDM1.0)) on LLRB basis, and each query key will set up an one dimension HASH record sheet based on LLRB.
Further, the present embodiment also comprises:
OWL technology is adopted to resolve described unified Dynamic Data Model, to realize various software requirement complicated and changeable.
In the present embodiment, OWL technology is adopted to realize carrying out tlv triple semantic reasoning and tlv triple inquiry to the semantic triple data that compressed XML represents.
The communication data stream that the embodiment of the present invention adopts compressed XML mode to represent, its communication efficiency is higher than prior art.Especially effect in large data intensive applications system is applied in more obvious, such as be applied in the collection of magnitude of traffic flow sensor of each point on road in urban transportation, a large amount of data-intensive degree is very high, the data gathered will get back to data gateway, and be pooled to issue and the use that data center carries out urban traffic status data, need to adopt a kind of data model efficiently to communicate.And, the structure of unified Dynamic Data Model described in the embodiment of the present invention is support the balancing tree structure of multidimensional HASH inquiry, can realize multidimensional HASH inquiry, and to set interior joint be an one dimension HASH record sheet, thus effectively improve search efficiency, and there is wider adaptability.
Fig. 2 also show the inverse operation flow process of the unified Dynamic Data Model implementation method that the embodiment of the present invention one provides, and namely by the process of data model GDM1.0 Dynamic Establishing compressed XML data stream, details are as follows for the method process:
In step s 201, also initialization compressed XML data stream memory is set up;
In step S202, datarams model read lock;
In step S203, read each information in datarams model element structure, described meta structure information comprises data name and each data element information under it, described data element information comprises the HASH value of the title of node element, type, element default value, element, and comprehensively generates the compression abbreviated character of this meta structure and the <rs> node of HASH value, finally generation compressed XML data stream;
In step S204, according to HASH value location data information in memory model of described meta structure, described data message is the balancing tree structure supporting multidimensional HASH inquiry, read all data in this balancing tree structure, in conjunction with described in compression abbreviated character, data elements all in described balancing tree structure are generated to the <rd> node of compressed XML data stream, described data element comprises the one dimension HASH table record of each element term, element type, element proof test value, default value information and element value composition;
In step S205, the <rs> nodal information of above-mentioned generation and <rd> nodal information are organized into <qd> root node information by fixing BNF syntactic structure, above-mentioned all nodal informations are pressed BNF syntactic structure and generate compressed XML data stream.
embodiment two:
Fig. 3 shows the idiographic flow of the unified Dynamic Data Model implementation method that the embodiment of the present invention two provides, and its process is as follows:
In step S301, set up and initialization internal storage data model.
In the present embodiment, described datarams model is the red-black balancing tree structure (Left-leaning Red-Black Trees, LLRB) learnt left.
In step s 302, compressed XML data stream is read.
The present embodiment also comprises the form legitimacy to described compressed XML data stream predetermined according to described compressed XML and verifies, is verifying obstructed out-of-date end operation otherwise is continuing to perform subsequent step.
In step S303, read the metadata container node under the root node of described data stream, and read the metadata node <ti> information under described metadata container node <rs>.
In step s 304, judge that whether all metadata node <ti> under described metadata container node <rs> are processed, if judged result is "Yes", then perform step S312, if judged result is "No", then perform step S305.
In step S305, read a metadata node <ti> under described metadata container node <rs>.
In step S306, read the information of metadata node <ti>.The information of described metadata node <ti> comprises compression abbreviated character corresponding to the data name of metadata node, data name, and the title of each node element <ci> under metadata node, type, proof test value and default value information etc.
In step S307, according to described compression abbreviated character, read the data record node in the data capsule node <rd> under the root node of described data stream.
In step S308, judge whether described data record node has processed, if judged result is "Yes", then return step S304 to process next metadata node, if judged result is "No", then perform step S309.
In step S309, read a data record node, and described back end is processed, specifically comprise and described data record node is associated with in metadata node information that described compression abbreviated character identifies, to obtain the relevant information of described data record node, comprise each element term, element type, element proof test value, default value information and element value.
In step S310, distribute an one dimension HASH record sheet and store the relevant information of described data record node, this HASH record sheet records the information of each data element by the HASH value of data element name, comprises title, type, verification, default value and element value etc.
In step S311, using described one dimension HASH record sheet as in the structure of datarams model described in a data node city, obtain unified Dynamic Data Model.
In step S312, OWL technology is adopted to resolve described datarams model.
Shown below is the partial example data of OWL ontology definition, the communication using prior art to obtain comprises, and its packet length is 1596 characters:
Shown below is equal example data, use the communications packet that technical solution of the present invention obtains, packet length is 576, saves 63.9% (1596-576/1596) than existing communications packet:
As can be seen from the above, the communications packet obtained by technical solution of the present invention, compared with prior art, packet length average energy saves about about 50%, and data volume is larger, and the ratio that packet length is saved is higher, thus effectively can improve communication efficiency.
Fig. 4 also show the inverse operation flow process of the unified Dynamic Data Model implementation method that the embodiment of the present invention two provides, and the method process is as follows:
In step S401, set up and initialization compressed XML data stream memory;
In step S402, datarams model read lock;
In step S403, read meta structure information in memory model, the node <ti> in generator data capsule node <rs>;
In step s 404, judge whether all to process, if judged result is "Yes", then perform step S412, if judged result is "No", then perform step S405;
In step S405, read meta structure information;
In step S406, generator back end <ti>;
In step S 407, generate compression abbreviated character and HASH value by meta structure information, locate and read corresponding balanced tree;
In step S408, judge whether data message processes, if judged result is "Yes", then perform step S404, if judged result is "No", then perform step S409;
In step S409, in balanced tree, read a metadata information;
In step S410, read one dimension HASH record sheet;
In step S411, generate a <rd> node in conjunction with above-mentioned compression abbreviated character;
In step S412, generate compressed XML data stream and unlock data memory model by BNF syntactic structure.
embodiment three:
The unified Dynamic Data Model that Fig. 5 shows the embodiment of the present invention three to be provided realizes the composition structure of system, for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.
This is unified Dynamic Data Model and realizes system and can be applied in each terminal device, can be the software unit run in terminal device, the unit that combines of hardware cell or software and hardware, also can be integrated in terminal device as independently suspension member or run in the application system of terminal device.
This is unified Dynamic Data Model and realizes system and comprise model and set up unit 51, data stream reading unit 52, metadata node processing unit 53, data record endpoint processing unit 54 and realize unit 55, wherein:
Unit 51 set up by model, for setting up and initialization data memory model;
Data stream reading unit 52, for reading compressed XML data stream;
Metadata node processing unit 53, for read described data stream root node under metadata container node, and the metadata node information read under described metadata container node, described metadata node information comprises data name and compression abbreviated character corresponding to described data name;
Data record endpoint processing unit 54, for according to described compression abbreviated character, read the data record node in the data capsule node under the root node of described data stream, and described data record node is associated with in the metadata node information that described compression abbreviated character identifies, to obtain the relevant information of described data record node, comprise each element term, element type, element proof test value, default value information and element value, and distribute an one dimension HASH record sheet to store the relevant information of described data record node;
Realize unit 55, for using described one dimension HASH record sheet as in the structure of datarams model described in a data node city, obtain unified Dynamic Data Model, the structure of described unified Dynamic Data Model is support the balancing tree structure of multidimensional HASH inquiry, in tree, each leaf node is a back end, i.e. one dimension HASH record sheet.
Further, described compressed XML data stream is Multiway Tree Structure, its root node <qd> represents main structure, metadata container node <qs> is had under <qd>, multiple metadata node <ti> is had under <qs>, each <ti> defines the full detail of metadata by the multiple element leaf node <ci> under it,
Described metadata is the data describing <qs> node, and each leaf node <ci> defines the title of this associated metadata elements, type, proof test value and default value.
Further, described root node <qd> comprises metadata container node <rs> and data capsule node <rd>;
Wherein, described metadata container node <rs> represents the metadata of each data fragments, each data fragments is represented by a metadata node <ti>, described <ti> node comprises data name and the compression abbreviated character corresponding with described data name, described <ti> has multiple element leaf node <ci>, wherein element leaf node <ci> form is predefined for:
<ci cn=element term 1ty=element type cv=element proof test value cd=element default value/>
[…];
Described data capsule node <rd> represents the record of all data in each data fragments, and record format is predefined for:
< data name abbreviated character > field name 1 respective value | [... ] </ data name abbreviated character >
[…]。
Further, described system comprises further:
Resolution unit 56, resolves described unified Dynamic Data Model for adopting OWL technology.
Further, system described in the present embodiment also comprises composition structure as shown in Figure 6:
Data stream internal memory sets up unit 61, for setting up and initialization compressed XML data stream memory;
Data-reading unit 62, for datarams model read lock;
Metadata container endpoint processing unit 63, read each information in datarams model element structure, described meta structure information comprises data name and each data element information under it, described data element information comprises the HASH value of element term, element type, element default value, element, and the <rs> node of the compression abbreviated character of comprehensive this meta structure of generation and HASH value, finally generation compressed XML data stream;
Data element processing unit 64, for the HASH value location data information in memory model according to described meta structure, described data message is the balancing tree structure supporting multidimensional HASH inquiry, read all data in this balancing tree structure, in conjunction with described in compression abbreviated character, data elements all in described balancing tree structure are generated to the <rd> node of compressed XML data stream, described data element comprises the one dimension HASH table record of each element term, element type, element proof test value, default value information and element value composition;
Data stream generation unit 65, for the <rs> nodal information of above-mentioned generation and <rd> nodal information are organized into <qd> root node information by fixing BNF syntactic structure, above-mentioned all nodal informations are pressed BNF syntactic structure and generate compressed XML data stream.
Those skilled in the art can be well understood to, for convenience and simplicity of description, only be illustrated with the division of above-mentioned each functional unit, module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional units or module, inner structure by system is divided into different functional units or module, to complete all or part of function described above.Each functional unit in embodiment, module can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated, above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.In addition, the concrete title of each functional unit, module, also just for the ease of mutual differentiation, is not limited to the protection domain of the application.The specific works process of unit, module in said system, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In sum, the communication data stream that the embodiment of the present invention adopts compressed XML mode to represent, its communication efficiency is higher than prior art.Especially effect in large data intensive applications system is applied in more obvious.And, the structure of unified Dynamic Data Model described in the embodiment of the present invention is support the balancing tree structure of multidimensional HASH inquiry, can realize multidimensional HASH inquiry, and to set interior joint be an one dimension HASH record sheet, thus effectively improve search efficiency, and there is wider adaptability.The described unified Dynamic Data Model obtained by the invention process efficiently solves available data communication implementation disunity and the not high problem of communication efficiency, improves user satisfaction.In addition, described in the embodiment of the present invention, unified Dynamic Data Model realizes the process that system not only can realize flowing to from compressed XML data Dynamic Data Model GDM1.0, the process of data model GDM1.0 Dynamic Establishing compressed XML data stream can also be realized, there is stronger ease for use and practicality.
Those of ordinary skill in the art it is also understood that, the all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program has come, described program can be stored in a computer read/write memory medium, described storage medium, comprises ROM/RAM, disk, CD etc.
Above content is in conjunction with concrete preferred implementation further description made for the present invention, can not assert that specific embodiment of the invention is confined to these explanations.For general technical staff of the technical field of the invention; make some equivalent alternative or obvious modification without departing from the inventive concept of the premise; and performance or purposes identical, all should be considered as belonging to the scope of patent protection that the present invention is determined by submitted to claims.