CN111147083B - Method for compressing and transmitting time information - Google Patents
Method for compressing and transmitting time information Download PDFInfo
- Publication number
- CN111147083B CN111147083B CN201911255946.1A CN201911255946A CN111147083B CN 111147083 B CN111147083 B CN 111147083B CN 201911255946 A CN201911255946 A CN 201911255946A CN 111147083 B CN111147083 B CN 111147083B
- Authority
- CN
- China
- Prior art keywords
- time information
- days
- month
- year
- transmission
- 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
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion 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/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/04—Protocols for data compression, e.g. ROHC
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Abstract
The invention belongs to the field of information transmission control, and particularly relates to a method for compressing and transmitting time information. Because of the limited length of the protocol between devices, longer time information cannot be transmitted. The increase in protocol length entails hardware modifications and increases in cost. The invention provides a time information compression transmission method, which has the core ideas that time information compression is carried out according to a fixed rule, a receiving end decompresses time information according to the same rule, the compression transmission of the time information is realized, and each month in the fixed rule is calculated according to 32 days, so that the problems of leap years, leap months, big and small months are skillfully avoided, and the number of days of each month in the fixed rule can be more than or equal to 32 days. The byte length required by transmitting the time information is greatly reduced, the time information within 85 years can be compressed to the shortest 4 bytes for transmission, and for a system with limited protocol length between devices, the time information transmission can be realized without adding hardware, thereby bringing great economic benefit.
Description
Technical Field
The invention belongs to the field of information transmission control, and particularly relates to a method for compressing and transmitting time information.
Background
In some systems, it is necessary to transmit year/month/day/time/minute/second time information from device to device, and if it is transmitted in bytes in a conventional manner, it is impossible to transmit the above information for some systems according to the range of time information, such as year (2019-2069), month (1-12), day (1-31), time (0-23), minute (0-59), second (0-59), at least 7 bytes are required to represent the information, because of the limited protocol length between devices. The increase in protocol length entails hardware modifications and increases in cost.
For this problem, there is a way to convert the year/month/day into the total number of days, convert the hour/minute/second into the total number of seconds according to the actual number of days (i.e. consider leap year and leap month), then combine the total number of days and the total number of seconds, and compress the total number of days and the total number of seconds to 4 bytes for transmission, but because the sending and receiving ends need to perform leap year and leap month calculation, the algorithm complexity is high and additional software and hardware resource consumption is brought.
Disclosure of Invention
The invention provides a method for compressing and transmitting time information on the premise of not increasing hardware cost and reducing the consumption of software and hardware resources, and solves the problem of transmitting year/month/day/time/minute/second time information under the limited byte length.
The invention provides a time information compression transmission method, which has the core ideas that time information compression is carried out according to a fixed rule, a receiving end decompresses time information according to the same rule, the compression transmission of the time information is realized, and each month in the fixed rule is calculated according to 32 days, so that the problems of leap years, leap months, big and small months are skillfully avoided, and the number of days of each month in the fixed rule can be more than or equal to 32 days.
The invention relates to a method for compressing and transmitting time information, which compresses the time information of year/month/day/time/minute/second to 4 bytes at least for transmission, and receives and decompresses the time information at a receiving end, wherein the compressing process comprises the following steps:
s1, determining a year range [ Y1, Y2] of the compressible transmission according to the year Y in the time information, wherein
Y1 is equal to or greater than Y is equal to or less than Y2, and y2=y1+85;
s2, compressing the time information of the year/month/day into the total days DD,
DD=(Y-(Y1-1))×12×32+(M-1)×32+D
wherein M is a month in the time information, and D is a day in the time information;
s3, compressing the information of time/minute/second into the total seconds SS
SS=H×3600+m×60+S;
Where H is the time in the time information, m is the fraction in the time information, and S is the second in the time information;
s4, combining and storing total days DD and total seconds SS
The total days DD are stored with the upper 15 bits of 4 bytes and the lower 17 bits store the total seconds SS.
Further, the transmitting end transmits the compressed time information.
Further, the receiving end decompresses the time information of year/month/day/time/minute/second according to the compression rule.
Further, the decompression process comprises the following steps:
s1, respectively taking out total days DD and total seconds SS;
s2, decompressing the time information of the year/month/day;
Y=(DD-DD%384)/384+(Y1-1);
M=((DD%384)-(DD%384)%32)/32+1;
D=(DD%384)%32;
s3, time information of decompression time/minute/second;
H=(SS-(SS%3600))/3600;
S=(SS%60);
m=(SS-H×3600-S)/60。
further, the method is effective for both regular years and leap years.
Furthermore, the method can also adjust the calculated number of days per month, the adjustment range is more than or equal to thirty-two days, and the adjusted compressible transmission year ranges [ Y1, Y2] need to be synchronously adjusted.
Compared with the prior art, the method has the following advantages:
(1) Compared with the mode of directly transmitting the year/month/day/time/minute/second time information according to bytes, the method has the advantages that the byte length required by transmitting the time information is greatly reduced due to the fact that the time information is compressed, the time information within 85 years can be compressed to the shortest 4 bytes to be transmitted, for a system with limited protocol length between devices, the time information transmission can be realized without adding hardware, and larger economic benefits can be brought;
(2) Compared with the compression mode according to the real days, namely considering leap years and leap months and big and small months, because the sending and receiving ends do not need to calculate leap years and leap months and big and small months and calculate by adopting fixed rules, the leap years and leap months and big and small months can be realized by simply adding, subtracting, multiplying and dividing and taking the module, the calculation complexity of time information compression and decompression is greatly simplified, and the engineering realization is easy;
(3) The time information compression transmission method provided by the invention is applicable to the aviation field and other industries as long as the situation that the year/month/day/time/minute/second time information is required to be transmitted under the limited byte length is met, the method provided by the invention can be adopted, so that the method has strong popularization.
Drawings
FIG. 1 is a flow of data processing at the transmitting and receiving ends
Detailed Description
The invention provides a compression method for transmitting year/month/day/time/minute/second information through limited 4 bytes, which comprises the following specific embodiments:
example one (leap years-2004 9 months 30 days 10 hours 15 minutes 36 seconds)
Step one: y=2004, determining a year range of compressible transmissions [2004, 2088], compressing year/month/day time information to total days:
DD=(2004-(2004-1))×12×32+(9-1)×32+30=670
step two: compressing the time/minute/second time information into a total number of seconds:
SS=10×3600+15×60+36=36936;
step three: the total number of days and total number of seconds are stored in combination and sent:
total number of days 670 was converted to binary 000001010011110, total number of seconds 36936 was converted to binary 01001000001001000, combined storage was 00000101001111001001000001001000, and decimal 87855176.
Step four: decompression year/month/day/time/minute/second information:
taking out the total number of days to be 670, the total number of seconds to be 36936, and solving the information of the extrusion year/month/day/time/minute/second to be 2004 9 month, 30 days, 10 hours, 15 minutes and 36 seconds according to the formula:
Y=(670-670%384)/384+(2004-1)=2004;
M=((670%384)-(670%384)%32)/32+1=9;
D=(670%384)%32=30;
H=(36936-(36936%3600))/3600=10;
S=(36936%60)=36;
m=(36936-10×3600-36)/60=15。
example two (conventional year-2019 5 month 28 day 12 hours 20 minutes 18 seconds)
Step one: y=2019, determining a year range of compressible transmissions as [2019, 2104], compressing year/month/day time information to total days:
DD=(2019-(2019-1))×12×32+(5-1)×32+28=540
step two: compressing the time/minute/second time information into a total number of seconds:
SS=12×3600+20×60+18=44418;
step three: the total number of days and total number of seconds are stored in combination and sent:
total number of days 540 was converted to binary 000001000011100, total number of seconds 44418 to binary 01010110110000010, combined stored 00000100001110001010110110000010, and decimal 70823298.
Step four: decompression year/month/day/time/minute/second information:
taking out the total days of 540 and the total seconds of 44418, and solving the information of the extrusion year/month/day/time/minute/second according to a formula of 20 minutes and 18 seconds of 2019, 5, 28, 12 days:
Y=(540-540%384)/384+(2019-1)=2019;
M=((540%384)-(540%384)%32)/32+1=5;
D=(540%384)%32=28;
H=(44418-(44418%3600))/3600=12;
S=(44418%60)=18;
m=(44418-12×3600-18)/60=20。
in the present invention, the number of times of 32 days per month is taken as an example, and the number may be equal to or larger than 32, and as the number increases, the smaller the year range that the 4-word can represent, the information of 85 years can be represented when 32 is selected.
Claims (5)
1. A method for compressed transmission of time information, characterized by: the method compresses the time information of year/month/day/time/minute/second to 4 bytes at least for transmission, and receives and decompresses at a receiving end, wherein the compression process comprises the following steps:
s1, determining a year range [ Y1, Y2] of the compressible transmission according to the year Y in the time information, wherein
Y1 is equal to or greater than Y is equal to or less than Y2, and y2=y1+85;
s2, compressing the time information of the year/month/day into the total days DD,
DD=(Y-(Y1-1))×12×32+(M-1)×32+D
wherein M is a month in the time information, and D is a day in the time information;
s3, compressing the information of time/minute/second into the total seconds SS
SS=H×3600+m×60+S;
Where H is the time in the time information, m is the fraction in the time information, and S is the second in the time information;
s4, combining and storing total days DD and total seconds SS
The total days DD are stored with the upper 15 bits of 4 bytes, and the total seconds SS are stored with the lower 17 bits;
the decompression process comprises the following steps:
s1, respectively taking out total days DD and total seconds SS;
s2, decompressing the time information of the year/month/day;
Y=(DD-DD%384)/384+(Y1-1);
M=((DD%384)-(DD%384)%32)/32+1;
D=(DD%384)%32;
s3, time information of decompression time/minute/second;
H=(SS-(SS%3600))/3600;
S=(SS%60);
m=(SS-H×3600-S)/60。
2. the method for compressed transmission of time information according to claim 1, wherein: and the transmitting end transmits the compressed time information.
3. The method for compressed transmission of time information according to claim 2, wherein: the receiving end decompresses the time information of year/month/day/time/minute/second according to the compression rule.
4. A method of time information compression transmission according to any one of claims 1-3, characterized in that: the method is effective for both conventional years and leap years.
5. A method of time information compression transmission according to any one of claims 1-3, characterized in that: according to the method, the calculated days of each month are adjusted, the adjustment range is more than or equal to thirty-two days, and the compressible transmission year ranges [ Y1, Y2] after adjustment are required to be synchronously adjusted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911255946.1A CN111147083B (en) | 2019-12-10 | 2019-12-10 | Method for compressing and transmitting time information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911255946.1A CN111147083B (en) | 2019-12-10 | 2019-12-10 | Method for compressing and transmitting time information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111147083A CN111147083A (en) | 2020-05-12 |
CN111147083B true CN111147083B (en) | 2023-06-27 |
Family
ID=70517863
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911255946.1A Active CN111147083B (en) | 2019-12-10 | 2019-12-10 | Method for compressing and transmitting time information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111147083B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113268460B (en) * | 2021-05-28 | 2022-10-14 | 中科计算技术西部研究院 | Multilayer parallel-based gene data lossless compression method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1143761A (en) * | 1996-05-13 | 1997-02-26 | 北京金远见电脑技术有限公司 | Time display apparatus and time information displaying method |
CN101118769A (en) * | 1999-10-22 | 2008-02-06 | 索尼公司 | Recording medium editing apparatus based on content supply source |
CN102646130A (en) * | 2012-03-12 | 2012-08-22 | 华中科技大学 | Method for storing and indexing mass historical data |
CN103795421A (en) * | 2014-02-26 | 2014-05-14 | 活点信息技术有限公司 | Method for data compression and decompression i |
KR101791880B1 (en) * | 2016-07-07 | 2017-11-01 | 김정훈 | Method and apparatus for compressing utf-8 code character |
CN110419216A (en) * | 2017-03-22 | 2019-11-05 | 高通股份有限公司 | Binary arithmetic decoding is carried out by parametrization probability Estimation finite state machine |
-
2019
- 2019-12-10 CN CN201911255946.1A patent/CN111147083B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1143761A (en) * | 1996-05-13 | 1997-02-26 | 北京金远见电脑技术有限公司 | Time display apparatus and time information displaying method |
CN101118769A (en) * | 1999-10-22 | 2008-02-06 | 索尼公司 | Recording medium editing apparatus based on content supply source |
CN102646130A (en) * | 2012-03-12 | 2012-08-22 | 华中科技大学 | Method for storing and indexing mass historical data |
CN103795421A (en) * | 2014-02-26 | 2014-05-14 | 活点信息技术有限公司 | Method for data compression and decompression i |
KR101791880B1 (en) * | 2016-07-07 | 2017-11-01 | 김정훈 | Method and apparatus for compressing utf-8 code character |
CN110419216A (en) * | 2017-03-22 | 2019-11-05 | 高通股份有限公司 | Binary arithmetic decoding is carried out by parametrization probability Estimation finite state machine |
Non-Patent Citations (1)
Title |
---|
王红.IRIG-B格式时间码解码装置的设计.《科技传播》.2014,第6卷(第6期),201-202. * |
Also Published As
Publication number | Publication date |
---|---|
CN111147083A (en) | 2020-05-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7930436B1 (en) | System and method for dynamically adjusting data compression parameters | |
CN104952037B (en) | Image file Zoom method and system | |
CN102523367A (en) | Real-time image compression and reduction method based on plurality of palettes | |
EP3726838B1 (en) | Management of memory for storing display data | |
US9575863B2 (en) | Apparatus of wireless gigabit display extension (WDE) device | |
CN106713922B (en) | Image processing method and electronic device | |
CN111147083B (en) | Method for compressing and transmitting time information | |
CN103312336A (en) | Data compression method and device | |
WO2018058575A1 (en) | Processing method and system for flight image data, and ground end device | |
US7342902B2 (en) | Two stage loss-less compressor for a clear channel over a packet network | |
CN111556322A (en) | FPGA-based rapid image compression and transmission system | |
CN103796018A (en) | Remote-sensing image real-time compression and progressive transmission system | |
CN116489236B (en) | Electroencephalogram signal real-time lossless compression method and device, electronic equipment and storage medium | |
CN107483952A (en) | A kind of method, apparatus and system of jpeg image decompression | |
CN109493832B (en) | VR display device supporting DSC compression and control method thereof | |
CN116155362A (en) | Multi-source data processing system and method | |
CN100561567C (en) | A kind of image data converting system and method | |
CN102547284A (en) | Portable wireless high-definition image transmission system and method thereof | |
CN111971673A (en) | System and method for redirecting audio and video data streams in a display-server computing system | |
CN107832256A (en) | A kind of method and device of data processing | |
CN112292848B (en) | Video source expansion method, device and system and video source expander | |
CN103873873A (en) | Method for decoding image under unreliable channel | |
CN107318021A (en) | A kind of data processing method and system remotely shown | |
CN104202124A (en) | Erp (enterprise resource planning) data package communication method | |
CN101883281A (en) | Static image coding method and system for remote display system |
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 |