CN107861720A - The processing method of block data chained file data - Google Patents

The processing method of block data chained file data Download PDF

Info

Publication number
CN107861720A
CN107861720A CN201711155580.1A CN201711155580A CN107861720A CN 107861720 A CN107861720 A CN 107861720A CN 201711155580 A CN201711155580 A CN 201711155580A CN 107861720 A CN107861720 A CN 107861720A
Authority
CN
China
Prior art keywords
file
data
block data
chained file
block
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.)
Pending
Application number
CN201711155580.1A
Other languages
Chinese (zh)
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.)
JIANGSU ZHONGWEI TECHNOLOGY SOFTWARE SYSTEM Co Ltd
Original Assignee
JIANGSU ZHONGWEI TECHNOLOGY SOFTWARE SYSTEM Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JIANGSU ZHONGWEI TECHNOLOGY SOFTWARE SYSTEM Co Ltd filed Critical JIANGSU ZHONGWEI TECHNOLOGY SOFTWARE SYSTEM Co Ltd
Priority to CN201711155580.1A priority Critical patent/CN107861720A/en
Publication of CN107861720A publication Critical patent/CN107861720A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/52Binary to binary

Abstract

This application discloses a kind of processing method of block data chained file data, comprise the following steps:Write data description file;Write default block data chained file;The content stated in description file is called in block data chained file.By the above-mentioned means, a kind of method that can be realized that space-consuming is few and write a kind of data processing of data protocol file simple, intuitive.

Description

The processing method of block data chained file data
Technical field
The application is related to data processing field, more particularly to a kind of processing method of block data chained file data.
Background technology
Mainly there are json, xml, the data storage such as protobuf of Google and the lattice of reading in field of data storage at present Formula.But the occupancy details of json, xml data memory format is relatively more, and reading speed is relatively slow, and The file for writing data protocol of protobuf data storages and the form read is relatively slightly complicated, and with the development of technology, Need a kind of occupancy byte few and write a kind of method and device of data processing of the file simple, intuitive of data protocol.
The content of the invention
The application mainly solving the technical problems that, there is provided a kind of processing method of block data chained file data, device And storage device, it can solve the problem that the occupancy byte of available data form is more, write the problems such as data protocol file complexity.
In order to solve the above technical problems, the technical scheme that the application uses is:A kind of block data chained file data are provided Processing method, comprise the following steps:
Write data description file;
Write default block data chained file;
The block data chained file calls the content stated in the description file.
In order to solve the above technical problems, another technical scheme that the application uses is:A kind of block data chain text is provided The processing unit of number of packages evidence, including the processor and memory being electrically connected with each other, the processor perform as above at work Described data storage is in the method for reading.
In order to solve the above technical problems, another technical scheme that the application uses is:There is provided one kind has store function Storage device, have program stored therein data, and described program data realize above-described data storage in reading when being performed Method.
The beneficial effect of above technical scheme is:The situation of prior art is different from, the application is by writing structure more Simply and the description file of extra descriptor is not needed, the data protocol file for realize that a kind of occupancy byte is few, writing is more For simple, intuitive.
Brief description of the drawings
Fig. 1 is the schematic flow sheet of an embodiment of the processing method of the application block data chained file data;
Fig. 2 is the structural representation of the embodiment of processing unit one of the application block data chained file data;
Fig. 3 is the structural representation of the storage device with store function in the embodiment of the application one.
Embodiment
Hereinafter, it will be described with reference to the accompanying drawings the exemplary embodiment of the application.For clear and brief purpose, no Function known to detailed description and construction.The term described below being limited in view of the function in the application can according to The intention or implementation of family and operator and difference.Therefore, it should the art is limited on the basis of disclosed in entire disclosure Language.
Referring to Fig. 1, the flow of the first embodiment mode for the processing method of the application block data chained file data Schematic diagram.This method includes:
S10:Write data description file.
Alternatively, step S10 writes one or more data description files, and one is stated in each description file write Individual or multiple structures.
In one embodiment, need to write a description file according to user, wherein root in the description file write According to one structure of statement or multiple structures is needed, for realizing default function in following step or performing other steps When call.
In another embodiment, need to write multiple description files according to user, and as needed in each description text At least one structure of middle statement of part, for the calling in following step.It is understood that the description file write it Between can be separate or there is relevance in default relation.When the quantity for the description file write For it is multiple when, the quantity of each structure for describing to be stated in file can be differ or identical, The quantity of the structure stated in each description file is set as needed, will not be described here.
Alternatively, wherein each structure can be declared as any one in variable, pointer and array.
In one embodiment, the structure described in file is declared as variable.It should be understood that can also be as needed Structure is claimed as any one in pointer and array, wherein the type that each structure can be stated can only be one, But the type that different structures is stated is set as needed, not necessary association between each other.
Alternatively, in one embodiment, the statement to structure can include the base attribute letter of stated structure Breath, that is, the base attribute information of structure can be known by the statement for structure in file is described.
In one embodiment, the base attribute information of structure is included in the information such as title, data type and data format It is at least one, describe the specifying information content that the structure stated is included in file, can be entered according to the needs of user Row statement setting.
Alternatively, data format includes:It is at least one in initial form, object type and array type.
Alternatively, in one embodiment, the structure stated can also be at least one in field, parameter and function It is individual.It is understood that the specific content included required for structure is depending on the needs of user, and tune can be made Whole.
Alternatively, in one embodiment, describe the structure stated in file include custom field type, field and In the relevant information such as the description of field, the source of function and function, the one or more parameters required parameter related to other At least one composition.It should be understood that can also be stated in description file related information needed for some other users or Data, do not repeat one by one herein.
In one embodiment, the structure for describing to be stated in file includes custom field type.File is described to institute The related information of the type of the custom field needed, such as title, data type and data format makes statement.
In one embodiment, describing the structure stated in file includes the description of at least one field and field, The description of wherein field and field is included in the title of declaration field, data type and related information needed for other at least It is a kind of.
In another embodiment, the structure for describing to be stated in file includes the source of at least one function and function Description, the description of wherein function source and relevant information includes, the title of function, the types and sources of function and other needed for Related information.
In another embodiment, the structure for describing to be stated in file includes the relevant information of one or more parameters, The related information needed for title, the data type of parameter of parameter etc. user can specifically be included.It is understood that institute The parameter of statement can be existing parameter or customized parameter.
Alternatively, in one embodiment, data format includes:Initial form, object type and data type.
Alternatively, initial form includes:Boolean type (bool), shaping (int), long shaping (long), character type (string).Object type:Similar structures body (struct), structure statement are formed by a series of initial form or object type Ying Yiyi solid dots start.Array type:Initial form and object type all can be expressed as array, and manifestation mode is before type Add asterisk " * " character, such as in one embodiment, manifestation mode is (* int).It is understood that wherein object type is wrapped The initial form or object type included specifically counts amount and type and is determined as needed by user, likewise, array type Included initial form and the particular number of object type can be adjusted as needed, and can be 0.
S20:Write default block data chained file.
Alternatively, block data chained file is a kind of data store organisation of self reference, including table structured file etc., by area Block chain technology and other multinomial technical combinations form.
Alternatively, step S20 writes default block data chained file, is to write the basic information in table structure.Bag Include and write key (key) and value (value) and the content to being write in table structure and carry out assignment respectively.
In one embodiment, the key in the table structure write according to the needs of user is " class and person ", to be compiled The value (value) write for " information such as name, age, male ", it is specific as follows:
Alternatively, step S20 writes the particular content included by default block data chained file, can only include including Write key (key) and value (value) in table structure, carry out one kind in both assignment respectively to the content write.
In one embodiment, step S20 is to the key (key) and value (value) write in table structure, not to being write Content carry out assignment, then store write content, called again when needing.
In another embodiment, step S20 can write key (key) and value (value) etc. to stored The table structure of content carries out assignment.Wherein by the assignment of table structure it can be appreciated that being to carry out assignment for the field called. Specifically, the table structure after assignment is as shown in table 1 below.
Table 1
Alternatively, after for the step of block data chained file assignment, in addition to, gained block data after storage assignment Chained file.Specifically, it will be stored after assignment after gained block data chained file conversion binary file.Wherein, block data chain Transformation rule between file and binary file defers to the transformation rule of language in above two file.
Alternatively, in one embodiment, defined description file defines according to block, storage gained block counts Also stored according to chained file according to block, that is, need each block switching to byte data.It is specific as follows:
In one embodiment, when the table 2 specific as follows of block data chained file obtained by assignment, then wherein each number of types According to the transformation rule for changing into binary data, it can obtain, be encoded using utf-8, each Chinese accounts for three bytes, and two Chinese account for 6 bytes, end mark of the also byte as word string, so " Zhang San ", which amounts to, accounts for 7 bytes, sex " 1 " takes one Byte, age " 20 " take 4 bytes, so taking 12 bytes altogether, can be very good to realize and save shared byte Beneficial effect.
Table 2
name Zhang San
male 1
age 20
Alternatively, in another embodiment, every kind of programming language both provides the method that file preserves byte, such as: Java, which preserves byte, can carry out preservation byte in the following way:
Likewise, similar class classes block is also handled and preserved in a comparable manner, will not be described here.
In one embodiment, when needing to realize that block data chained file realizes conversion with other various language, because respectively Kind voice also both provides the method that file is read as byte arrays, for example java is read using such a way:
FileInputStream fis=new FileInputStream (new File (" filename "));
Fis.read (byte arrays)
fis.close();
Reading obtains byte arrays, and the byte arrays are:
Alternatively, in one embodiment, due to illustrating the forms of student blocks in description file, Part I is word Symbol string string, Part II is Boolean type bool, and Part III is shaping int, and the mode read in sequence is entered to file Row is read.Wherein, the first step reads character string, reads character string to read end of string symbol (0) untill, so reading Get preceding 7 bytes and switch to character string and obtain " Zhang San ";Second step reads Boolean type, now reads a byte and obtains 1 table It is shown as " male ";3rd step reads shaping, is now shaping, then continuously reads four bytes and switch to shaping and obtain 20, represents " 20 Year ".This three parts, which is read, to be completed, and is shown that student blocks are read and is finished.Similarly, class blocks are read or read other blocks with Trade company's reading student blocks are similar, will not be described here.
From the foregoing, it will be observed that the processing method of block data chained file data, realize the storages of data with read when, description File simple, intuitive, data type is simple, saves unnecessary descriptor, so taking less byte.Compared with prior art, It can realize and take less space, realize the particular content that can intuitively check data, realize and turn between multilingual Change, using convenient.
The description write in the block data chained file alternatively write in step S20 in meeting invocation step S10 The content that file is stated.
In one embodiment, the key (key) and value (value) in the structured file write in step S20 are in step S10 In description file in be declared, the content stated has title, data type etc. information.
Alternatively, step also includes step after writing default block data chained file:Function needed for calling.
Alternatively, according to the needs of user, after default block data chained file is write, required function is called.
In one embodiment, after the default block data chained file write, " save " " print " etc. phase can be called The function of pass.Wherein it is possible to understand, the function called is it is stated that the function crossed is either in cited function In storehouse can look for arrive or customized correlation function, customized function typically can be to functional relation or logics Relation carries out what is specifically stated and describe.
Alternatively, the function called completes default instruction according to function effect, when the function called is function During function defined in storehouse, the default instruction that function is completed is the instruction defined in function library.
In one embodiment, the function called is " save ", corresponding to " save " function defined in function library Instruction be " preservation " related data or result of calculation etc., so when calling " save " function, what is called is letter The preset instructions counted up to are to preserve a certain data or result of calculation.
In one embodiment, the function called is SQL, and the instruction now completed is exactly in description file Or the functional relation or logical relation of the definition in alternative document to current function, wished to complete the author of defined function The action for hoping the function complete.
Alternatively, one or more parameters are quoted during call function.
In one embodiment, when calling a function, the parameter stated in one or more description files is quoted.
In above-mentioned steps, by the definition described in file for data type write is more brief so that description File writes more simple, intuitive.Alternatively, after block data chained file is write, and it is block data chained file assignment Afterwards, in addition to:Preset instructions are received, block data chained file is mutually changed with binary file.
In one embodiment, when needing the block data chained file by assignment to be transmitted by network or It is saved to and is gone in file, it is necessary to the binary file changed into block data chained file.Specifically, according to block The content of data chained file and the relation of binary language conversion, are transcoded into binary file, realize block data chained file with The conversion of binary file.
In another embodiment, after the binary file transmitted on network is received, it is necessary to by binary file Visualization can just be realized by being converted into block data chained file, now need binary file being converted into block data chain text Part, the transforming relationship of the language included according to both decode to binary file, realize binary file and block counts According to the conversion between chained file, the visualization of binary file content is finally realized.
Alternatively, in one embodiment, when block data chained file is converted into binary file, default instruction is Block data chained file is converted into the instruction of binary file.Wherein, instruction specifically refers to:Block data chain structure is carried out Network transmission or the instruction being saved in file, or the data that other needs can just be realized with binary data mode Storage or the action command of transmission either editor.
Alternatively, in another embodiment, when binary file is converted into block data chained file, preset instructions bag The instruction that binary file is converted into block data chained file is included, is needing the binary file received being converted into visually The block data chained file of change, or the binary file obtained by other modes or form is converted into visual block Sent during data chained file.
Alternatively, the processing method of block data chained file data provided herein can realize it is cross-platform, across language The realization of speech.Wherein platform can include:The platforms such as windows, linux, macosx, across language refer to support with it is a variety of Conversion is realized between language.It can wherein realize that the language mutually changed includes:The language such as c/c++, java, lua, js, c#, it is above-mentioned Language can realize the data for reading block data chained file structure and the structured data for preserving block data chained file.
Alternatively, it is a kind of example structure of processing unit 10 1 of block data chained file data of the application referring to Fig. 2 Schematic diagram, including:The processor 12 being electrically connected with each other and memory 14, processor 12 perform number as described above at work According to the method for processing, memory 14 has routine data corresponding to the above method and processor 12 when performing the above method Result.
Alternatively, it is a kind of structural representation of the storage device 20 with store function of the application referring to Fig. 3, storage Device 20 is had program stored therein data, and the side of the as above data processing described by each embodiment is realized when the routine data is performed Method.
The processing method of the application block data chained file data is by writing data description file, the sound in file is described Bright required structure is the related information needed for other, writes default block data chained file to realize preset format Data storage, it is more brief to define type, and saves some unnecessary descriptors, takes less byte, realize volume The beneficial effect of data protocol file simple, intuitive is write, and the above method may only realize the use for overstating platform, overstate turning for language Change.
Presently filed embodiment is the foregoing is only, not thereby limits the scope of the claims of the application, it is every to utilize this The equivalent structure or equivalent flow conversion that application specification and accompanying drawing content are made, or directly or indirectly it is used in other correlations Technical field, similarly it is included in the scope of patent protection of the application.

Claims (8)

1. a kind of processing method of block data chained file data, it is characterised in that comprise the following steps:
Write data description file;
Write default block data chained file;
The block data chained file calls the content stated in the description file.
2. the processing method of block data chained file data according to claim 1, it is characterised in that described to write data Description file further comprises:State one or more structures.
3. the processing method of block data chained file data according to claim 2, it is characterised in that one, the statement Or multiple structures include:The structure can be declared as any one in variable, pointer and array;To the structure The statement of body also includes the base attribute information of stated structure;The base attribute information includes title, data type With it is at least one in data format.
4. the processing method of block data chained file data according to claim 3, it is characterised in that the data format Including:It is at least one in initial form, object type and array type.
5. the processing method of block data chained file data according to claim 1, it is characterised in that described writing is pre- If block data chained file the step of after also include:
Function needed for calling;
The function is used to complete default instruction;
The function comes from function library or SQL.
6. the processing method of block data chained file data according to claim 1, it is characterised in that it is described write it is default Block data chained file the step of after, in addition to:For the block data chained file assignment, and gained block after storage assignment Data chained file.
7. the processing method of block data chained file data according to claim 6, it is characterised in that described is the area Block number also includes afterwards according to chained file assignment:Preset instructions are received, the block data chained file and binary file is mutual Conversion.
8. the processing method of block data chained file data according to claim 7, it is characterised in that described default finger Order includes:Block data chained file is converted into the instruction of binary file and/or binary file is converted into block data chain The instruction of file.
CN201711155580.1A 2017-11-17 2017-11-17 The processing method of block data chained file data Pending CN107861720A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711155580.1A CN107861720A (en) 2017-11-17 2017-11-17 The processing method of block data chained file data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711155580.1A CN107861720A (en) 2017-11-17 2017-11-17 The processing method of block data chained file data

Publications (1)

Publication Number Publication Date
CN107861720A true CN107861720A (en) 2018-03-30

Family

ID=61702107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711155580.1A Pending CN107861720A (en) 2017-11-17 2017-11-17 The processing method of block data chained file data

Country Status (1)

Country Link
CN (1) CN107861720A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113375A (en) * 2019-03-26 2019-08-09 罗克佳华科技集团股份有限公司 Resource share method and device, system, storage medium
CN114938397A (en) * 2022-05-17 2022-08-23 浙江木链物联网科技有限公司 Kaitai-based high-efficiency protocol unpacking and packing method, system and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170017936A1 (en) * 2015-07-14 2017-01-19 Fmr Llc Point-to-Point Transaction Guidance Apparatuses, Methods and Systems
CN106506493A (en) * 2016-10-27 2017-03-15 摩登大道时尚电子商务有限公司 Data processing method based on block platform chain
CN107122682A (en) * 2017-04-20 2017-09-01 杭州铜板街互联网金融信息服务有限公司 The data processing method and system stored based on block chain

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170017936A1 (en) * 2015-07-14 2017-01-19 Fmr Llc Point-to-Point Transaction Guidance Apparatuses, Methods and Systems
CN106506493A (en) * 2016-10-27 2017-03-15 摩登大道时尚电子商务有限公司 Data processing method based on block platform chain
CN107122682A (en) * 2017-04-20 2017-09-01 杭州铜板街互联网金融信息服务有限公司 The data processing method and system stored based on block chain

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨平华,涂玉芬主编: "《C程序设计教程》", 31 December 2008 *
马超: "徽商银行基金代销自动账户系统设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113375A (en) * 2019-03-26 2019-08-09 罗克佳华科技集团股份有限公司 Resource share method and device, system, storage medium
CN114938397A (en) * 2022-05-17 2022-08-23 浙江木链物联网科技有限公司 Kaitai-based high-efficiency protocol unpacking and packing method, system and readable storage medium

Similar Documents

Publication Publication Date Title
US11386271B2 (en) Mathematical processing method, apparatus and device for text problem, and storage medium
CN106775725B (en) Visual configuration editing method and device
CN104753540B (en) Data compression method, data decompression method and apparatus
CN109460219B (en) Method for quickly serializing interface control file
CN107463668B (en) Method and device, computer equipment and the storage medium of serializing and unserializing
CN106648662B (en) Report generation device and method based on project cost calculation description language BCL
CN106570018A (en) Serialization method and apparatus, deserialization method and apparatus, serialization and deserialization system, and electronic device
CN104915186B (en) A kind of method and apparatus making the page
CN107622080B (en) Data processing method and equipment
CN110941427B (en) Code generation method and code generator
Fuchssteiner MuPAD User’s Manual: Multi-Processing Algebra Data Tool, MuPAD Version 1.2. 2
KR20040002738A (en) System and method for supporting non-native xml in native xml of a word-processor document
CN110309280A (en) A kind of corpus expansion method and relevant device
US9208208B2 (en) Table application programming interfaces (APIs)
MXPA06000813A (en) System and method for storing a document in a serial binary format.
CN103309849B (en) A kind of docx document creation based on OpenXML and amending method
CN107861720A (en) The processing method of block data chained file data
CN106557454A (en) Conversion method and converting system of the document to form
CN107391529A (en) A kind of method and device for realizing Object Relation Mapping ORM
US8036857B2 (en) Design modelling
CN105867886B (en) Method and device for writing table
CN104281604B (en) Method and system for generating Target Link data dictionary hierarchical tree
CN107329756A (en) Generation method, device, storage medium, processor and the terminal of program file
WO2023103914A1 (en) Text sentiment analysis method and device, and computer-readable storage medium
WO2023249785A1 (en) Responding to task prompt on declarative code using language model

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180330

RJ01 Rejection of invention patent application after publication