CN103425632A - Serializing method, device and processor - Google Patents
Serializing method, device and processor Download PDFInfo
- Publication number
- CN103425632A CN103425632A CN2013103907232A CN201310390723A CN103425632A CN 103425632 A CN103425632 A CN 103425632A CN 2013103907232 A CN2013103907232 A CN 2013103907232A CN 201310390723 A CN201310390723 A CN 201310390723A CN 103425632 A CN103425632 A CN 103425632A
- Authority
- CN
- China
- Prior art keywords
- data
- serializing
- treatment
- property
- nested
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000000875 corresponding effect Effects 0.000 claims description 94
- 238000005538 encapsulation Methods 0.000 claims description 13
- 238000010586 diagram Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 4
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000008878 coupling Effects 0.000 description 2
- 238000013461 design Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000001131 transforming effect Effects 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a serializing method. The method comprises the steps of generating a corresponding nest protocol after the data to be serialized is determined to be the nesting self-defined data; according to the nest protocol, obtaining the attribute name and the attribute value corresponding to the attribute name of the date to be serialized, and generating a corresponding first key value pair; obtaining the attribute name and the attribute value corresponding to the attribute name of the nested data and generating a corresponding second key value pair; placing the first and second key value pairs into medium type data according to the nesting relation of the data to be serialized; finally serializing the medium type data containing the first and second key value pairs. The serializing method disclosed by the invention can serialize the attributes of the nested self-defined data to directly serialize the data, work personnel do not need to manually set the attributes, consumption of manpower and time is reduced, and the serializing efficiency is improved.
Description
Technical field
The present invention relates to computer realm, particularly relate to a kind of method, device and processor of serializing.
Background technology
Serializing refers to the process that Obj State is converted to the form that can keep or transmit, and can be used in data are stored and transmitted, and has a wide range of applications.For example, when a little data of needs, to local hard drive or by before transmitted data on network, need to carry out serializing to it, described data be changed into to binary file, thereby be convenient to the read-write of described data on hard disk or the transmission of network.
In OO programming language Objective-c, provide a kind of method of Binary Serialization.OO program is in operational process, while needing storage or transmission data, can be according to corresponding object diagram of described data creation, then utilize the method for described Binary Serialization, described object diagram is carried out to serializing in binary mode to it, obtain corresponding binary stream, and the attribute information of data is also carried out to serializing, it is loaded in described binary stream, more described binary stream is transmitted by network or writing in files in, realize the serializing to described data.In addition, in Objective-c, complete the data that a project often needs a large amount of customization types, when the data of described customization type are carried out to serializing, need to be translated into the data of an intermediate form, and then the data after transforming are carried out to serializing.
But, the inventor finds, in Objective-c, when data are carried out to serializing, can only obtain the attribute information of the data of basic data type, perhaps, when being obtained from the data of define styles, can only obtain the attribute information of non-nested type, and can't obtain the attribute of the data of nested customization type, when the data of the customization type to nested are carried out Binary Serialization, need the staff manually to input the attribute for the treatment of the serializing data, expend a large amount of manpowers and time.
Summary of the invention
In view of this, the object of the present invention is to provide a kind of method, device and processor of serializing, to address the above problem, specific embodiments is as follows:
A kind of method of serializing comprises:
After determining the data that data until serializing are nested customization type, according to the described data for the treatment of serializing, obtain corresponding nested agreement;
According to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, and, by described Property Name and property value encapsulation, generate corresponding the first key-value pair;
Obtain in the described data for the treatment of serializing by the Property Name of nested data and property value corresponding to described Property Name, and described described Property Name and property value by nested data encapsulated, generate corresponding the second key-value pair;
According to the described nest relation for the treatment of the data of serializing, respectively described the first key-value pair and the second key-value pair are put into to the data of intermediate form;
The Data Serialization that will include the described intermediate form of described the first key-value pair and the second key-value pair.
Preferably, the method for described serializing also comprises:
Obtain the described data for the treatment of serializing, and, according to the described data type title for the treatment of the data of serializing, obtain the described Property Name for the treatment of the data of serializing, as the first attribute description information;
Travel through the described data for the treatment of serializing, and generate corresponding Property Name according to traversing result, as the second attribute description information;
Contrast described the first attribute description information whether identical with described the second attribute description information, if contain the attribute information do not had in described the first attribute description information in described the second attribute description information, the data that the described data for the treatment of serializing are nested customization type are described.
Preferably, described according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, comprising:
According to described nested agreement, obtain the described attribute list for the treatment of the data of serializing, wherein, described attribute list comprises all properties title in the described data for the treatment of serializing, and, according to described nested agreement, the corresponding relation of getattr title and property value;
According to described Property Name, and the corresponding relation of described Property Name and property value, described property value corresponding to Property Name for the treatment of the data of serializing obtained.
Preferably, described intermediate form is NSDictionary dictionary type.
Accordingly, the invention also discloses a kind of device of serializing, comprising:
Nested agreement acquisition module, for after determining the data that data until serializing are nested customization type, according to the described data for the treatment of serializing, obtain corresponding nested agreement;
The first key-value pair generation module, for according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, and, by described Property Name and property value encapsulation, generate corresponding the first key-value pair;
The second key-value pair generation module, describedly treat that the data of serializing are by the Property Name of nested data and property value corresponding to described Property Name for obtaining, and described described Property Name and property value by nested data encapsulated, generate corresponding the second key-value pair;
Placement module, for according to the described nest relation for the treatment of the data of serializing, put into described the first key-value pair and the second key-value pair respectively the data of intermediate form;
The serializing module, for the Data Serialization of the described intermediate form that will include described the first key-value pair and the second key-value pair.
Preferably, the device of described serializing also comprises:
The first acquisition module, for obtaining the described data for the treatment of serializing, and, according to the described data type title for the treatment of the data of serializing, obtain the described Property Name for the treatment of the data of serializing, as the first attribute description information;
The second acquisition module, for traveling through the described data for the treatment of serializing, and generate corresponding Property Name according to traversing result, as the second attribute description information;
Type judging module, whether identical with described the second attribute description information for contrasting described the first attribute description information, if contain the attribute information do not had in described the first attribute description information in described the second attribute description information, the data that the described data for the treatment of serializing are nested customization type are described.
Preferably, described the first key-value pair generation module comprises property value acquiring unit and encapsulation unit, described property value acquiring unit is used for according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, described encapsulation unit is for encapsulating described Property Name and property value, generate corresponding the first key-value pair, wherein, described property value acquiring unit comprises:
First obtains subelement, be used for according to described nested agreement, obtain the described attribute list for the treatment of the data of serializing, wherein, described attribute list comprises all properties title in the described data for the treatment of serializing, and, according to described nested agreement, the corresponding relation of getattr title and property value;
Second obtains subelement, for according to described Property Name, and the corresponding relation of described Property Name and property value, obtain described property value corresponding to Property Name for the treatment of the data of serializing.
Preferably, described intermediate form is NSDictionary dictionary type.
Accordingly, the invention also discloses a kind of processor, be integrated with the device of serializing as above on the chip of described processor.
The application discloses a kind of method of serializing, and the method, after determining the data that data until serializing are nested customization type, at first generates corresponding nested agreement; Then according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, generate corresponding the first key-value pair; Obtain by the Property Name of nested data and property value corresponding to described Property Name, generate corresponding the second key-value pair; According to the described nest relation for the treatment of the data of serializing, described the first key-value pair and the second key-value pair are put into to the data of intermediate form; The Data Serialization that finally, will include the described intermediate form of described the first key-value pair and the second key-value pair.
Adopt the method for the disclosed serializing of the application, the attribute of the data of nested customization type can be carried out to serializing, thereby can directly to it, carry out serializing, and not need again the staff manually to be set a property, reduce the consumption to manpower and time, improved the efficiency of serializing.
Further, in prior art, the staff is when the attribute of the data that nested customization type is set, sometimes because mistake appears in carelessness, and the method for the disclosed serializing of the application, automatically the attribute of the data of nested customization type is carried out to serializing, no longer need manual input, improved the accuracy of serializing.
The accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, below will the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The workflow schematic diagram of the method that Fig. 1 is the disclosed a kind of serializing of the embodiment of the present invention;
The workflow schematic diagram of the method that Fig. 2 is disclosed another serializing of the embodiment of the present invention;
The structural representation of the device that Fig. 3 is the disclosed a kind of serializing of the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making under the creative work prerequisite the every other embodiment obtained, belong to the scope of protection of the invention.
In prior art, when data are carried out to serializing, can't carry out serializing to the data of nested customization type, in order to address this problem, the application provides a kind of method of serializing, workflow schematic diagram shown in Figure 1, and the method for described serializing comprises:
Step S11, after determining the data that data until serializing are nested customization type, according to the described data for the treatment of serializing, obtain corresponding nested agreement.
Treat that to described the data of serializing are differentiated in advance, learn describedly after the data for nested customization type of serializing when judgement, obtain corresponding nested agreement (protocol).Wherein, described nested agreement (protocol) comprises the described Property Name for the treatment of the data of serializing, and the corresponding relation between Property Name and property value.
Wherein, described Property Name is determined by the data type of the described data for the treatment of serializing, and the corresponding relation between each Property Name and property value, usually pre-stored in processor, after obtaining described Property Name according to described data type, extract the definite Property Name of described data type and the corresponding relation between property value from described processor, and according to described Property Name, and the corresponding relation between described Property Name and property value, generate corresponding nested agreement.
Step S12, according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, and, by the encapsulation of described Property Name and property value, generate corresponding the first key-value pair.
The attribute of data comprises Property Name and the property value corresponding with described Property Name.Usually, the first key-value pair that described Property Name and property value form, with the form realization of " Property Name-property value ".
Especially, each attribute is also the attribute that himself is arranged, in property value corresponding to the Property Name of the described data for the treatment of serializing and described Property Name, comprise Property Name and the property value of data self, also comprise Property Name and the property value of the attribute of data self.
Step S13, obtain in the described data for the treatment of serializing by the Property Name of each nested data and property value corresponding to described Property Name, and described described Property Name and property value by nested data encapsulated, generate corresponding the second key-value pair.
Described the second key-value pair, also realize with the form of " Property Name-property value " usually.
In addition, nested data type is generally a(b) form, wherein, data b is by nested data type, when the Property Name that obtains the described data until serializing according to nested agreement and property value, can only get all Property Names and the property value of data a.In order to guarantee the integrality of the data after serializing, also need data b is carried out to serializing.That is to say, also need to obtain in the data for the treatment of serializing, by the Property Name of nested data and property value.
In addition, if also there are nested data in data b, also need to obtain again Property Name and the property value of the data nested by described data b, and generate corresponding the second key-value pair.That is to say, after the Property Name that obtains data b and property value, if also there are nested data in data b, using described nested data as current data, continue to obtain Property Name and the property value of the described nested data in data b, then judge in described current data and whether also have nested data, if also exist, using the nested data of described existence as current data, continue to obtain Property Name and the property value of described current data, until no longer contain nested data in current data.
In the application, according to the method described above, obtain in the described data for the treatment of serializing, by the Property Name of each nested data and property value, and generate successively the second key-value pair separately.
Especially, described by the Property Name of nested data and property value, comprise Property Name and the property value of data self, also comprise Property Name and the property value of the attribute of data self.
Step S14, according to the described nest relation for the treatment of the data of serializing, respectively described the first key-value pair and the second key-value pair are put into to the data of intermediate form.
Due to the described data of the treating serializing data that are nested customization type, also may there is multiple nested form under parent, for example, for " a(b(c)) ", in this case, in step S12, obtained the first key-value pair that data a generates, in step S13, obtained respectively by Property Name and the property value of nested data b and data c, and generated respectively second key-value pair corresponding with described data b and data c.Getting the described nest relation for the treatment of the data of serializing, can be according to nest relation, put into the data of intermediate form propertyDict, for example, the first key-value pair and the second key-value pair are built into to the form of " the first key-value pair that a is corresponding (the second key-value pair that b is corresponding (the second key-value pair that c is corresponding)) ", deposit in the data of intermediate form.
In addition, described intermediate form is generally NSDictionary dictionary type.Certainly, also can be converted into the type that other can carry out serializing, the application is not construed as limiting this.
Step S15, will include the Data Serialization of the described intermediate form of described the first key-value pair and the second key-value pair.
Because the data that include described the first key-value pair and the second key-value pair are intermediate form, can utilize Binary Serialization mode commonly used in Objective-c, it is carried out to serializing.Certainly, also can adopt other modes of the prior art, the data of middle type are carried out to serializing, the application is not construed as limiting this.
The application discloses a kind of method of serializing, and the method, after determining the data that data until serializing are nested customization type, at first generates corresponding nested agreement; Then according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, generate corresponding the first key-value pair; Obtain by the Property Name of nested data and property value corresponding to described Property Name, generate corresponding the second key-value pair; According to the described nest relation for the treatment of the data of serializing, described the first key-value pair and the second key-value pair are put into to the data of intermediate form; The Data Serialization that finally, will include the described intermediate form of described the first key-value pair and the second key-value pair.
Adopt the method for the disclosed serializing of the application, the attribute of the data of nested customization type can be carried out to serializing, thereby can directly to it, carry out serializing, and not need again the staff manually to be set a property, reduce the consumption to manpower and time, improved the efficiency of serializing.
Further, in prior art, the staff is when the attribute of the data that nested customization type is set, sometimes because mistake appears in carelessness, and the method for the disclosed serializing of the application, automatically the attribute of the data of nested customization type is carried out to serializing, no longer need manual input, improved the accuracy of serializing.
Further, workflow schematic diagram shown in Figure 2, the method for described serializing also comprises:
Step S21, obtain the described data for the treatment of serializing, and, according to the described data type title for the treatment of the data of serializing, obtain the described Property Name for the treatment of the data of serializing, as the first attribute description information.
When form that the described data until serializing are " a(b(c)) ", according to its data type title, can obtain the Property Name of data a.
In Objective-c, according to the data type title of the data for the treatment of serializing, obtain its corresponding Property Name (class_copyPropertyList ()), usually by api method class_copyPropertyList (), can realize.
Step S22, travel through the described data for the treatment of serializing, and generate corresponding Property Name according to traversing result, as the second attribute description information.
When form that the described data until serializing are " a(b(c)) ", it is traveled through, can obtain the wherein Property Name of data a, and by the Property Name of nested data b and data c.
Whether step S23, to contrast described the first attribute description information identical with described the second attribute description information, if contain the attribute information do not had in described the first attribute description information in described the second attribute description information, the data that the described data for the treatment of serializing are nested customization type are described.
Getting after the data of serializing, according to the disclosed method of above-mentioned steps, can judge the described data for the treatment of serializing and be whether the data of nested customization type.
Further, in step S12, disclose according to described nested agreement, obtained described Property Name and this technical scheme of property value corresponding to described Property Name for the treatment of the data of serializing, this scheme comprises:
At first, according to described nested agreement (protocol), obtain the described attribute list (protocol_copyPropertyList ()) for the treatment of the data of serializing, wherein, described attribute list comprises all properties title in the described data for the treatment of serializing, and, according to described nested agreement, the corresponding relation of getattr title and property value.
Same data type, often have a plurality of attributes.When form that the described data until serializing are " a(b(c)) ", in described nested agreement, include the Property Name of data a, and the corresponding relation of the Property Name of data a and its corresponding property value.According to described nested agreement, can generate the attribute list of all properties title that comprises data a, and the corresponding relation of each Property Name and property value.
Secondly, according to described Property Name, and the corresponding relation of described Property Name and property value, obtain described property value corresponding to Property Name for the treatment of the data of serializing.
According to said method, can obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing.
Method by above-mentioned disclosed serializing, the application can get the attribute of the data of nested customization type, and obtain wherein by the attribute of nested data, be placed in the data of intermediate form, to placing, it is carried out to serializing again, thereby realized the serializing to the attribute of the data of nested customization type, solved in prior art, when the data of the customization type to nested are carried out serializing, due to the attribute that can't obtain data, thereby can't carry out to it problem of serializing.
Accordingly, the invention also discloses a kind of device of serializing, structural representation shown in Figure 3, the device of described serializing comprises: nested agreement acquisition module 11, the first key-value pair generation module 12, the second key-value pair generation module 13, placement module 14 and serializing module 15, wherein
Described nested agreement acquisition module 11, for after determining the data that data until serializing are nested customization type, according to the described data for the treatment of serializing, obtain corresponding nested agreement;
The first key-value pair generation module 12, for according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, and, by described Property Name and property value encapsulation, generate corresponding the first key-value pair;
The second key-value pair generation module 13, describedly treat that the data of serializing are by the Property Name of nested data and property value corresponding to described Property Name for obtaining, and described described Property Name and property value by nested data encapsulated, generate corresponding the second key-value pair;
Further, the device of described serializing also comprises: the first acquisition module, the second acquisition module and type judging module, wherein,
Described the first acquisition module, for obtaining the described data for the treatment of serializing, and, according to the described data type title for the treatment of the data of serializing, obtain the described Property Name for the treatment of the data of serializing, as the first attribute description information;
Described the second acquisition module, for traveling through the described data for the treatment of serializing, and generate corresponding Property Name according to traversing result, as the second attribute description information;
Described type judging module, whether identical with described the second attribute description information for contrasting described the first attribute description information, if contain the attribute information do not had in described the first attribute description information in described the second attribute description information, the data that the described data for the treatment of serializing are nested customization type are described.
Further, described the first key-value pair generation module comprises property value acquiring unit and encapsulation unit, described property value acquiring unit is used for according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, described encapsulation unit is for encapsulating described Property Name and property value, generate corresponding the first key-value pair, wherein, described property value acquiring unit comprises:
First obtains subelement, be used for according to described nested agreement, obtain the described attribute list for the treatment of the data of serializing, wherein, described attribute list comprises all properties title in the described data for the treatment of serializing, and, according to described nested agreement, the corresponding relation of getattr title and property value;
Second obtains subelement, for according to described Property Name, and the corresponding relation of described Property Name and property value, obtain described property value corresponding to Property Name for the treatment of the data of serializing.
In addition, described intermediate form is NSDictionary dictionary type.
Accordingly, the present invention also discloses another kind of processor, and described processor comprises the device of serializing as above.
Adopt device and the processor of the disclosed serializing of the application, the attribute of the data of nested customization type can be carried out to serializing, thereby can directly to it, carry out serializing, and do not need by the staff, manually to be set a property again, reduce the consumption to manpower and time, improved the efficiency of serializing.
Further, in prior art, the staff is when the attribute of the data that nested customization type is set, sometimes because mistake appears in carelessness, and the method for the disclosed serializing of the application, automatically the attribute of the data of nested customization type is carried out to serializing, no longer need manual input, improved the accuracy of serializing.
Those of ordinary skills can recognize, unit and the algorithm steps of each example of describing in conjunction with embodiment disclosed herein can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are carried out with hardware or software mode actually, depend on application-specific and the design constraint of technical scheme.The professional and technical personnel can specifically should be used for realizing described function with distinct methods to each, but this realization should not thought and exceeds scope of the present invention.
The those skilled in the art can be well understood to, and for convenience and simplicity of description, the specific works process of the system of foregoing description, device and unit, can, with reference to the corresponding process in preceding method embodiment, not repeat them here.
In the several embodiment that provide in the application, should be understood that disclosed system, apparatus and method can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described unit, be only that a kind of logic function is divided, during actual the realization, other dividing mode can be arranged, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The described unit as the separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed on a plurality of network element.Can select according to the actual needs some or all of unit wherein to realize the purpose of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.
If described function usings that the form of SFU software functional unit realizes and during as production marketing independently or use, can be stored in a computer read/write memory medium.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words or the part of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) carry out all or part of step of the described method of each embodiment of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CDs.
To the above-mentioned explanation of the disclosed embodiments, make professional and technical personnel in the field can realize or use the present invention.Multiple modification to these embodiment will be apparent for those skilled in the art, and General Principle as defined herein can be in the situation that do not break away from the spirit or scope of the present invention, realization in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.
Claims (9)
1. the method for a serializing, is characterized in that, comprising:
After determining the data that data until serializing are nested customization type, according to the described data for the treatment of serializing, obtain corresponding nested agreement;
According to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, and, by described Property Name and property value encapsulation, generate corresponding the first key-value pair;
Obtain in the described data for the treatment of serializing by the Property Name of each nested data and property value corresponding to described Property Name, and described described Property Name and property value by nested data encapsulated, generate corresponding the second key-value pair;
According to the described nest relation for the treatment of the data of serializing, respectively described the first key-value pair and the second key-value pair are put into to the data of intermediate form;
The Data Serialization that will include the described intermediate form of described the first key-value pair and the second key-value pair.
2. method according to claim 1, is characterized in that, the method for described serializing also comprises:
Obtain the described data for the treatment of serializing, and, according to the described data type title for the treatment of the data of serializing, obtain the described Property Name for the treatment of the data of serializing, as the first attribute description information;
Travel through the described data for the treatment of serializing, and generate corresponding Property Name according to traversing result, as the second attribute description information;
Contrast described the first attribute description information whether identical with described the second attribute description information, if contain the attribute information do not had in described the first attribute description information in described the second attribute description information, the data that the described data for the treatment of serializing are nested customization type are described.
3. method according to claim 1, is characterized in that, described according to described nested agreement, obtains described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, comprising:
According to described nested agreement, obtain the described attribute list for the treatment of the data of serializing, wherein, described attribute list comprises all properties title in the described data for the treatment of serializing, and, according to described nested agreement, the corresponding relation of getattr title and property value;
According to described Property Name, and the corresponding relation of described Property Name and property value, described property value corresponding to Property Name for the treatment of the data of serializing obtained.
4. method according to claim 1, is characterized in that, described intermediate form is NSDictionary dictionary type.
5. the device of a serializing, is characterized in that, comprising:
Nested agreement acquisition module, for after determining the data that data until serializing are nested customization type, according to the described data for the treatment of serializing, obtain corresponding nested agreement;
The first key-value pair generation module, for according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, and, by described Property Name and property value encapsulation, generate corresponding the first key-value pair;
The second key-value pair generation module, describedly treat that the data of serializing are by the Property Name of nested data and property value corresponding to described Property Name for obtaining, and described described Property Name and property value by nested data encapsulated, generate corresponding the second key-value pair;
Placement module, for according to the described nest relation for the treatment of the data of serializing, put into described the first key-value pair and the second key-value pair respectively the data of intermediate form;
The serializing module, for the Data Serialization of the described intermediate form that will include described the first key-value pair and the second key-value pair.
6. device according to claim 5, is characterized in that, the device of described serializing also comprises:
The first acquisition module, for obtaining the described data for the treatment of serializing, and, according to the described data type title for the treatment of the data of serializing, obtain the described Property Name for the treatment of the data of serializing, as the first attribute description information;
The second acquisition module, for traveling through the described data for the treatment of serializing, and generate corresponding Property Name according to traversing result, as the second attribute description information;
Type judging module, whether identical with described the second attribute description information for contrasting described the first attribute description information, if contain the attribute information do not had in described the first attribute description information in described the second attribute description information, the data that the described data for the treatment of serializing are nested customization type are described.
7. device according to claim 5, it is characterized in that, described the first key-value pair generation module comprises property value acquiring unit and encapsulation unit, described property value acquiring unit is used for according to described nested agreement, obtain described Property Name and property value corresponding to described Property Name for the treatment of the data of serializing, described encapsulation unit, for by described Property Name and property value encapsulation, generates corresponding the first key-value pair, wherein, described property value acquiring unit comprises:
First obtains subelement, be used for according to described nested agreement, obtain the described attribute list for the treatment of the data of serializing, wherein, described attribute list comprises all properties title in the described data for the treatment of serializing, and, according to described nested agreement, the corresponding relation of getattr title and property value;
Second obtains subelement, for according to described Property Name, and the corresponding relation of described Property Name and property value, obtain described property value corresponding to Property Name for the treatment of the data of serializing.
8. device according to claim 5, is characterized in that, described intermediate form is NSDictionary dictionary type.
9. a processor, is characterized in that, on the chip of described processor, is integrated with as the device of claim 5 to the described serializing of claim 8 any one.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310390723.2A CN103425632B (en) | 2013-08-30 | 2013-08-30 | A kind of method of serializing, device and processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310390723.2A CN103425632B (en) | 2013-08-30 | 2013-08-30 | A kind of method of serializing, device and processor |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103425632A true CN103425632A (en) | 2013-12-04 |
CN103425632B CN103425632B (en) | 2016-08-10 |
Family
ID=49650397
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310390723.2A Expired - Fee Related CN103425632B (en) | 2013-08-30 | 2013-08-30 | A kind of method of serializing, device and processor |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103425632B (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104360865A (en) * | 2014-11-28 | 2015-02-18 | 中国建设银行股份有限公司 | Serialization method, deserialization method and related equipment |
CN104899316A (en) * | 2015-06-17 | 2015-09-09 | 北京奇虎科技有限公司 | Game data serialization and deserialization processing method and device |
CN104954443A (en) * | 2015-05-26 | 2015-09-30 | 上海摩软通讯技术有限公司 | Data transmission method and system in local area network |
CN106294385A (en) * | 2015-05-19 | 2017-01-04 | 阿里巴巴集团控股有限公司 | Data object serializing and the method and device of unserializing data object |
CN107066429A (en) * | 2017-03-31 | 2017-08-18 | 柳州译海网络科技有限公司 | The transmission method of transmission efficiency is improved between a kind of internet |
CN107577818A (en) * | 2017-09-30 | 2018-01-12 | 北京酷我科技有限公司 | A kind of method caused by database object placement model |
CN107741833A (en) * | 2017-10-30 | 2018-02-27 | 广东乐心医疗电子股份有限公司 | Storage method and device of nestable key-value |
CN109388371A (en) * | 2018-09-26 | 2019-02-26 | 中兴飞流信息科技有限公司 | A kind of sort method of data, system, association's processing unit and primary processing unit |
CN110753050A (en) * | 2019-10-22 | 2020-02-04 | 网易(杭州)网络有限公司 | Method and device for generating protocol document, computer storage medium and electronic equipment |
CN112783706A (en) * | 2021-01-22 | 2021-05-11 | 山东云海国创云计算装备产业创新中心有限公司 | Sequence generation method, system, equipment and computer readable storage medium |
CN115398856A (en) * | 2020-04-09 | 2022-11-25 | 国际商业机器公司 | Key attribute verification |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7093134B1 (en) * | 1997-05-29 | 2006-08-15 | Sun Microsystems, Inc. | Method and apparatus for signing and sealing objects |
CN103019689A (en) * | 2012-11-21 | 2013-04-03 | 上海富欣智能交通控制有限公司 | Universal object serialization realizing method |
-
2013
- 2013-08-30 CN CN201310390723.2A patent/CN103425632B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7093134B1 (en) * | 1997-05-29 | 2006-08-15 | Sun Microsystems, Inc. | Method and apparatus for signing and sealing objects |
CN103019689A (en) * | 2012-11-21 | 2013-04-03 | 上海富欣智能交通控制有限公司 | Universal object serialization realizing method |
Non-Patent Citations (1)
Title |
---|
HAOERO: "iOS中复杂实体类对象的json序列化", 《HTTP://WWW.COCOACHINA.COM/INDUSTRY/20121117/5112.HTML》 * |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104360865A (en) * | 2014-11-28 | 2015-02-18 | 中国建设银行股份有限公司 | Serialization method, deserialization method and related equipment |
CN104360865B (en) * | 2014-11-28 | 2018-05-18 | 中国建设银行股份有限公司 | A kind of sequencing method, unserializing method and relevant device |
CN106294385A (en) * | 2015-05-19 | 2017-01-04 | 阿里巴巴集团控股有限公司 | Data object serializing and the method and device of unserializing data object |
CN104954443B (en) * | 2015-05-26 | 2018-09-14 | 上海摩软通讯技术有限公司 | Data transmission method and system in LAN |
CN104954443A (en) * | 2015-05-26 | 2015-09-30 | 上海摩软通讯技术有限公司 | Data transmission method and system in local area network |
CN104899316A (en) * | 2015-06-17 | 2015-09-09 | 北京奇虎科技有限公司 | Game data serialization and deserialization processing method and device |
CN107066429A (en) * | 2017-03-31 | 2017-08-18 | 柳州译海网络科技有限公司 | The transmission method of transmission efficiency is improved between a kind of internet |
CN107577818A (en) * | 2017-09-30 | 2018-01-12 | 北京酷我科技有限公司 | A kind of method caused by database object placement model |
CN107741833A (en) * | 2017-10-30 | 2018-02-27 | 广东乐心医疗电子股份有限公司 | Storage method and device of nestable key-value |
CN109388371A (en) * | 2018-09-26 | 2019-02-26 | 中兴飞流信息科技有限公司 | A kind of sort method of data, system, association's processing unit and primary processing unit |
CN110753050A (en) * | 2019-10-22 | 2020-02-04 | 网易(杭州)网络有限公司 | Method and device for generating protocol document, computer storage medium and electronic equipment |
CN110753050B (en) * | 2019-10-22 | 2022-03-04 | 网易(杭州)网络有限公司 | Method and device for generating protocol document, computer storage medium and electronic equipment |
CN115398856A (en) * | 2020-04-09 | 2022-11-25 | 国际商业机器公司 | Key attribute verification |
CN115398856B (en) * | 2020-04-09 | 2024-08-30 | 国际商业机器公司 | Key attribute verification |
CN112783706A (en) * | 2021-01-22 | 2021-05-11 | 山东云海国创云计算装备产业创新中心有限公司 | Sequence generation method, system, equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN103425632B (en) | 2016-08-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103425632A (en) | Serializing method, device and processor | |
US9904694B2 (en) | NoSQL relational database (RDB) data movement | |
CN107885499A (en) | A kind of interface document generation method and terminal device | |
CN103617047A (en) | Method, device and processor for developing business processes | |
CN112905624B (en) | Database extension method and device of low-code development platform | |
CN107644286A (en) | Workflow processing method and device | |
WO2014145084A1 (en) | Methods for managing applications using semantic modeling and tagging and devices thereof | |
CN102129365A (en) | Method and device for generating code documentations | |
CN109558380B (en) | Method and system for processing engineering objects in an industrial automation environment | |
CN105512425A (en) | Method for constructing IO PAD layout based on graphical interface | |
CN108228754A (en) | flow generation method and terminal device | |
CN104461649A (en) | Chip compatible method and device | |
CN103902618A (en) | File search method and device | |
CN110765750A (en) | Report data entry method and terminal equipment | |
CN105808748A (en) | MIB (Management Information Base) version contrast method and device | |
CN113434542B (en) | Data relationship identification method and device, electronic equipment and storage medium | |
CN113407254B (en) | Form generation method and device, electronic equipment and storage medium | |
CN107766519B (en) | Method for visually configuring data structure | |
CN104217170A (en) | Document read-only method and device | |
CN104573132A (en) | Method and device for finding songs | |
CN105589918A (en) | Method and device for extracting page information | |
WO2020063181A1 (en) | Data processing method, device and apparatus | |
CN105426676A (en) | Drilling data processing method and system | |
Markin et al. | SAP Integrated Business Planning (SAP IBP) Functionality and Implementation (SAP PRESS) | |
CN105095225A (en) | Method and apparatus for obtaining file data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160810 |