CN105573970B - Data packet reconstruction method and device - Google Patents
Data packet reconstruction method and device Download PDFInfo
- Publication number
- CN105573970B CN105573970B CN201510955914.8A CN201510955914A CN105573970B CN 105573970 B CN105573970 B CN 105573970B CN 201510955914 A CN201510955914 A CN 201510955914A CN 105573970 B CN105573970 B CN 105573970B
- Authority
- CN
- China
- Prior art keywords
- data
- data packet
- packet
- editable
- xml
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/14—Tree-structured documents
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method and a device for reconstructing a data packet, wherein the method comprises the following steps: extracting the changed data representing the dynamic change from the source data packet; packaging the changed part data into an editable configuration file; generating an editable interface of the data package according to the editable configuration file, and adding user data and editing contents into the editable interface; and according to the data content in the editable interface, carrying out verification calculation on the data content in the original data packet, and outputting the data packet with the specified format. The method is not limited by an operating system and a hardware environment, can adapt to various software and hardware environments, and greatly improves the editing efficiency and accuracy of the configuration file.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for reconstructing a data packet.
Background
In recent years, people have increasingly conducted space exploration and exploration tasks, and have increasingly come to have wide applications in satellite navigation, positioning and communication. In order to support the smooth development of each task, a large number of upper-injection data packets need to be generated to implement on-orbit flight control on each spacecraft. At present, a data packet generation method which is researched more is software hard coding, namely, the format of a data packet is written into software in the form of program codes, and the method cannot be suitable for the requirement of continuous change of the format.
Generally, the format and field value of the data packet are specified by the application system and protocol used, and there are certain changes at different stages, and with the upgrade of the system and the change of the protocol, there will be corresponding changes, which requires a lot of software work, including: requirement arrangement, software development, compiling, testing, publishing and the like, and the complexity of software maintenance is greatly increased.
Disclosure of Invention
The embodiment of the invention provides a data packet reconstruction method and a data packet reconstruction device, which are used for solving the problem that the corresponding change is carried out along with the upgrading of a system and the change of a protocol in the prior art, which needs a large amount of software work.
The specific technical scheme is as follows:
a method of packet reconstruction, the method comprising:
extracting the changed data representing the dynamic change from the source data packet;
packaging the change part data into an editable configuration file;
generating an editable interface of the data package according to the editable configuration file, wherein user data and editing contents can be added to the editable interface;
and according to the data content in the editable interface, carrying out verification calculation on the data content in the original data packet, and outputting the data packet with the specified format.
Optionally, the data of the changed part is packaged into an editable configuration file, specifically:
and packaging the changed part data into an extensible markup language (XML) file, and using the XML file as the configuration file.
Optionally, according to the data content in the editable interface, performing check computation on the data content in the original data packet, and outputting a data packet with a specified format, including:
delaying the data packet format of the hard coded source data packet to a data packet generation stage;
decoupling the data packet format from the generator by the XML file;
and dynamically loading the source data packet through the XML file based on the decoupling result, and outputting the data packet with the specified format.
Optionally, dynamically loading the source packet through an XML file, and outputting a data packet with a specified format, where the method includes:
the data is described by setting the proportion in a tree form through an XML file, the relevant attribute of the corresponding data packet field is configured in each XML node, and the data packet with the relevant attribute and the specified format is output.
Optionally, configuring the relevant attributes of the corresponding data packet field in each XML node specifically includes:
and configuring corresponding field numbers, field names, occupied byte numbers, dependency relations and relevant attributes of field notes in each XML node.
A packet reconstruction device, comprising:
the extraction module is used for extracting the changed part data representing the dynamic change from the source data packet;
the configuration file generation module is used for packaging the change part data into an editable configuration file;
the interface generating module is used for generating an editable interface of the data package according to the editable configuration file, wherein user data and editing content can be added to the editable interface;
and the reconstruction module is used for carrying out verification calculation on the data content in the original data packet according to the data content in the editable interface and outputting the data packet with the specified format.
Optionally, the configuration file generating module is specifically configured to encapsulate the changed part of data into an XML file in an extensible markup language, and use the XML file as the configuration file.
Optionally, the reconstructing module is specifically configured to delay a packet format of the hard-coded source packet to a packet generating stage; decoupling the data packet format from the generator by the XML file; and dynamically loading the source data packet through the XML file based on the decoupling result, and outputting the data packet with the specified format.
Optionally, the reconstruction module is specifically configured to describe the data in a tree form by using an XML file to set a ratio, configure a relevant attribute of a corresponding data packet field in each XML node, and output a data packet in a specified format with the relevant attribute.
Optionally, the reconfiguration module is specifically configured to configure, in each XML node, a corresponding field number, a field name, a number of bytes occupied, a dependency relationship, and a relevant attribute of the field remark.
The embodiment of the invention provides a method for reconstructing a data packet, which comprises the following steps: extracting the changed data representing the dynamic change from the source data packet; packaging the changed part data into an editable configuration file; generating an editable interface of the data package according to the editable configuration file, and adding user data and editing contents into the editable interface; and according to the data content in the editable interface, carrying out verification calculation on the data content in the original data packet, and outputting the data packet with the specified format. The method is not limited by an operating system and a hardware environment, can adapt to various software and hardware environments, and greatly improves the editing efficiency and accuracy of the configuration file.
Drawings
FIG. 1 is a flow chart of a method for packet reconstruction according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a data packet reconstructing apparatus according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method for reconstructing a data packet, which comprises the following steps: extracting the changed data representing the dynamic change from the source data packet; packaging the changed part data into an editable configuration file; generating an editable interface of the data package according to the editable configuration file, and adding user data and editing contents into the editable interface; and according to the data content in the editable interface, carrying out verification calculation on the data content in the original data packet, and outputting the data packet with the specified format. The method is not limited by an operating system and a hardware environment, can adapt to various software and hardware environments, and greatly improves the editing efficiency and accuracy of the configuration file.
The technical solutions of the present invention are described in detail with reference to the drawings and the specific embodiments, and it should be understood that the embodiments and the specific technical features in the embodiments of the present invention are merely illustrative of the technical solutions of the present invention, and are not restrictive, and the embodiments and the specific technical features in the embodiments of the present invention may be combined with each other without conflict.
Fig. 1 is a flowchart of a data packet reconstruction method according to an embodiment of the present invention, where the method includes:
s101, extracting the changed data representing dynamic change from the source data packet;
s102, packaging the changed part data into an editable configuration file;
s103, generating an editable interface of the data packet according to the editable configuration file;
wherein, the editable interface can add user data and edit content;
and S104, according to the data content in the editable interface, carrying out verification calculation on the data content in the original data packet, and outputting the data packet with the specified format.
Specifically, in the embodiment of the present invention, after the source packet is received, in consideration of deletion of a field of the source packet and change of a length of the source packet, a changed portion of the source packet is extracted, so as to obtain a portion of data representing dynamic change, the changed portion of data is encapsulated into an XML file, and the XML file is used as a configuration file.
Delaying the data format of the hard-coded source data packet to a data packet generation stage, decoupling the data packet format and a generator through an XML file, dynamically loading the source data packet through the XML file based on a decoupling result, and outputting the data packet with a specified format.
Further, in the embodiment of the present invention, data is described in a tree form 1:1 by an XML file, a correlation attribute of a corresponding packet field is configured in each XML node, and a packet in a specified format having the correlation attribute is output.
Here, the relevant attributes configuring the corresponding packet field for each XML node are: configuring corresponding field numbers, field names, occupied byte numbers, dependency relations and relevant attributes of field notes in each XML node, wherein specific configuration codes are as follows:
each of the XML nodes may be configured with a corresponding correlation attribute in the manner described above. Since the method for managing data by using the XML file in the tree structure completely conforms to the field form of the data packet, the data can be managed in a way of 1: the form 1 accurately describes the data packet, and greatly improves the editing efficiency and accuracy of the configuration file.
Further, after the XML file is obtained, an editable interface of the data packet is generated according to the editable configuration file, and a user is allowed to fill or edit each field of the data packet in the editable interface, so that the generation of the data packet is not limited by an operating system and a hardware environment, and the data packet can be adapted to various software and hardware environments.
And finally, based on the content filled or edited in each field in the editable interface and the configuration file, verifying and calculating the data content in the source data packet so as to output the data packet with the specified format, thereby realizing that the data packet generation method meets the requirements of generating various types of data packets.
Generally speaking, in the embodiment of the present invention, source packet information is subjected to configurable processing, and a generated packet can be dynamically adjusted according to actual requirements without modifying a program based on a configuration file; the method for managing the data by the XML file in a tree structure completely accords with the field form of the data packet, and can be implemented by the following steps that 1: the form 1 accurately describes the data packet, and greatly improves the editing efficiency and accuracy of the configuration file.
Corresponding to a data packet reconstruction method in an embodiment of the present invention, an embodiment of the present invention further provides a data packet reconstruction device, and as shown in fig. 2, the data packet reconstruction device in the embodiment of the present invention is a schematic structural diagram, where the data packet reconstruction device includes:
a extraction module 201, configured to extract, from the source packet, a changed part of data representing a dynamic change;
a configuration file generation module 202, configured to encapsulate the change part data into an editable configuration file;
the interface generating module 203 is configured to generate an editable interface of the data package according to the editable configuration file, where user data and editing content can be added to the editable interface;
and the reconstruction module 204 is configured to perform check calculation on the data content in the original data packet according to the data content in the editable interface, and output the data packet with the specified format.
Further, in this embodiment of the present invention, the configuration file generating module 202 is specifically configured to encapsulate the changed part of data into an XML file, and use the XML file as the configuration file.
Further, in this embodiment of the present invention, the reconstructing module 204 is specifically configured to delay a packet format of a hard-coded source packet to a packet generating stage; decoupling the data packet format from the generator by the XML file; and dynamically loading the source data packet through the XML file based on the decoupling result, and outputting the data packet with the specified format.
Further, in this embodiment of the present invention, the reconstructing module 204 is specifically configured to describe the data by setting a ratio in a tree form through an XML file, configure a relevant attribute of a corresponding data packet field in each XML node, and output a data packet in a specified format with the relevant attribute.
Further, in this embodiment of the present invention, the reconstructing module 204 is specifically configured to configure, in each XML node, a corresponding field number, a field name, a number of bytes occupied, a dependency relationship, and a relevant attribute of a field remark.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (10)
1. A method for packet reconstruction, the method comprising:
extracting the changed data representing the dynamic change from the source data packet;
packaging the change part data into an editable configuration file;
generating an editable interface of the data package according to the editable configuration file, wherein user data and editing contents can be added to the editable interface;
and according to the data content in the editable interface, carrying out verification calculation on the data content in the source data packet, and outputting the data packet with the specified format.
2. The method of claim 1, wherein the variant portion data is packaged as an editable configuration file, in particular:
and packaging the changed part data into an extensible markup language (XML) file, and using the XML file as the configuration file.
3. The method of claim 2, wherein performing a check calculation on the data content in the source packet according to the data content in the editable interface and outputting the packet with the specified format comprises:
delaying the data packet format of the hard coded source data packet to a data packet generation stage;
decoupling the data packet format from the generator by the XML file;
and dynamically loading the source data packet through the XML file based on the decoupling result, and outputting the data packet with the specified format.
4. The method of claim 3, wherein dynamically loading the source packets through an XML file and outputting the packets with a specified format comprises:
the data is described by setting the proportion in a tree form through an XML file, the relevant attribute of the corresponding data packet field is configured in each XML node, and the data packet with the relevant attribute and the specified format is output.
5. The method according to claim 4, wherein the relevant attributes of the corresponding packet field are configured in each XML node, specifically:
and configuring corresponding field numbers, field names, occupied byte numbers, dependency relations and relevant attributes of field notes in each XML node.
6. A packet reconstruction device, comprising:
the extraction module is used for extracting the changed part data representing the dynamic change from the source data packet;
the configuration file generation module is used for packaging the change part data into an editable configuration file;
the interface generation module is used for generating an editable interface of the data package according to the editable configuration file, wherein user data and editing content can be added to the editable interface;
and the reconstruction module is used for carrying out check calculation on the data content in the source data packet according to the data content in the editable interface and outputting the data packet with the specified format.
7. The apparatus of claim 6, wherein the configuration file generation module is specifically configured to encapsulate the variant portion data into an extensible markup language (XML) file, and to use the XML file as the configuration file.
8. The apparatus of claim 7, wherein the reconstruction module is specifically configured to delay a packet format of the hard-coded source packet to a packet generation stage; decoupling the data packet format from the generator by the XML file; and dynamically loading the source data packet through the XML file based on the decoupling result, and outputting the data packet with the specified format.
9. The apparatus according to claim 8, wherein the reconstruction module is specifically configured to describe the data in a tree format by setting a scale through an XML file, configure a correlation attribute of a corresponding packet field in each XML node, and output a packet in a specified format having the correlation attribute.
10. The apparatus according to claim 9, wherein the reconfiguration module is specifically configured to configure, in each XML node, the corresponding field number, the field name, the number of bytes occupied, the dependency relationship, and the relevant attributes of the field remark.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510955914.8A CN105573970B (en) | 2015-12-18 | 2015-12-18 | Data packet reconstruction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510955914.8A CN105573970B (en) | 2015-12-18 | 2015-12-18 | Data packet reconstruction method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105573970A CN105573970A (en) | 2016-05-11 |
CN105573970B true CN105573970B (en) | 2020-03-17 |
Family
ID=55884122
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510955914.8A Active CN105573970B (en) | 2015-12-18 | 2015-12-18 | Data packet reconstruction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105573970B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109521984B (en) * | 2017-09-20 | 2021-12-10 | 南京南瑞继保电气有限公司 | Liquid crystal panel custom icon display method based on embedded system |
CN111949613A (en) * | 2020-08-11 | 2020-11-17 | 深圳市前海手绘科技文化有限公司 | Method for editing and saving JSON configuration file |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101415026A (en) * | 2008-11-28 | 2009-04-22 | 闻泰集团有限公司 | Method for analyzing XML formatted data of dynamic content distribution client terminal |
CN102567514A (en) * | 2011-12-27 | 2012-07-11 | 广州从兴电子开发有限公司 | Data processing method and system |
CN103139234A (en) * | 2011-11-23 | 2013-06-05 | 中国移动通信集团公司 | Device and method for encapsulating data service |
CN104079573A (en) * | 2009-05-19 | 2014-10-01 | 安全第一公司 | Systems and methods for securing data in the cloud |
CN104731586A (en) * | 2015-03-11 | 2015-06-24 | 大连理工大学 | Method for designing editable interface of LCD screen of subway train |
CN105095216A (en) * | 2014-04-22 | 2015-11-25 | 深圳市志友企业发展促进中心 | Data assembling method and device and resource communication system |
-
2015
- 2015-12-18 CN CN201510955914.8A patent/CN105573970B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101415026A (en) * | 2008-11-28 | 2009-04-22 | 闻泰集团有限公司 | Method for analyzing XML formatted data of dynamic content distribution client terminal |
CN104079573A (en) * | 2009-05-19 | 2014-10-01 | 安全第一公司 | Systems and methods for securing data in the cloud |
CN103139234A (en) * | 2011-11-23 | 2013-06-05 | 中国移动通信集团公司 | Device and method for encapsulating data service |
CN102567514A (en) * | 2011-12-27 | 2012-07-11 | 广州从兴电子开发有限公司 | Data processing method and system |
CN105095216A (en) * | 2014-04-22 | 2015-11-25 | 深圳市志友企业发展促进中心 | Data assembling method and device and resource communication system |
CN104731586A (en) * | 2015-03-11 | 2015-06-24 | 大连理工大学 | Method for designing editable interface of LCD screen of subway train |
Also Published As
Publication number | Publication date |
---|---|
CN105573970A (en) | 2016-05-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108279932B (en) | Method and device for dynamically configuring user interface of mobile terminal | |
US8689177B2 (en) | Integration environment generator | |
AU2011258098B2 (en) | Schema contracts for data integration | |
CN111290778B (en) | AI model packaging method, platform and electronic equipment | |
CN110187902B (en) | Project transformation method, device, equipment and storage medium based on spring boot | |
US8756407B2 (en) | Configuration rule prototyping tool | |
CN104020994B (en) | Stream process definition device and stream process based on streaming system define method | |
CN102141991A (en) | Method and system for web server | |
CN105743680A (en) | Cluster disposition method and disposition device | |
CN111367818A (en) | System component testing method and device based on dynamic data return | |
CN111880777A (en) | Program information issuing method and device and electronic equipment | |
CN105573970B (en) | Data packet reconstruction method and device | |
CN101196812A (en) | Method for script language calling multiple output parameter interface by component software system | |
CN112052011A (en) | Method and device for combining small programs, electronic equipment and medium | |
CN106897052A (en) | APK file compression method and device | |
CN109388406A (en) | Convert method and device, the storage medium, electronic device of java code | |
CN104461557B (en) | The processing method and processing device of Puppet configuration datas | |
US20080320401A1 (en) | Template-based deployment of user interface objects | |
CN104539697B (en) | A kind of client, server and the method for making Android mobile application | |
CN106446024B (en) | Method and device for automatically generating data model | |
CN111008346A (en) | Data acquisition method and device | |
CN111221787A (en) | File processing method and device | |
CN110543308A (en) | Method and system for establishing mobile terminal modular user interface database | |
CN113821271B (en) | Connector expansion method and system of business application integration platform | |
CN112947938B (en) | File conversion method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |