CN102571282A - Unit and method for processing network data packet - Google Patents

Unit and method for processing network data packet Download PDF

Info

Publication number
CN102571282A
CN102571282A CN2012100129564A CN201210012956A CN102571282A CN 102571282 A CN102571282 A CN 102571282A CN 2012100129564 A CN2012100129564 A CN 2012100129564A CN 201210012956 A CN201210012956 A CN 201210012956A CN 102571282 A CN102571282 A CN 102571282A
Authority
CN
China
Prior art keywords
data
mentioned
customized label
data type
added
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
CN2012100129564A
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.)
Aerospace Science and Industry Shenzhen Group Co Ltd
Original Assignee
Aerospace Science and Industry Shenzhen Group 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 Aerospace Science and Industry Shenzhen Group Co Ltd filed Critical Aerospace Science and Industry Shenzhen Group Co Ltd
Priority to CN2012100129564A priority Critical patent/CN102571282A/en
Publication of CN102571282A publication Critical patent/CN102571282A/en
Pending legal-status Critical Current

Links

Images

Abstract

The invention discloses a unit and a method for processing a network data packet. The method comprises the following steps of: adding custom tags into data types of network data to be encoded, and adding the custom tag into each data field in the added data types; combining the data types into a first set, and enumerating the data types carrying the custom tags in the first set; retrieving the data types carrying the custom tags one by one; combining the data fields in the retrieved data types into a second set, and enumerating the data fields carrying the custom tags in the second set; encoding the data fields carrying the custom tags; and adding the encoded data fields into an encoding result. By adoption of the scheme, unified encoding can be realized, so after the data types or the data fields are added or corrected, data codes are not required to be re-corrected by an enterprise, encoding work load is reduced, the flexibility and expandability of a network data processing program are improved, and the encoding cost of the enterprise is saved.

Description

A kind of network data package processor and method thereof
Technical field
The present invention relates to field of data transmission, relate in particular to a kind of network data package processor and method thereof.
Background technology
Along with the Internet, mobile Internet popularizing in the world particularly, daily life more and more depends on the Internet with work, meanwhile, the processing demands of network data is also improved day by day.
At present, the package of network data is handled normally with data object segment encoding and decoding, added that then object identifier passes through Network Transmission.For example, it is following that the user logins the cataloged procedure of definition of type:
Public class LoginRequestEntity // user logins type
{
Public int UserID { get; Set; } // ID
Public string UserName { get; Set; } // user's name
Public string Password { get; Set; } // user cipher
}
The coding function prototype of supposing type field is Encode (fieldName), and result is a coding result, and it is following that then the user logins the coding result of object:
result?=?Encode(UserID)?+?Encode(UserName)?+?Encode(Password)
In above-mentioned instance,, all want manual modification or adjust the digital coding code if the user need or increase data field newly with the minimizing of LoginRequestEntity type.For example, need newly-increased CreateDate data field, the cataloged procedure of then above-mentioned dtd then need be revised as:
Public class LoginRequestEntity // user logins type
{
Public int UserID { get; Set; } // ID
Public string UserName { get; Set; } // user's name
Public string Password { get; Set; } // user cipher
Public string CreateDate { get; Set; } // user date created
}
result?=?Encode(UserID)?+?Encode(UserName)?+?Encode(Password)?+?Encode(CreateDate)
If the minimizing user id field, then the cataloged procedure of dtd then need be revised as:
Public class LoginRequestEntity // user logins type
{
Public string UserName { get; Set; } // user's name
Public string Password { get; Set; } // user cipher
}
result?=?Encode(UserName)?+?Encode(Password)
In sum, the encoding scheme of prior art is very numerous and diverse, and; In the business procedure of reality, data type often reaches hundreds and thousands of kinds, and the field of every kind of data type also reaches tens up to a hundred; If adopt above-mentioned encoding scheme, then digital coding work is heavy and redundant.
Summary of the invention
The technical problem that the present invention will solve is; To the numerous and diverse defective of prior art digital coding; A kind of network data package processor and method thereof are provided; This technical scheme has reduced the digital coding workload, has strengthened the flexibility and the extensibility of network data processing program, for enterprise has practiced thrift the digital coding cost.
The technical solution adopted for the present invention to solve the technical problems is: construct a kind of network data method for processing packet, said method comprising the steps of:
S1. the data type of treating in the coding network data is added customized label, and each data field in the data type after the above-mentioned interpolation is added customized label;
S2. above-mentioned data type is formed first set, and enumerate the data type of carrying customized label in above-mentioned first set;
S3. retrieve the data type of carrying customized label in the network data to be encoded one by one;
S4. the data field in the data type after the above-mentioned retrieval is formed second set, and enumerate the data field that carries customized label in above-mentioned second set;
S5. the above-mentioned data field that carries customized label is encoded one by one;
S6. the data field behind the above-mentioned coding is added into coding result.
In method of the present invention, said customized label is a metadata tag.
The present invention also constructs a kind of network data package processor, and it comprises:
At least one first collector, the data type of treating in the coding network data is added customized label, and each data field in the data type after the above-mentioned interpolation is added customized label; And above-mentioned data type is formed first gather, and enumerate the data type of carrying customized label in above-mentioned first set;
At least one searcher is retrieved the data type of carrying customized label in the network data to be encoded one by one;
At least one encoder is encoded to the data field that carries customized label in the said data type after the above-mentioned retrieval one by one;
At least one second collector is formed second set with the data field in the data type after the above-mentioned retrieval, and enumerates the data field that carries customized label in above-mentioned second set; And
At least one adder is added into coding result with the data field after the above-mentioned encoder encodes.
In network data package processor of the present invention, said customized label is a metadata tag.
The technical scheme of embodiment of the present invention; Have following beneficial effect: the data type through treating in the coding network data is added customized label; And,, can make enterprise after increasing newly or having revised data type or data field to realize Unified coding to each data field interpolation customized label in the data type after the above-mentioned interpolation; Need not to remodify the digital coding code; Thereby reduced the digital coding workload, strengthened the flexibility and the extensibility of network data processing program, for enterprise has practiced thrift the digital coding cost.
Description of drawings
To combine accompanying drawing and embodiment that the present invention is described further below, in the accompanying drawing:
Fig. 1 is the flow chart of network data method for processing packet of the present invention;
Fig. 2 is the structural representation of network data package processor of the present invention.
Embodiment
In order to make the object of the invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with accompanying drawing and embodiment.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
See also Fig. 1, Fig. 1 is the flow chart of network data method for processing packet embodiment two of the present invention, and is as shown in Figure 1, said method comprising the steps of:
In step S1, the data type of treating in the coding network data is added customized label, and each data field in the data type after the above-mentioned interpolation is added customized label; Should be noted that customized label can set up on their own according to user's demand, in the present embodiment, customized label is set, is in order to play the sign effect, and those skilled in the art should understand, and repeats no more here.
In step S2, above-mentioned data type is formed first set, and enumerate the data type of carrying customized label in above-mentioned first set.
In step S3, retrieve the data type of carrying customized label in the network data to be encoded one by one.
In step S4, the data field in the data type after the above-mentioned retrieval is formed second set, and enumerate the data field that carries customized label in above-mentioned second set.
In step S5, the above-mentioned data field that carries customized label is encoded one by one.
In step S6, the data field behind the above-mentioned coding is added into coding result.
In the present embodiment, said customized label is a metadata tag.
Be example with LoginRequestEntity data type of the prior art below, after the technical scheme of embodiment of the present invention, the cataloged procedure of this dtd is following:
[PacketEntity]
public?class?LoginRequestEntity
{
[EntityMember]
public?int?UserID?{?get;?set;?}
[EntityMember]
public?string?UserName?{?get;?set;?}
[EntityMember]
public?string?Password?{?get;?set;?}
}
Wherein, above-mentioned [PacketEntity] is the data type metadata label, and [EntityMember] is the data field metadata tag.The set of tentation data type is dict, and the data field set that this data type comprised that is to say for fields; First set is dict; Second set is fields, when coding, enumerates set dict; Retrieval comprises the data type of [PacketEntity] label one by one, and the data field that comprises [EntityMember] label in the data type after will retrieving is again encoded one by one.
Following for realizing the false code of this technical scheme:
Foreach (c in dict) // enumerated data type set
{
Whether if (c contais [PacketEntity]) // data type the containing type label
{
Foreach (f in fields) // the enumerate data field of the type
{
Whether if (f contais [EntityMember]) // data field comprises field label
{
Result +=Encode (f); // field is encoded one by one
}
}
}
}
See also Fig. 2, Fig. 2 is the structural representation of network data package processor of the present invention, and as shown in Figure 2, it comprises:
At least one first collector 1, the data type of treating in the coding network data is added customized label, and each data field in the data type after the above-mentioned interpolation is added customized label; And above-mentioned data type is formed first gather, and enumerate the data type of carrying customized label in above-mentioned first set;
At least one searcher 2 is retrieved the data type of carrying customized label in the network data to be encoded one by one;
At least one second collector 3 is formed second set with the data field in the data type after the above-mentioned retrieval, and enumerates the data field that carries customized label in above-mentioned second set.
At least one encoder 4 is encoded to the data field that carries customized label in the said data type after the above-mentioned retrieval one by one; And
At least one adder 5 is added into coding result with the data field behind above-mentioned encoder 4 codings.
Compared to prior art; Data type through treating in the coding network data is added customized label; And,, can make enterprise after increasing newly or having revised data type or data field to realize Unified coding to each data field interpolation customized label in the data type after the above-mentioned interpolation; Need not to remodify the digital coding code; Thereby reduced the digital coding workload, strengthened the flexibility and the extensibility of network data processing program, for enterprise has practiced thrift the digital coding cost.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within the claim scope of the present invention.

Claims (4)

1. a network data method for processing packet is characterized in that, said method comprising the steps of:
S1. the data type of treating in the coding network data is added customized label, and each data field in the data type after the above-mentioned interpolation is added customized label;
S2. above-mentioned data type is formed first set, and enumerate the data type of carrying customized label in above-mentioned first set;
S3. retrieve the data type of carrying customized label in the network data to be encoded one by one;
S4. the data field in the data type after the above-mentioned retrieval is formed second set, and enumerate the data field that carries customized label in above-mentioned second set;
S5. the above-mentioned data field that carries customized label is encoded one by one;
S6. the data field behind the above-mentioned coding is added into coding result.
2. method according to claim 1 is characterized in that, said customized label is a metadata tag.
3. network data package processor is characterized in that it comprises:
At least one first collector, the data type of treating in the coding network data is added customized label, and each data field in the data type after the above-mentioned interpolation is added customized label; And above-mentioned data type is formed first gather, and enumerate the data type of carrying customized label in above-mentioned first set;
At least one searcher is retrieved the data type of carrying customized label in the network data to be encoded one by one;
At least one encoder is encoded to the data field that carries customized label in the said data type after the above-mentioned retrieval one by one;
At least one second collector is formed second set with the data field in the data type after the above-mentioned retrieval, and enumerates the data field that carries customized label in above-mentioned second set; And
At least one adder is added into coding result with the data field after the above-mentioned encoder encodes.
4. network data package processor according to claim 3 is characterized in that said customized label is a metadata tag.
CN2012100129564A 2012-01-17 2012-01-17 Unit and method for processing network data packet Pending CN102571282A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012100129564A CN102571282A (en) 2012-01-17 2012-01-17 Unit and method for processing network data packet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012100129564A CN102571282A (en) 2012-01-17 2012-01-17 Unit and method for processing network data packet

Publications (1)

Publication Number Publication Date
CN102571282A true CN102571282A (en) 2012-07-11

Family

ID=46415831

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012100129564A Pending CN102571282A (en) 2012-01-17 2012-01-17 Unit and method for processing network data packet

Country Status (1)

Country Link
CN (1) CN102571282A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104917732A (en) * 2014-03-13 2015-09-16 深圳市赛格导航科技股份有限公司 Method of binding encoders and decoders with multiple clients and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1595929A (en) * 2003-09-08 2005-03-16 大唐移动通信设备有限公司 A method for coding-decoding communication system message
CN101006454A (en) * 2004-05-18 2007-07-25 西尔弗布鲁克研究有限公司 Authentication of an object using a signature encoded in a number of data portions
CN101789013A (en) * 2010-02-04 2010-07-28 浪潮集团山东通用软件有限公司 Enhancement-type CSV file format used for describing relational data

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1595929A (en) * 2003-09-08 2005-03-16 大唐移动通信设备有限公司 A method for coding-decoding communication system message
CN101006454A (en) * 2004-05-18 2007-07-25 西尔弗布鲁克研究有限公司 Authentication of an object using a signature encoded in a number of data portions
CN101789013A (en) * 2010-02-04 2010-07-28 浪潮集团山东通用软件有限公司 Enhancement-type CSV file format used for describing relational data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104917732A (en) * 2014-03-13 2015-09-16 深圳市赛格导航科技股份有限公司 Method of binding encoders and decoders with multiple clients and system
CN104917732B (en) * 2014-03-13 2018-07-20 深圳市赛格导航科技股份有限公司 A kind of multi-client binds the method and system of encoder and decoder

Similar Documents

Publication Publication Date Title
CN102833258B (en) Network address access method and system
CN103582883A (en) Improved encoding and decoding of variable-length data with group formats
CN105701145A (en) Fast serialization for data transfer
Oh et al. A study on authentication system using QR code for mobile cloud computing environment
CN104408100B (en) The compression method of structured web site daily record
CN102999480B (en) The method and system of Edit Document
CN103778228A (en) Method for realizing directional promotion of resume information by utilizing instant messaging system
CN103634391A (en) Method and system for realizing conversation sharing
CN104486357A (en) Method for achieving role-based access control (RBAC) based on SSH website
CN1577329A (en) Method and apparatus for late-binding/dynamic pathname resolution
CN105450589A (en) Remote procedure call method and system
CN102571282A (en) Unit and method for processing network data packet
CN100533374C (en) System and method for re-binding component assemblies in component based user applications
CN103902951B (en) Electronic tag and the converting system and method for Logistic Unit bar code
US20080270624A1 (en) Normalization of binary data
CN116821136A (en) Method, system and storage medium for encoding compressed menu permission
CN102387139B (en) Authority control method, system and device separated from application services
CN102185612A (en) Run-length coding and decoding methods and devices
CN106815238B (en) Serialization and deserialization method and device for structured data
CN103488715A (en) Pre-resolution management method and system based on global configuration
CN110866002A (en) Method and device for processing sub-table data
KR102027546B1 (en) Minimum bandwidth recovery encoding method based on clustered dispersion storage system in server communicating with a plurality of clusteres comprising a plurality of nodes amd server communicating with the plurality of clusters comprising the plurliaty of the nodes for the minimum bandwidth recovery encoding based on the clustered dispersion storage system
CN103379457A (en) Character encoding and decoding system and method
Feng et al. A value-added business performance management system with adaptive ubiquitous technologies
TW201345165A (en) System and method for encoding and decoding information

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20120711