Detailed description of the invention
In order to solve the method operability complexity that existing data process, the technical problem of poor stability, this Shen
Please embodiment provide data process method, according to data cell, the data set of amended master data set
Mark, back up from the form of the data cell of data set master data set, data set identification, from data set.Number
By calling last change record, and number can need not be transferred from multiple positions again during backup after revising according to unit
According to, therefore, easy and simple to handle.And revise every time and all form amendment record, make a mistake and will not lead when operating
Cause whole amendment misregistrations, therefore, good stability.
For making the purpose of the application, technical scheme and advantage clearer, specifically real below in conjunction with the application
Execute example and technical scheme is clearly and completely described by corresponding accompanying drawing.Obviously, described
Embodiment is only some embodiments of the present application rather than whole embodiments.Based on the enforcement in the application
Example, the every other enforcement that those of ordinary skill in the art are obtained under not making creative work premise
Example, broadly falls into the scope of the application protection.
In the computer technology relevant to data base, data structure refer to the type of organization of data or data it
Between contact.Data structure is divided into again the logical structure of data and the physical arrangement of data.The logic knot of data
Structure is the contact between the angle-data of logic and organizational form carrys out observed data, analytical data,
Unrelated with the storage position of data.The embodiment of the present application pertains only to the logical structure of data, and will reflection and
The method of contact and organizational form between data that realizes is referred to as data model.Data model mainly has three kinds, i.e. presses
Graph Theory set up hierarchy Model and network structure model and by relational theory set up pass tying
Structure model.
A kind of oriented and ordered tree having root node of hierarchy Model.Mathematics " is set " and is defined
It it is the connected graph that returns of a nothing.Refer to the organization chart of Fig. 1, Tu1Shi Yige institution of higher education.At figure
In 1, XX school is in the position of root node, is a data set.A system is in the position of minor matters point,
It is a data set equally.In XX school and A system in mutual relation, XX school includes A system,
XX school is master data set, and A system is from data set.XX school includes this inclusion relation of A system,
It it is the one in the principal and subordinate's expansion relation pointed out in the embodiment of the present application.Hierarchy Model passes through this principal and subordinate
Expansion relation constantly extends.IMS (Information Management System) is its Typical Representative.
In network structure model, in netted between data set, its Typical Representative is DBTG (Database Task
Group).Can be mathematically hierarchy Model by network structure model conversation.
In relational expression structural model, the data structure of some complexity is attributed to simple binary crelation, i.e. two dimension
Form.Such as, the list of results that certain class comprises all student performances is exactly the relational expression knot of binary crelation
Structure.
The flow chart of the method that the data that Fig. 2 provides for the embodiment of the present application process, specifically includes following step
Rapid:
S100: when data cell is modified, search described data cell place master data set or from
The data set identification of data set.
Master data set or there is unique data set identification from each data sets such as data sets.Repair in data cell
When changing, it is first determined the position of this data cell, i.e. the data set at data cell place.This data cell institute
Data set be probably master data set, it is also possible to from data set.
Such as, to when the achievement of certain student is modified in certain class, the list of results at this achievement place is searched
Coding.
The most such as, to when input-output equipment driver is updated in calculating, searches these input and output and set
Standby driver key assignments in registration table.
S200: when the data set identification that described data set identification is master data set, according to described data set mark
Know, find with described master data set have principal and subordinate's expansion relation from data set, search from data set with
The data cell that described data cell is corresponding, or, when described data set identification is the data set mark from data set
During knowledge, according to described data set identification, find and the described master data from data set with principal and subordinate's expansion relation
Collection, searches the data cell corresponding with described data cell in master data set.
In previous step, according to data set identification, the data set found, it may be possible to master data set, also
It is probably from data set.Master data set with from data set, there is principal and subordinate's expansion relation, such as, the bag in Fig. 2
Containing relation, or adduction relationship, index relative etc..Utilize this principal and subordinate's expansion relation, the data being modified
Unit when master data set, can find out by master data set expand from data set, and from data set
The data cell that the data cell that finds further and be modified is corresponding.Or, utilize this principal and subordinate to extend pass
It is that the data cell being modified, when from data set, can find out the master data set from data set expanded,
And from master data set, find the data cell corresponding with the data cell being modified further.
Such as, in the organization chart of institution of higher education in fig. 2, it is assumed that X certain student of specialty of A system
Forward Y specialty to.When performing step S100, search student number (described data cell) place of this student
X specialty (from data set) professional code X (data set identification).In this step, according to specialty
Code X (data set identification) finds the A system comprising X specialty (to extend pass with having principal and subordinate from data set
The master data set of system).In A system (master data set), search the student number with this student (X specialty is repaiied
The data cell changed) corresponding student number (data cell of master data set).
It is pointed out that in example, the data cell of amendment comes from from data set, for those skilled in the art
For, when the data cell of amendment is similar with situation presented hereinbefore, the most not from the situation of master data set
Repeat again.
Simultaneously, it should be pointed out that master data set and be one layer of principal and subordinate's expansion relation between data set here,
For multilamellar principal and subordinate's expansion relation, carrying out operation can realize iteration, the most no longer says
Bright.
S300: according to the data cell of amended master data set, data set identification, from the data of data set
Unit form backup master data set, data set identification, from data set.
According to master data set and the principal and subordinate's expansion relation from data set, by data sheet all of in master data set
The mark of unit, all of data cell from data set and each data set all checks out, and presses
According to the data cell of amended master data set, data set identification, standby from the form of the data cell of data set
Part.Backup operation is described in detail by rear extended meeting.
In the embodiment of the present application, after the amendment of each data cell, all can back up.Data cell is again
Can be by calling last change record during backup after amendment, and need not be again from multiple positions called data, therefore,
Easy and simple to handle.And revise every time and all form amendment record, make a mistake and be not result in whole repairing when operating
Change misregistration, therefore, good stability.
As described in background technology, master data set and each be often distributed in same computer from data set
Diverse location, be even distributed in different server.Meanwhile, at master data set with respectively from data set
It is often to carry out backing up according to the structure of each data set independence during data cell backup.So, backup is interior
Appearance not only comprises the data content of data cell self, also comprises the structure of data, need substantial amounts of storage
Resource.In the embodiment of the present application, a kind of data interchange language Backup Data using lightweight is also provided for
Technical scheme, in order to alleviate the demand to memory space.
The most first the data interchange language of lightweight is used to be described briefly the embodiment of the present application.
JSON (JavaScript Object Notation) is a kind of by the conception of Douglas Kroc Ford
Design, the data interchange language of lightweight.
JSON is used for describing data structure, with the presence of following form:
For object (object), object exits with " { " starts, and with " } ".One object comprises one
" name/value " of the non-sequence of series, uses ", " to separate between each " name/value ".Such as: " name ":
" a king young waiter in a wineshop or an inn " }.
For name/value (collection), ": " between title and value, is used to separate, such as, " name ":
" a king young waiter in a wineshop or an inn ".
One title is a character string.One character string is a string character bracketed with " ".
One value can be a character string, a numerical value, an object, a Boolean, and one in order
List, or a null value.
Numerical value refers to the numeral combination of a series of 0-9, can be negative or decimal.Can also with " e " or
" E " is expressed as exponential form.
Boolean: be expressed as true or false.
After the ordered list (Array) of value is referred to that one or more value separates with ", ", use " [",
"] " list that brackets.The ordered list of value, shape such as [collection, collection].
Further, backup master data set, data set identification, from data set, specifically include:
By the data cell of master data set, data set identification, from the data cell of data set, according to JSON
Format conversion is the JSON document combined by object and list.
Programmer, author, three data cells of musician, wherein, every number are comprised below with master data set
Illustrate as a example by data set according to corresponding one of unit.
" programmers ": [
{ " firstName ": " Brett ", " lastName ": " McLaughlin ", " email ": " aaaa " },
{ " firstName ": " Jason ", " lastName ": " Hunter ", " email ": " bbbb " },
{ " firstName ": " Elliotte ", " lastName ": " Harold ", " email ": " cccc " }
],
" authors ": [
{ " firstName ": " Isaac ", " lastName ": " Asimov ", " genre ": " sciencefiction " },
{ " firstName ": " Tad ", " lastName ": " Williams ", " genre ": " fantasy " },
{ " firstName ": " Frank ", " lastName ": " Peretti ", " genre ": " christianfiction " }
],
" musicians ": [
{ " firstName ": " Eric ", " lastName ": " Clapton ", " instrument ": " guitar " },
{ " firstName ": " Sergei ", " lastName ": " Rachmaninoff ", " instrument ": " piano " }
]}
Wherein, the Composition of contents object that a pair " { } " of outermost is surrounded.For name/value (collection),
" programmers ":
[
{ " firstName ": " Brett ", " lastName ": " McLaughlin ", " email ": " aaaa " },
{ " firstName ": " Jason ", " lastName ": " Hunter ", " email ": " bbbb " },
{ " firstName ": " Elliotte ", " lastName ": " Harold ", " email ": " cccc " }
],
The Composition of contents list bracketed by a pair " [] ".And " Brett " therein, " McLaughlin ",
" aaaa " is then respectively as the data cell from data set program person (programmers).In the application
In embodiment, by the data cell (programmer, author, musician) of master data set, from the number of data set
According to unit (" Brett ", " McLaughlin ", " aaaa "), data set identification (" firstName ", " lastName ",
" email ") etc. be the JSON document combined by object and list according to JSON format conversion.At this
In application embodiment, owing to JSON form is a kind of light weight collection data interchange language, therefore backup document
Memory space requires significantly to reduce.
Further, described method also includes:
According to default compression algorithm, JSON document is compressed.
In order to reduce the backup document requirement to memory space further, the embodiment of the present application is to JSON document
It is compressed processing.The embodiment of the present application uses GZIP compress technique, according to the compression algorithm pair of GZIP
JSON document is compressed processing.It should be pointed out that, it is also permissible for using other different compression algorithms
, and, it is not construed as the substantial protection scope departing from the embodiment of the present application.
Further, described method also includes:
According to default encryption algorithm, compressed JSON document is encoded.
Owing to the JSON document of compression is difficult to read for user, and it is difficult to transplant.Therefore, this Shen
Please embodiment, also provide for the further process of compressed JSON document.The embodiment of the present application uses BASE64
Coding techniques, carries out coded treatment according to BASE64 encryption algorithm to compressed JSON.Equally, should
When it is noted that use other different encryption algorithms also possible, and, it is not construed as departing from
The substantial protection scope of the embodiment of the present application.
Further, described method also includes:
According to default AES, JSON document is encrypted.
In the embodiment of the present application, in order to protect the safety of backup document, JSON document is encrypted place
Reason.The embodiment of the present application uses md5 encryption technology, is encrypted JSON according to md5 encryption algorithm
Process.Equally, it is noted that use other different AESs also possible, and, no
Should be understood to the substantial protection scope departing from the embodiment of the present application.
Further, described method also includes:
Store encrypted JSON document in order or encoded compression JSON document forms release's letter
Breath.
In order to ensure the seriality of amendment, the embodiment of the present application stores encrypted JSON document in order
Or encoded compression JSON document forms release's information.Backup document is identified easily according to release's information
Order, convenient management.
It is above the backup method of data, it is contemplated that restoration methods is the inverse operation to backup method,
Introduce the restoration methods of data below.
Further, a kind of method that data process, it is used for processing master data set, being expanded by master data set
The data cell comprised from data set, including:
According to the data cell of master data set in backup document, data set identification, from the data cell of data set,
Recover respectively master data set, by master data set according to principal and subordinate's incidence relation expand from data set.
By above description, owing to backup document storing the data cell of master data set, data set mark
Know, from the full content of the data cell of data set, therefore, it can the concrete data knot according to each data set
Structure and requirement, recover respectively master data set, by master data set according to principal and subordinate's incidence relation expand from data
Collection.
Further, described backup document is compressed JSON document, and described method also includes:
To compressed JSON document, decompress according to corresponding decompression algorithm.
The embodiment of the present application uses GZIP compress technique, according to the decompression algorithm of GZIP to JSON document
Carry out decompression processing.It should be pointed out that, use other different decompression algorithm also possible, and,
It is not construed as the substantial protection scope departing from the embodiment of the present application.
Further, described backup document is encoded compression JSON document, and described method also includes:
For encoded compression JSON document, it is decoded according to corresponding decoding algorithm.
The embodiment of the present application uses BASE64 decoding technique, according to BASE64 decoding algorithm to encoded
Compression JSON document is decoded processing.Equally, it is noted that use other different decodings to calculate
Method is also possible, and, it is not construed as the substantial protection scope departing from the embodiment of the present application.
Further, described backup document is encrypted JSON document, and described method also includes:
To encrypted JSON document, it is decrypted according to corresponding decipherment algorithm.
The embodiment of the present application uses MD5 decryption technology, is decrypted JSON according to MD5 decipherment algorithm
Process.Equally, it is noted that use other different AESs also possible, and, no
Should be understood to the substantial protection scope departing from the embodiment of the present application.
Further, described method also includes:
JSON document after deciphering is encrypted again;
Judge that the JSON document again encrypted is the most consistent with the JSON document before deciphering;
When both are consistent, send the message of successful decryption, otherwise, send deciphering failure.
It is pointed out that the correctness in order to verify backup document, prevent from doing non-productive work, the application is real
Execute example JSON document after deciphering is encrypted again, and the JSON document more again encrypted and deciphering
Front JSON document is the most consistent.When both are inconsistent, then send deciphering failure, and terminate
The recovery of data.
Further, described method also includes:
Release's information that acquisition is to be recovered;
According to the backup document that release's information retrieval is to be recovered.
In the embodiment of the present application, identified the order of backup document easily by release's information, consequently facilitating
The version extracting the backup document needed is easy to recover.
The method that the data provided for the embodiment of the present application above process, based on same thinking, the application is real
Execute example and additionally provide the system that a kind of data process.
Refer to Fig. 3, the structural representation of the system of a kind of data process is provided for the embodiment of the present application.
A kind of data process system 1, for process master data set, by master data set expand from data
The data cell that collection is comprised, including:
Search module 11, for searching the master data set at the data cell place being modified or from the number of data set
According to set identifier;
Matching module 12, is used for: when the data set identification that described data set identification is master data set, root
According to described data set identification, find with described master data set have principal and subordinate's expansion relation from data set, from
Data set is searched the data cell corresponding with described data cell, or, when described data set identification is from number
During according to the data set identification collected, according to described data set identification, find and from data set, there is principal and subordinate's expansion with described
The master data set of exhibition relation, searches the data cell corresponding with described data cell in master data set;
Backup module 13, for according to the data cell of amended master data set, data set identification, from
The data cell of data set form backup master data set, data set identification, from data set.
In the embodiment of the present application, data process system 1 in use, data cell amendment after backup time
Can be by calling last change record, and need not be again from multiple positions called data, therefore, easy and simple to handle.
And revise every time and all form amendment record, make a mistake and when operating, be not result in that whole amendment records is wrong
By mistake, therefore, good stability.
Further, backup module 13, be used for backing up master data set, data set identification, from data set,
Specifically for:
By the data cell of master data set, data set identification, from the data cell of data set, according to JSON
Format conversion is the JSON document combined by object and list.
Further, system 1 also includes that compression module 14, compression module 14 are used for:
According to default compression algorithm, JSON document is compressed.
Further, system 1 also includes that coding module 15, coding module 15 are used for:
According to default encryption algorithm, compressed JSON document is encoded.
Further, system 1 also includes that encrypting module 16, encrypting module 16 are used for:
According to default AES, JSON document is encrypted.
Further, system 1 also includes that version management module 17, version management module 17 are used for:
Store encrypted JSON document in order or encoded compression JSON document forms release's letter
Breath.
A kind of data process system 2, for process master data set, by master data set expand from data
The data cell that collection is comprised, including:
Recover module 21, for according to the data cell of master data set in backup document, data set identification,
From the data cell of data set, recover master data set respectively, extended according to principal and subordinate's incidence relation by master data set
Go out from data set.
In the embodiment of the present application, the system 2 that data process in use, can be distinguished by backup document
Recover master data set, by master data set according to principal and subordinate's incidence relation expand from data set.Further, mutually
Multiple amendment record be the most independent, therefore, good stability.
Further, backup document is compressed JSON document.
System 1 also includes that decompression module 22, decompression module 22 are used for:
To compressed JSON document, decompress according to corresponding decompression algorithm.
Further, backup document is encoded compression JSON document;
System 1 also includes that decoder module 23, decoder module 23 are used for:
For encoded compression JSON document, it is decoded according to corresponding decoding algorithm.
Further, described backup document is encrypted JSON document;
System 1 also includes that deciphering module 24, deciphering module 24 are used for:
To encrypted JSON document, it is decrypted according to corresponding decipherment algorithm.
Further, system 1 also includes that module 25 is examined in school, and school inspection module 25 is used for:
JSON document after deciphering is encrypted again;
Judge that the JSON document again encrypted is the most consistent with the JSON document before deciphering;
When both are consistent, send the message of successful decryption, otherwise, send deciphering failure.
Further, system 1 also includes that version management module 26, version management module 26 are used for:
Release's information that acquisition is to be recovered;
According to the backup document that release's information retrieval is to be recovered.
Those skilled in the art it should be appreciated that embodiments of the invention can be provided as method, system or
Computer program.Therefore, the present invention can use complete hardware embodiment, complete software implementation or
Form in conjunction with the embodiment in terms of software and hardware.And, the present invention can use one or more wherein
The computer-usable storage medium including computer usable program code (includes but not limited to disk storage
Device, CD-ROM, optical memory etc.) form of the upper computer program implemented.
The present invention is with reference to method, equipment (system) and computer program product according to embodiments of the present invention
The flow chart of product and/or block diagram describe.It should be understood that can by computer program instructions flowchart and
/ or block diagram in each flow process and/or flow process in square frame and flow chart and/or block diagram and/
Or the combination of square frame.These computer program instructions can be provided to general purpose computer, special-purpose computer, embedding
The processor of formula datatron or other numerical value processing equipments able to programme is to produce a machine so that by calculating
The instruction that the processor of machine or other numerical value processing equipments able to programme performs produces for realizing at flow chart one
The device of the function specified in individual flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions may be alternatively stored in and computer or the process of other numerical value able to programme can be guided to set
In the standby computer-readable memory worked in a specific way so that be stored in this computer-readable memory
Instruction produce and include the manufacture of command device, this command device realizes in one flow process or multiple of flow chart
The function specified in flow process and/or one square frame of block diagram or multiple square frame.
These computer program instructions also can be loaded in computer or other numerical value processing equipments able to programme, makes
Sequence of operations step must be performed to produce computer implemented place on computer or other programmable devices
Reason, thus the instruction performed on computer or other programmable devices provides for realizing flow chart one
The step of the function specified in flow process or multiple flow process and/or one square frame of block diagram or multiple square frame.
In a typical configuration, calculating equipment includes one or more processor (CPU), input/defeated
Outgoing interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory
(RAM) and/or the form such as Nonvolatile memory, such as read only memory (ROM) or flash memory (flash
RAM).Internal memory is the example of computer-readable medium.
Computer-readable medium includes that removable media permanent and non-permanent, removable and non-can be by appointing
Where method or technology realize information storage.Information can be computer-readable instruction, value structure, program
Module or other numerical value.The example of the storage medium of computer includes, but are not limited to phase transition internal memory
(PRAM), static RAM (SRAM), dynamic random access memory (DRAM), its
The random access memory (RAM) of his type, read only memory (ROM), electrically erasable are read-only
Memorizer (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read only memory
(CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tape, tape magnetic
Disk storage or other magnetic storage apparatus or any other non-transmission medium, can be used for storage can be calculated
The information that equipment accesses.According to defining herein, computer-readable medium does not include temporary computer-readable matchmaker
Body (transitory media), such as numerical signal and the carrier wave of modulation.
Also, it should be noted term " includes ", " comprising " or its any other variant are intended to non-
Comprising of exclusiveness, so that include that the process of a series of key element, method, commodity or equipment not only wrap
Include those key elements, but also include other key elements being not expressly set out, or also include for this process,
The key element that method, commodity or equipment are intrinsic.In the case of there is no more restriction, statement " include
One ... " key element that limits, it is not excluded that including the process of described key element, method, commodity or setting
Other identical element is there is also in Bei.
It will be understood by those skilled in the art that embodiments herein can be provided as method, system or computer journey
Sequence product.Therefore, the application can use complete hardware embodiment, complete software implementation or combine software and
The form of the embodiment of hardware aspect.And, the application can use and wherein include calculating one or more
The computer-usable storage medium of machine usable program code (include but not limited to disk memory, CD-ROM,
Optical memory etc.) form of the upper computer program implemented.
The foregoing is only embodiments herein, be not limited to the application.For this area skill
For art personnel, the application can have various modifications and variations.All institutes within spirit herein and principle
Any modification, equivalent substitution and improvement etc. made, within the scope of should be included in claims hereof.