CN104699754B - A kind of method and system based on user's intuitive manner operation binary data - Google Patents

A kind of method and system based on user's intuitive manner operation binary data Download PDF

Info

Publication number
CN104699754B
CN104699754B CN201410854757.7A CN201410854757A CN104699754B CN 104699754 B CN104699754 B CN 104699754B CN 201410854757 A CN201410854757 A CN 201410854757A CN 104699754 B CN104699754 B CN 104699754B
Authority
CN
China
Prior art keywords
data
length
byte
user
module
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.)
Expired - Fee Related
Application number
CN201410854757.7A
Other languages
Chinese (zh)
Other versions
CN104699754A (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.)
Ming You Network Technology Co Ltd Of Shenzhen
Original Assignee
Ming You Network Technology Co Ltd Of Shenzhen
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 Ming You Network Technology Co Ltd Of Shenzhen filed Critical Ming You Network Technology Co Ltd Of Shenzhen
Priority to CN201410854757.7A priority Critical patent/CN104699754B/en
Publication of CN104699754A publication Critical patent/CN104699754A/en
Application granted granted Critical
Publication of CN104699754B publication Critical patent/CN104699754B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The method of binary data is operated based on user's intuitive manner the present invention relates to a kind of, including the form that data description is defined to the data message of input is set;The data message pre-set input is subjected to data storage;User is searched in the data message of input, Age is searched in the data message of input, shaped digital and character string are stored in binary data stream;Preset byte is read for the string representation physical length of first row according to data definition after storing and the whether not enough byte length read of remainder bytes length is judged, read the physical length of setting byte and judge the whether not enough setting byte of residue length, preset byte is read for the shaping of secondary series according to data definition and the whether not enough preset byte of its length is judged, binary data is intuitively changed according to data definition.Under not change data form, input data is compressed to greatest extent, while remaining the multiple beneficial characteristic such as loop nesting improves efficiency, is easily used.

Description

A kind of method and system based on user's intuitive manner operation binary data
Technical field
The invention belongs to data modification field, more particularly to a kind of side based on user's intuitive manner operation binary data Method and system.
Background technology
Traditional relational is the principal mode of access data in current Web applications.However, with Web2.0, big number According to the development of the technologies such as, cloud application, traditional relational database encounters bottleneck in I/O, scalability, in big data access Drastically decline with efficiency when accessing, also encountered a difficulty in terms of enhanced scalability and high availability.It is many in order to solve this problem Scheme proposes in succession, such as distributed data base, master-slave database, non-mode database.Non-mode database, is a kind of mould The free database of formula, its pattern is mainly the various ways such as relation, tree, figure, document.In fact, it is difficult to abandoning completely existing Relational database and directly use non-mode database.Based on relational database, supplemented by non-mode database, into industry Boundary and the generally accepted scheme of industrial circle.
In existing technology, there is the method that two class relational databases are combined with non-mode database:(1)With user The method of plug-in unit, by non-mode geo-database integration into relational database so that relational database simultaneously support relational operation and Non-mode is operated.This method has the disadvantage that the substantial amounts of operation for playing opening/closing table is quite time-consuming, reduces database performance;(2) Relational database is used in mixed way, based on relational database, supplemented by non-mode database, big data is carried out using relational database Operation is updated, relational data base schema and data are synchronized to by non-mode database using certain mechanism.For looking into for big data Ask and directly use non-mode database, and update and still use relational database.This method advantage is both to solve relational database The inquiry bottleneck problem of middle big data, solves non-mode database update bottleneck problem again.The difficult point of this method is how will Relational data base schema and data are transformed into non-mode database.The solution of prior art and realization mainly have two kinds of sides Method:(1)By relational database trigger, the change of data be recorded into temporary query table.The inquiry table is generally by ID, table Name, line number, timestamp and operation isotype are constituted.Then by the data syn-chronization of temporary query table to target non-mode database; (2)To method(1)Improve, cancel temporary query table, by increasing the self-defined HTTP functions of relational database, directly by relation Database data increments of change is sent to target non-mode database by HTTP agreements, realizes the synchronization of data and pattern.
To sum up, the conversion method of existing relational database to non-mode database mainly has problems with:(1)Either touch Device or User-Defined Functions are sent out, it has a strong impact on relational database performance;(2)Data transmission procedure can not ensure that data are grasped The order of work, easily causes the inconsistent of data;(3)Method of synchronization meeting blocking data storehouse process, reduction relational database Pattern and data update performance.
The content of the invention
It is an object of the invention to provide a kind of method that binary data is operated based on user's intuitive manner, it is intended to solves Above-mentioned technical problem.
The present invention is achieved in that a kind of method that binary data is operated based on user's intuitive manner, methods described Comprise the following steps:
A, setting define the form of data description to the data message of input;
B, by the data message pre-set input carry out data storage;
C, in the data message of input User is searched, such as find, then perform step D, such as searched less than then pointing out wrong Miss and terminate this operation;
Whether D, the value for judging User are character string types defined in data definition, in this way, then perform step E, such as no, Then point out mistake and terminate this operation;
E, the length for calculating data simultaneously judge whether data length is more than preset value, if not, performing step F, in this way, then Prompting mistake simultaneously terminates this operation;
F, storage shaped digital and character string in binary data stream;
G, in the data message of input Age is searched, such as find, then perform step H, such as searched less than then pointing out wrong Miss and terminate this operation;
Whether H, the value for judging Age are shapings defined in data definition, in this way, then step I are performed, if not, prompting Mistake simultaneously terminates this operation;
I, shaped digital is stored in binary data stream;
J, after storing according to data definition read preset byte for first row string representation physical length and judge The byte length for reading that whether remainder bytes length is not enough, in this way, then points out mistake and terminates this operation, if not, performing Step K;
K, the physical length for reading setting byte simultaneously judge the whether not enough setting byte of residue length, in this way, then prompt Mistake simultaneously terminates this operation, is default name and performs step L if not, reading result;
L, preset byte is read for the shaping of secondary series according to data definition and the whether not enough preset byte of its length is judged, In this way, then point out mistake and terminate this operation, be preset value if not, reading result and perform step M;
M, according to data definition binary data is intuitively changed.
The present invention further technical scheme be:The data descriptor format enters to row name, type, the maximum length of data Row definition.
The present invention further technical scheme be:Binary data intuitive operation is repaiied by being realized to data definition Change.
The present invention further technical scheme be:The preset value is 24.
The present invention further technical scheme be:The type supported in data definition include int8, int16, int32, Int64, float, double, string, binary, struct and union.
Another object of the present invention is to provide a kind of system that binary data is operated based on user's intuitive manner, this is System includes:
Data definition module, for setting the data message to input to define the form of data description;
Data memory module, for the data message pre-set input to be carried out into data storage;
First enquiry module, for searching User in the data message of input, such as finds, then execution character string type Judge module, is such as searched less than then prompting is wrong and terminates this operation;
Character string type judge module, for judging whether User value is character string type defined in data definition, In this way, then length judge module is performed, if not, prompting is wrong and terminates this operation;
Length judge module, for calculating the length of data and judging whether data length is more than preset value, if not, holding Row data flow memory module, in this way, then points out mistake and terminates this operation;
Data flow memory module, for storing shaped digital and character string in binary data stream;
Second searching modul, for searching Age in the data message of input, such as finds, then performs shaping and judge mould Block, is such as searched less than then prompting is wrong and terminates this operation;
Shaping judge module, for judging whether Age value is shaping defined in data definition, in this way, is then performed whole Shape memory module, if not, prompting is wrong and terminates this operation;
Shaping memory module, for storing shaped digital in binary data stream;
Byte length judge module, for reading the character string that preset byte is first row according to data definition after storing Represent physical length and judge the whether not enough byte length read of remainder bytes length, in this way, then point out mistake and terminate this Secondary operation, if not, performing residue length judge module;
Residue length judge module, for reading the physical length of setting byte and judging the whether not enough setting of residue length Byte, in this way, then points out mistake and terminates this operation, is default name if not, reading result and performs the judgement of shaping length Module;
Shaping length judge module, for reading preset byte for the shaping of secondary series according to data definition and judging that it is grown Degree whether not enough preset byte, in this way, then point out mistake and terminate this operation, if not, it is preset value and to hold to read result Row modified module;
Modified module, for intuitively being changed binary data according to data definition.
The present invention further technical scheme be:The data descriptor format enters to row name, type, the maximum length of data Row definition.
The present invention further technical scheme be:Binary data intuitive operation is repaiied by being realized to data definition Change.
The present invention further technical scheme be:The preset value is 24.
The present invention further technical scheme be:The type supported in data definition include int8, int16, int32, Int64, float, double, string, binary, struct and union.
The beneficial effects of the invention are as follows:On the premise of not change data form, input data is pressed to greatest extent Contracting, while the multiple beneficial characteristic such as loop nesting is remained, product of its efficiency than same type(ProtocolBuffer)Improve More than 20 times, it can be realized as C/C++, C#, ActionScript, Java, Python etc. are a variety of, ease for use is at a relatively high.
Brief description of the drawings
Fig. 1 is the flow chart of the method provided in an embodiment of the present invention that binary data is operated based on user's intuitive manner;
Fig. 2 is the structural frames of the method provided in an embodiment of the present invention that binary data is operated based on user's intuitive manner Figure.
Embodiment
Fig. 1 shows the flow chart for the method that binary data is operated based on user's intuitive manner that the present invention is provided, its Details are as follows:
Step S1, sets the form that data description is defined to the data message of input;1st, user defines data descriptor format (Similar XSD(XML Schema language is also referred to as XML Schema definition(XML Schema Definition, XSD)), example Such as user's definition, the first column data is<entry name=”User” type=”string” size=”24”>Represent, arrange entitled User, data type is character string, and maximum length is 24;3rd, the second column data is<entry name=”Age” type=”int” >Represent, arrange entitled Age, data type is shaped digital.
Step S2, data storage is carried out by the data message pre-set input;The data of storage are wished in user's input, Such as User=JohnR, Age=24 etc..
Step S3, User is searched in the data message of input, is such as found, then performs step S4, such as search less than then Prompting mistake simultaneously terminates this operation.
Step S4, whether the value for judging User is character string type defined in data definition, in this way, then performs step S5, if not, prompting is wrong and terminates this operation.
Step S5, calculates the length of data and judges whether data length is more than preset value, if not, step S6 is performed, In this way, then point out mistake and terminate this operation;Wherein 7, the length len (JohnR)=5 of data, the length of preset value are calculated For 24.
Step S6, stores shaped digital and character string in binary data stream;Shaping is stored in binary data stream Numeral 4(The byte of length 4), followed by store character string JohnR(The byte of length 5), total length is 4+5=9.
Step S7, Age is searched in the data message of input, is such as found, then performs step S8, such as search less than then Prompting mistake simultaneously terminates this operation.
Step S8, whether the value for judging Age is shaping defined in data definition, in this way, then performs step S9, such as no, Then point out mistake and terminate this operation.
Step S9, stores shaped digital in binary data stream;Shaped digital 24 is stored in binary data stream, this When, whole data flow length is 9+4=13.
Step S10, reads the string representation physical length that preset byte is first row according to data definition after storing And judge the whether not enough byte length read of remainder bytes length, and in this way, then point out mistake and terminate this operation, it is such as no, Then perform step S11;When the 13rd, reading, character string is classified as according to data definition, first, then first 4 bytes are read, for table Show subsequent character string physical length, such as residue length points out mistake, exit flow less than 4 bytes.
Step S11, reads the physical length of setting byte and judges the whether not enough setting byte of residue length, in this way, then Prompting malfunctions and terminates this operation, is default name and performs step S12 if not, reading result;Reading result is 5 bytes, The physical length of 5 bytes is then read, if residue length is less than 5 bytes, error is pointed out, exits flow.
Step 12, preset byte is read for the shaping of secondary series according to data definition and judges that whether not enough its length is preset Byte, in this way, then points out mistake and terminates this operation, be preset value if not, reading result and perform step S13;Read As a result it is JohnR, shaping is classified as according to data definition, second, then 4 bytes is read, if the byte of curtailment 4, exits stream Journey.
Step S13, is intuitively changed binary data according to data definition.It is 24 to read result.According to data Definition, first row arranges entitled User, and secondary series arranges entitled Age, then understand to change data for User=JohnR, Age=24.
The data descriptor format is defined to row name, type, the maximum length of data.
Binary data intuitive operation is changed by being realized to data definition.
The type supported in data definition include int8, int16, int32, int64, float, double, string, Binary, struct and union.
Fig. 2 shows that the another object of invention is that offer is a kind of and is based on what user's intuitive manner operated binary data System, the system includes:
Data definition module 1, for setting the data message to input to define the form of data description;
Data memory module 2, for the data message pre-set input to be carried out into data storage;
First enquiry module 3, for searching User in the data message of input, such as finds, then execution character string class Type judge module, is such as searched less than then prompting is wrong and terminates this operation;
Character string type judge module 4, for judging whether User value is character string type defined in data definition, In this way, then length judge module is performed, if not, prompting is wrong and terminates this operation;
Length judge module 5, for calculating the length of data and judging whether data length is more than preset value, if not, Data flow memory module is performed, in this way, then mistake is pointed out and terminates this operation;
Data flow memory module 6, for storing shaped digital and character string in binary data stream;
Second searching modul 7, for searching Age in the data message of input, such as finds, then performs shaping and judge mould Block, is such as searched less than then prompting is wrong and terminates this operation;
Shaping judge module 8, for judging whether Age value is shaping defined in data definition, in this way, is then performed whole Shape memory module, if not, prompting is wrong and terminates this operation;
Shaping memory module 9, for storing shaped digital in binary data stream;
Byte length judge module 10, for reading the character that preset byte is first row according to data definition after storing String represents physical length and judges the whether not enough byte length read of remainder bytes length, in this way, then points out mistake and terminates This operation, if not, performing residue length judge module;
Residue length judge module 11, for reading the physical length of setting byte and judging whether deficiency is set residue length Byte is determined, in this way, then prompting is wrong and terminates this operation, if not, it is to preset name and perform shaping length to sentence to read result Disconnected module;
Shaping length judge module 12, for reading preset byte for the shaping of secondary series according to data definition and judging it Preset byte that whether length not enough, in this way, then point out mistake and terminate this operation, if not, read result be preset value simultaneously Perform modified module;
Modified module 13, for intuitively being changed binary data according to data definition.
The data descriptor format is defined to row name, type, the maximum length of data.
Binary data intuitive operation is changed by being realized to data definition.
The preset value is 24.
The type supported in data definition include int8, int16, int32, int64, float, double, string, Binary, struct and union.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention Any modifications, equivalent substitutions and improvements made within refreshing and principle etc., should be included in the scope of the protection.

Claims (8)

1. a kind of method that binary data is operated based on user's intuitive manner, it is characterised in that methods described includes following step Suddenly:
A, setting define the form of data description to the data message of input;
B, by the data message pre-set input carry out data storage;
C, in the data message of input User is searched, such as find, then perform step D, such as searched less than then pointing out mistake simultaneously Terminate this operation;
Whether D, the value for judging User are character string types defined in data definition, in this way, then step E are performed, if not, carrying Show mistake and terminate this operation;
E, the length for calculating User data simultaneously judge whether data length is more than preset value, if not, performing step F, in this way, then Prompting mistake simultaneously terminates this operation;
F, storage shaped digital and character string in binary data stream;
G, in the data message of input Age is searched, such as find, then perform step H, such as searched less than then pointing out mistake simultaneously Terminate this operation;
Whether H, the value for judging Age are shapings defined in data definition, in this way, then step I are performed, if not, prompting mistake And terminate this operation;
I, shaped digital is stored in binary data stream;
J, after storing according to data definition read preset byte for first row string representation physical length and judge residue The byte length for reading that whether byte length is not enough, in this way, then points out mistake and terminates this operation, if not, performing step K;
K, the physical length of reading setting byte simultaneously judge the whether not enough setting byte of residue length, and in this way, then prompting malfunctions simultaneously Terminate this operation, be default name and perform step L if not, reading result;
L, preset byte is read for the shaping of secondary series according to data definition and the whether not enough preset byte of its length is judged, such as It is then to point out mistake and terminate this operation, is preset value if not, reading result and performs step M;
M, according to data definition binary data is intuitively changed.
2. according to the method described in claim 1, it is characterised in that the data descriptor format is to the row name of data, type, most Long length is defined.
3. method according to claim 2, it is characterised in that the preset value is 24.
4. method according to claim 3, it is characterised in that the type supported in data definition include int8, Int16, int32, int64, float, double, string, binary, struct and union.
5. a kind of system that binary data is operated based on user's intuitive manner, it is characterised in that the system includes:
Data definition module, for setting the data message to input to define the form of data description;
Data memory module, for the data message pre-set input to be carried out into data storage;
First enquiry module, for searching User in the data message of input, such as finds, then execution character string type judges Module, is such as searched less than then prompting is wrong and terminates this operation;
Character string type judge module, for judging whether User value is character string type defined in data definition, in this way, Length judge module is then performed, if not, prompting is wrong and terminates this operation;
Length judge module, for calculating the length of User data and judging whether data length is more than preset value, if not, holding Row data flow memory module, in this way, then points out mistake and terminates this operation;
Data flow memory module, for storing shaped digital and character string in binary data stream;
Second searching modul, for searching Age in the data message of input, such as finds, then performs shaping judge module, such as Search less than then prompting is wrong and terminates this operation;
Shaping judge module, for judging whether Age value is shaping defined in data definition, in this way, then performs shaping and deposits Module is stored up, if not, prompting is wrong and terminates this operation;
Shaping memory module, for storing shaped digital in binary data stream;
Byte length judge module, for reading the string representation that preset byte is first row according to data definition after storing Physical length simultaneously judges the whether not enough byte length read of remainder bytes length, in this way, then points out mistake and terminates this behaviour Make, if not, performing residue length judge module;
Residue length judge module, for reading the physical length of setting byte and judging the whether not enough setting word of residue length Section, in this way, then prompting is wrong and terminates this operation, if not, it is to preset name and perform shaping length to judge mould to read result Block;
Shaping length judge module, for reading preset byte for the shaping of secondary series according to data definition and judging that its length is No not enough preset byte, in this way, then prompting is wrong and terminates this operation, if not, reading, result is preset value and execution is repaiied Change module;
Modified module, for intuitively being changed binary data according to data definition.
6. system according to claim 5, it is characterised in that the data descriptor format is to the row name of data, type, most Long length is defined.
7. system according to claim 6, it is characterised in that the preset value is 24.
8. system according to claim 7, it is characterised in that the type supported in data definition include int8, Int16, int32, int64, float, double, string, binary, struct and union.
CN201410854757.7A 2014-12-31 2014-12-31 A kind of method and system based on user's intuitive manner operation binary data Expired - Fee Related CN104699754B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410854757.7A CN104699754B (en) 2014-12-31 2014-12-31 A kind of method and system based on user's intuitive manner operation binary data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410854757.7A CN104699754B (en) 2014-12-31 2014-12-31 A kind of method and system based on user's intuitive manner operation binary data

Publications (2)

Publication Number Publication Date
CN104699754A CN104699754A (en) 2015-06-10
CN104699754B true CN104699754B (en) 2017-09-12

Family

ID=53346875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410854757.7A Expired - Fee Related CN104699754B (en) 2014-12-31 2014-12-31 A kind of method and system based on user's intuitive manner operation binary data

Country Status (1)

Country Link
CN (1) CN104699754B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103701801A (en) * 2013-12-26 2014-04-02 四川九洲电器集团有限责任公司 Resource access control method
CN103699633A (en) * 2013-12-23 2014-04-02 Tcl集团股份有限公司 Method and system for utilizing xml to realize generalization data exchange

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130060797A1 (en) * 2011-09-07 2013-03-07 Paul Saunier Data transformation method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699633A (en) * 2013-12-23 2014-04-02 Tcl集团股份有限公司 Method and system for utilizing xml to realize generalization data exchange
CN103701801A (en) * 2013-12-26 2014-04-02 四川九洲电器集团有限责任公司 Resource access control method

Also Published As

Publication number Publication date
CN104699754A (en) 2015-06-10

Similar Documents

Publication Publication Date Title
CN104123374B (en) The method and device of aggregate query in distributed data base
CN104809190B (en) A kind of database access method of tree structure data
CN103500196B (en) EXCEL data export method and let-off gear(stand) thereof under many concurrent big data quantity environment
CN104391730B (en) A kind of software source codes language translation system and method
CN103123650B (en) A kind of XML data storehouse full-text index method mapped based on integer
CN102981884B (en) Serializing device and sequencing method
CN102693310A (en) Resource description framework querying method and system based on relational database
CN103177094B (en) Cleaning method of data of internet of things
US20080148141A1 (en) Method For Encoding an Xml Document, Decoding Method, Encoding and Decoding Method, Encoding Device, Decoding Device and Encoding and Decoding Device
CN103488759A (en) Method and device for searching application programs according to key words
CN104778258A (en) Data extraction method oriented to protocol dataflow
CN106528674A (en) Method and device for high-performance query based on Hbase row keys
CN105373541A (en) Processing method and system for data operation request of database
CN104253858B (en) A kind of mobile data synchronization conflict pretreatment and digestion procedure based on packet
CN110222238A (en) The querying method and system of character string and identifier biaxial stress structure
CN103188267B (en) A kind of protocol analysis method based on DFA
WO2015010508A1 (en) One-dimensional linear space-based method for implementing trie tree dictionary storage and management
CN106528641A (en) Data storage method and device and communication gateway machine
WO2003098521A3 (en) Method for organizing and querying genomic and proteomic databases
CN103871404A (en) Language model training method, query method and corresponding device
CN104699754B (en) A kind of method and system based on user&#39;s intuitive manner operation binary data
JP2014502756A (en) Apparatus and method for mass data storage based on tree structure
CN101833588B (en) Indexing structure of XML (Extensive Markup Language) document
CN103902651B (en) Cloud code query method and device based on MongoDB
CN100543729C (en) Dynamic object access system and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170912

Termination date: 20191231

CF01 Termination of patent right due to non-payment of annual fee