CN108829930B - Lightweight method for designing MBD model by three-dimensional digital process - Google Patents

Lightweight method for designing MBD model by three-dimensional digital process Download PDF

Info

Publication number
CN108829930B
CN108829930B CN201810444327.6A CN201810444327A CN108829930B CN 108829930 B CN108829930 B CN 108829930B CN 201810444327 A CN201810444327 A CN 201810444327A CN 108829930 B CN108829930 B CN 108829930B
Authority
CN
China
Prior art keywords
coding
huffman
algorithm
dimensional digital
characters
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
Application number
CN201810444327.6A
Other languages
Chinese (zh)
Other versions
CN108829930A (en
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.)
Guangdong Institute of Intelligent Manufacturing
Original Assignee
Guangdong Institute of Intelligent Manufacturing
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 Guangdong Institute of Intelligent Manufacturing filed Critical Guangdong Institute of Intelligent Manufacturing
Priority to CN201810444327.6A priority Critical patent/CN108829930B/en
Publication of CN108829930A publication Critical patent/CN108829930A/en
Application granted granted Critical
Publication of CN108829930B publication Critical patent/CN108829930B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a lightweight method for designing an MBD model by a three-dimensional digital process, which adopts a greedy algorithm-Huffman compression algorithm for combined optimization, and mainly adopts the following ideas: the method comprises the following steps of applying the existing Huffman compression algorithm to carry out lightweight processing on the three-dimensional digital process design MBD model: a greedy algorithm is added on the basis that a Haffman compression algorithm is adopted to carry out lightweight processing on an MBD model designed based on a three-dimensional digital process, and a combined algorithm of the greedy algorithm and the Haffman compression algorithm is formed to carry out lightweight processing on the MBD model. The compression running speed of the greedy algorithm-Huffman compression algorithm is much higher than that of the Huffman compression algorithm, and the compression and decompression running speed of the greedy-Huffman compression algorithm is 30-50 times that of the Huffman compression algorithm.

Description

Lightweight method for designing MBD model by three-dimensional digital process
Technical Field
The invention relates to the technical field of three-dimensional digital process design, in particular to a lightweight method for designing an MBD model by a three-dimensional digital process.
Background
In the "industrial 4.0" era to be realized and the future AI era, the application of the digital design and manufacturing technology revolutionized the traditional design and manufacturing process, which is the development direction of the advanced manufacturing technology at present. The product design and manufacture mode is fundamentally changed, and the original two-dimensional drawing is taken as a main information carrier, and a product definition technology of a three-dimensional model is taken as an auxiliary technology, and is replaced by a brand-new product definition technology MBD (model Based definition) which takes a three-dimensional entity model as a unique data source.
In the aspect of three-dimensional digital process design, compared with the traditional mode taking a product two-dimensional drawing as a core, the information transmission, process design and manufacturing mode taking a three-dimensional model as a core in the three-dimensional design and manufacturing technology has many technical advantages, but the technology and the management are greatly different.
The existing three-dimensional digital process design MBD model is complex, a product three-dimensional model with PMI (product Manufacturing information) becomes a standard in the design, process and production stages, the sizes of some complex three-dimensional model files are hundreds of MB or even a few GB at all times, the models are more and more difficult to display, browse and use, and the computer terminal configuration is required to be higher and higher, but the problems cannot be fundamentally solved, the working efficiency is influenced, and the cost is consumed.
Disclosure of Invention
In view of the above, in order to solve the above problems in the prior art, the invention provides a lightweight method for designing an MBD model by a three-dimensional digitization process, which performs combination optimization by using a greedy algorithm-huffman compression algorithm, thereby improving the compression operation speed.
The invention solves the problems through the following technical means:
a lightweight method for designing an MBD model by a three-dimensional digital process comprises the following steps:
s1, calculating the frequency of each character in the source character string of the three-dimensional digital process design MBD model data;
s2, arranging the characters according to the sequence of the appearance frequency from low to high;
s3, constructing a Huffman tree by using the thought of a greedy algorithm, ensuring that characters with low frequency appear at the lowest part of the tree, and using the longest code;
s4, encoding from top to bottom by using the constructed Huffman tree:
according to the provisions of the coding, provision is made for: coding the left sub-tree into '0' and coding the right sub-tree into '1', realizing variable length coding, saving the memory occupied by characters, namely coding according to all the characters of the transmitted character string, coding from top to bottom of the Huffman tree, and storing the coded characters in a defined coding array table;
s5, outputting Huffman codes corresponding to the source characters in sequence, namely, coding and outputting a source character string of the MBD model data of the three-dimensional digital process design: judging whether the source character is equal to each character stored in the character table, if so, outputting a code array corresponding to the character, sequentially circulating until the end of the source character, and outputting a code, namely a code of a greedy-huffman compression algorithm;
and S6, decoding by using the codes after Huffman compression, and decoding to obtain a source character string of the three-dimensional digital process design MBD model data.
Further, the method also comprises the following steps:
s7, calculating the running time and compression ratio for encoding and decoding the three-dimensional digital process design MBD model data by the whole greedy algorithm-Huffman compression algorithm.
Further, the specific steps of S3 are as follows:
constructing a Huffman tree from bottom to top:
taking two characters with the lowest frequency from the n characters in the character string, creating a node tmp1 and a binary tree with two child nodes, and deleting the two nodes from the linked list; selecting two characters with the lowest frequency from the rest linked lists, creating a node tmp2 with two child nodes, and deleting the two nodes from the linked lists; if the weight value of tmp1 is greater than the weight value of tmp2, exchanging two binary trees of tmp1 and tmp2, and arranging according to the ascending order of the weight; and then inserting a node hTMp, comparing the size of the node with the parent node first, if the weight of the first is greater than that of the hTMp, merging the nodes into a tree for n-1 times, and if the weight of the parent node is equal to the weight of the left child node plus the weight of the right child node, constructing the Huffman tree.
Further, the specific steps of S6 are as follows:
the decoding of the algorithm is analyzed according to the encoding of the characters, and the specific method is as follows: if the obtained coding array is matched with the coding array in the stored coding array table of each character, outputting the corresponding character, namely decoding the greedy-Huffman compression algorithm.
Further, the specific steps of S7 are as follows:
and c # language programming is adopted, and the running time of the function of the monitoring program is monitored by using the Stopwatch () function in the c # language programming.
Compared with the prior art, the invention has the beneficial effects that at least:
by comparing the greedy algorithm-huffman compression algorithm with the huffman compression algorithm, the following conclusions are reached: the greedy algorithm-Huffman compression algorithm has a good effect of carrying out light weight on derived data of the three-dimensional digital process design MBD model, and the specific expression is as follows: for the same size data string, the compression ratio of the two algorithms is the same, but the huffman compression algorithm runs at the speed of: 87788.928, and the greedy algorithm-huffman compression algorithm operates at the speed: 1937.643, it follows that: the compression running speed of the greedy algorithm-Huffman compression algorithm is much higher than that of the Huffman compression algorithm, and the compression and decompression running speeds of the greedy algorithm-Huffman compression algorithm are 30-50 times of that of the Huffman compression algorithm.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a diagram of the results of a three-dimensional digital process design MBD model lightweight process by the existing Huffman compression algorithm;
FIG. 2 is a flow chart of a method of the invention for weight reduction of a three-dimensional digitized process design MBD model;
FIG. 3 is a flow diagram of the principle of the greedy algorithm for constructing a Huffman tree according to the present invention.
FIG. 4 is a result diagram of the lightweight processing of the three-dimensional digital process design MBD model by adopting greedy algorithm-Huffman compression algorithm combination optimization.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, embodiments accompanying figures are described in detail below. It should be noted that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments, and all other embodiments obtained by those skilled in the art without any inventive work based on the embodiments of the present invention belong to the protection scope of the present invention.
The main ideas of the lightweight method for designing the MBD model by the three-dimensional digital process are as follows:
1. the method comprises the following steps of applying the existing Huffman compression algorithm to carry out lightweight processing on the three-dimensional digital process design MBD model:
the compression running speed, the byte number of the source character string and the byte number of the compressed character are shown in figure 1;
2. a greedy algorithm is added on the basis that a Haffman compression algorithm is adopted to carry out lightweight processing on an MBD model designed based on a three-dimensional digital process, and a combined algorithm of the greedy algorithm and the Haffman compression algorithm is formed to carry out lightweight processing on the MBD model.
As shown in fig. 2, the invention is a flow chart of carrying out lightweight processing on a three-dimensional digital process design MBD model by using greedy algorithm-huffman compression algorithm combination optimization, and the specific implementation steps are as follows:
s1, calculating the frequency of each character in the source character string of the three-dimensional digital process design MBD model data;
s2, arranging the characters according to the sequence of the appearance frequency from low to high;
s3, constructing a huffman tree by using the idea of greedy algorithm, as shown in the flowchart of fig. 3, so that the character with low frequency is guaranteed to be at the bottom of the tree, and the longest code is used, thus the code of the character with high frequency is not affected, and the huffman tree is constructed from bottom to top:
taking two characters with the lowest frequency, creating a node (tmp1) and a binary tree with two child nodes, and deleting the two nodes from the linked list; selecting two characters with the lowest frequency from the rest linked lists, creating a node (tmp2) with two child nodes, and deleting the two nodes from the linked lists; if the weight of tmp1 is larger than the weight of tmp2, exchanging two binary trees of tmp1 and tmp2, and arranging according to the ascending order of the weights; and then inserting a node (hTMp), comparing the size of the node with that of a parent node (first), if the weight of the first is greater than that of the hTMp, combining the node and the parent node into a tree for n-1 times, and constructing the Huffman tree by the weight of the parent node being the weight of the left child node plus the weight of the right child node.
S4, encoding from top to bottom by using the constructed Huffman tree:
according to the provisions of the coding, provision is made for: the left sub-tree coding is coded into '0' and the right sub-tree coding is coded into '1', so that the variable length coding is realized, the memory occupied by characters is saved, namely, the coding is carried out according to all the characters of the transmitted character string, the coding is carried out from top to bottom of a Huffman tree, and the coding is stored in a defined coding array table after being coded.
S5, outputting Huffman codes corresponding to the source characters in sequence, namely, coding and outputting a source character string of the three-dimensional digital process design MBD model data: and judging whether the source character is equal to each character stored in the character table, if so, outputting the code array corresponding to the character, sequentially circulating until the end of the source character, and outputting the code, namely the code of the greedy-Huffman compression algorithm.
S6, decoding by using the codes after Huffman compression, and decoding to obtain a source character string of the three-dimensional digital process design MBD model data:
the decoding of the algorithm is analyzed according to the encoding of the characters, and the specific method is as follows: if the obtained coding array is matched with the coding array in the stored coding array table of each character, outputting the corresponding character, namely decoding the greedy-Huffman compression algorithm.
S7, calculating the running time and compression ratio for encoding and decoding the three-dimensional digital process design MBD model data by the whole greedy algorithm-Huffman compression algorithm:
and programming by adopting c # language, and monitoring the running time of the program realization function by utilizing the Stopwatch () function in the program.
The compression running speed, the number of bytes of the source character string, the number of bytes of the compressed character of the greedy algorithm-huffman compression algorithm, and the result is shown in fig. 4.
The following conclusion is obtained by comparing a greedy algorithm-Huffman compression algorithm with a Huffman compression algorithm: the greedy algorithm-Huffman compression algorithm has a good effect of carrying out light weight on derived data of the three-dimensional digital process design MBD model, and the specific expression is as follows: for the same size data string, the compression ratio of the two algorithms is the same, but the huffman compression algorithm runs at the speed of: 87788.928, and the greedy algorithm-huffman compression algorithm runs at a speed of: 1937.643, it follows that: the compression running speed of the greedy algorithm-Huffman compression algorithm is much higher than that of the Huffman compression algorithm, and the compression and decompression running speeds of the greedy algorithm-Huffman compression algorithm are 30-50 times of that of the Huffman compression algorithm.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (4)

1. A lightweight method for designing an MBD model by a three-dimensional digital process is characterized by comprising the following steps:
s1, calculating the frequency of each character in the source character string of the three-dimensional digital process design MBD model data;
s2, arranging the characters according to the sequence of the appearance frequency from low to high;
s3, constructing a Huffman tree by using the thought of a greedy algorithm, ensuring that characters appearing at low frequency are at the lowest part of the tree, and using the longest code;
s4, encoding from top to bottom by using the constructed Huffman tree:
according to the provisions of the coding, provision is made for: the left sub-tree coding is coded into '0', the right sub-tree coding is coded into '1', the variable length coding is realized, the memory occupied by characters is saved, namely, the coding is carried out according to all the characters of the transmitted character string, the coding is carried out from top to bottom of a Huffman tree, and the coding is stored in a defined coding array table after being coded;
s5, outputting Huffman codes corresponding to the source characters in sequence, namely, coding and outputting a source character string of the three-dimensional digital process design MBD model data: judging whether the source character is equal to each character stored in the character table, if so, outputting a code array corresponding to the character, sequentially circulating until the end of the source character, and outputting a code, namely a code of a greedy-Huffman compression algorithm;
s6, decoding by using the codes after Huffman compression, and decoding to obtain a source character string of the three-dimensional digital process design MBD model data;
the specific steps of S3 are as follows:
constructing a Huffman tree from bottom to top:
taking two characters with the lowest frequency from the n characters in the character string, creating a node tmp1 and a binary tree with two child nodes, and deleting the two nodes from the linked list; selecting two characters with the lowest frequency from the rest linked lists, creating a node tmp2 with two child nodes, and deleting the two nodes from the linked lists; if the weight value of tmp1 is greater than the weight value of tmp2, exchanging two binary trees of tmp1 and tmp2, and arranging according to the ascending order of the weight; and then inserting a node hTMp, comparing the size of the node with the parent node first, if the weight of the first is greater than that of the hTMp, merging the nodes into a tree for n-1 times, and if the weight of the parent node is equal to the weight of the left child node plus the weight of the right child node, constructing the Huffman tree.
2. The method of claim 1, further comprising:
s7, calculating the running time and compression ratio for encoding and decoding the three-dimensional digital process design MBD model data by the whole greedy algorithm-Huffman compression algorithm.
3. The method for designing the lightweight MBD model according to the three-dimensional digital process of claim 1, wherein the specific steps of S6 are as follows:
the decoding of the algorithm is analyzed according to the encoding of the characters, and the specific method is as follows: if the obtained coding array is matched with the coding array in the stored coding array table of each character, outputting the corresponding character, namely decoding the greedy-Huffman compression algorithm.
4. The method for weight reduction of a three-dimensional digital process design (MBD) model according to claim 2, wherein the specific steps of S7 are as follows:
and programming by adopting c # language, and monitoring the running time of the program realization function by utilizing the Stopwatch () function in the program.
CN201810444327.6A 2018-05-10 2018-05-10 Lightweight method for designing MBD model by three-dimensional digital process Active CN108829930B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810444327.6A CN108829930B (en) 2018-05-10 2018-05-10 Lightweight method for designing MBD model by three-dimensional digital process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810444327.6A CN108829930B (en) 2018-05-10 2018-05-10 Lightweight method for designing MBD model by three-dimensional digital process

Publications (2)

Publication Number Publication Date
CN108829930A CN108829930A (en) 2018-11-16
CN108829930B true CN108829930B (en) 2022-08-19

Family

ID=64147782

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810444327.6A Active CN108829930B (en) 2018-05-10 2018-05-10 Lightweight method for designing MBD model by three-dimensional digital process

Country Status (1)

Country Link
CN (1) CN108829930B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109639285B (en) * 2018-12-05 2023-06-13 北京安华金和科技有限公司 Method for improving BZIP2 compression algorithm speed based on finite block ordering compression
CN109412604A (en) * 2018-12-05 2019-03-01 云孚科技(北京)有限公司 A kind of data compression method based on language model

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6121903A (en) * 1998-01-27 2000-09-19 Infit Communications Ltd. On-the-fly data re-compression
IL182367A (en) * 2007-04-01 2013-03-24 Boaz Ben Moshe Method for compressing elevation maps
US7609179B2 (en) * 2008-01-08 2009-10-27 International Business Machines Corporation Method for compressed data with reduced dictionary sizes by coding value prefixes
US10331632B2 (en) * 2013-06-10 2019-06-25 Nvidia Corporation Bounding volume hierarchies through treelet restructuring
CN103731154B (en) * 2013-11-01 2017-01-11 陕西理工学院 Data compression algorithm based on semantic analysis

Also Published As

Publication number Publication date
CN108829930A (en) 2018-11-16

Similar Documents

Publication Publication Date Title
CN103326732B (en) The method of compression data, the decompression method of data, encoder
CN116681036B (en) Industrial data storage method based on digital twinning
CN102970043B (en) A kind of compression hardware system based on GZIP and accelerated method thereof
CN108829930B (en) Lightweight method for designing MBD model by three-dimensional digital process
CN111090417A (en) Binary file analysis method, device, equipment and medium
Sklyarov et al. Implementation in FPGA of address-based data sorting
CN112667860A (en) Sub-graph matching method, device, equipment and storage medium
CN105302915B (en) The high-performance data processing system calculated based on memory
Yuanbin et al. A data compression algorithm based on adaptive Huffman code for wireless sensor networks
CN109587483A (en) Code stream extraction module
CN111884660A (en) Huffman coding equipment
WO2023202149A1 (en) State selection method and system for finite state entropy encoding, and storage medium and device
CN103546161A (en) Lossless compression method based on binary processing
CN109767282A (en) Intelligent commodity screening technique and device, electronic equipment
CN113965207B (en) Deflate Huffman coding-based dynamic code table generation device and method
CN114443656A (en) Customizable automated data model analysis tool and use method thereof
CN111241076A (en) Stream data increment processing method and device based on tensor chain decomposition
CN103701470A (en) Stream intelligence prediction differencing and compression algorithm and corresponding control device
CN117254820A (en) Data compression method, device, equipment and storage medium
Gawrychowski et al. LZ77 factorisation of trees
CN112395286B (en) Chained data table connection method, device, equipment and storage medium
CN202931290U (en) Compression hardware system based on GZIP
CN115905168A (en) Adaptive compression method and compression apparatus, computer device, storage medium
Chang et al. Huffman algebras for independent random variables
CN115001628B (en) Data encoding method and device, data decoding method and device and data structure

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant