CN111147083A - Method for compressing and transmitting time information - Google Patents

Method for compressing and transmitting time information Download PDF

Info

Publication number
CN111147083A
CN111147083A CN201911255946.1A CN201911255946A CN111147083A CN 111147083 A CN111147083 A CN 111147083A CN 201911255946 A CN201911255946 A CN 201911255946A CN 111147083 A CN111147083 A CN 111147083A
Authority
CN
China
Prior art keywords
time information
year
transmission
month
days
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911255946.1A
Other languages
Chinese (zh)
Other versions
CN111147083B (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.)
AVIC Chengdu Aircraft Design and Research Institute
Original Assignee
AVIC Chengdu Aircraft Design and Research Institute
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 AVIC Chengdu Aircraft Design and Research Institute filed Critical AVIC Chengdu Aircraft Design and Research Institute
Priority to CN201911255946.1A priority Critical patent/CN111147083B/en
Publication of CN111147083A publication Critical patent/CN111147083A/en
Application granted granted Critical
Publication of CN111147083B publication Critical patent/CN111147083B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • 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
    • Y02DCLIMATE 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/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Electric Clocks (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention belongs to the field of information transmission control, and particularly relates to a method for compressing and transmitting time information. Due to the limited length of the protocol between devices, longer time information cannot be transmitted. If the protocol length is increased, the hardware modification and the cost increase are necessarily brought. The invention provides a method for compressing and transmitting time information, which has the core idea that the time information is compressed according to a fixed rule, a receiving end decompresses the time information according to the same rule to realize the compression and transmission of the time information, the calculation of the fixed rule according to 32 days per month is the key point of the method, the problems of leap months and big and small months in leap years are avoided skillfully, and the number of days per month in the fixed rule can be more than or equal to 32 days. The length of bytes needed by transmitting the time information is greatly reduced, the time information within 85 years can be compressed to the shortest 4 bytes for transmission, the time information transmission can be realized under the condition of not increasing hardware for a system with limited protocol length between devices, and greater economic benefit can be brought.

Description

Method for compressing and transmitting time information
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, time information of year/month/day/hour/minute/second needs to be transmitted between devices, if the time information is transmitted separately in bytes in a conventional manner, according to the range of the time information, such as year (2019-2069), month (1-12), day (1-31), hour (0-23), minute (0-59) and second (0-59), at least 7 bytes are needed to represent the information, but for some systems, the information cannot be transmitted due to the limited protocol length between devices. If the protocol length is increased, the hardware modification and the cost increase are necessarily brought.
To solve this problem, there is currently a way to convert the year/month/day into total days, convert the hour/minute/second into total seconds, and then combine the total days and the total seconds, which can be compressed to 4 bytes for transmission, according to the number of real days (i.e. considering leap month), but because the transmitting and receiving ends need to perform leap month calculation, the algorithm complexity is high and extra software and hardware resource consumption is caused.
Disclosure of Invention
The invention provides a time information compression transmission method on the premise of not increasing hardware cost and simultaneously reducing the consumption of software and hardware resources, and solves the problem of transmitting year/month/day/hour/minute/second time information under the limited byte length.
The invention provides a method for compressing and transmitting time information, which has the core idea that the time information is compressed according to a fixed rule, a receiving end decompresses the time information according to the same rule to realize the compression and transmission of the time information, the calculation of the fixed rule according to 32 days per month is the key point of the method, the problems of leap months and big and small months in leap years are avoided skillfully, and the number of days per 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/hour/minute/second to 4 bytes at least for transmission, and receives and decompresses the time information at a receiving end, wherein the compression process comprises the following steps:
s1, determining the year range [ Y1, Y2] of compressible transmission according to the year Y in the time information, wherein
Y is not less than Y1 and not more than Y2, and Y2 is Y1+ 85;
s2, compressing the time information of year/month/day into 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 hour/minute/second into SS of total seconds
SS=H×3600+m×60+S;
Wherein, H is the time in the time information, m is the minute in the time information, and S is the second in the time information;
s4, storing total days DD and total seconds SS in combination
The 4 bytes of upper 15 bits are used to store the total number of days DD and the lower 17 bits are used to store the total number of seconds SS.
Further, the sending end sends out the compressed time information.
Further, the receiving end releases the time information of year/month/day/hour/minute/second by pressing the contraction 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 year/month/day;
Y=(DD-DD%384)/384+(Y1-1);
M=((DD%384)-(DD%384)%32)/32+1;
D=(DD%384)%32;
s3, decompressing time information of time/minute/second;
H=(SS-(SS%3600))/3600;
S=(SS%60);
m=(SS-H×3600-S)/60。
further, the method is effective for both conventional years and leap years.
Furthermore, the method can also adjust the calculation days per month, the adjustment range is more than or equal to thirty-two days, and the year range [ Y1, Y2] of compressible transmission needs to be adjusted synchronously after adjustment.
Compared with the prior art, the method has the following advantages:
(1) compared with the mode of directly and respectively transmitting the time information of year/month/day/hour/minute/second according to the bytes, the time information is compressed, so that the byte length required by the time information is greatly reduced, the time information within 85 years can be compressed to the shortest 4 bytes for transmission, the time information transmission can be realized under the condition of not increasing hardware for a system with limited protocol length between devices, and greater economic benefit can be brought;
(2) compared with a compression mode of considering leap years and big and small months according to real days, the leap years and big and small months are calculated by adopting a fixed rule without calculating the leap years and the big and small months at the sending and receiving ends, and the calculation can be realized only by simple operations of addition, subtraction, multiplication, division and modulus extraction, so that 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 has universality, is not only suitable for the field of aviation, but also suitable for other industries, and can be adopted only when the time information of year/month/day/hour/minute/second needs to be transmitted under the limited byte length, so that the method has strong popularization.
Drawings
FIG. 1 data processing flow at the transmitting and receiving ends
Detailed Description
The invention provides a compression method for transmitting year/month/day/hour/minute/second information through limited 4 bytes, which comprises the following specific implementation modes:
example one (leap year-2004, 9, 30, 10, 15 min, 36 sec)
The method comprises the following steps: y2004, determine year range of compressible transmission [2004, 2088], compress year/month/day time information to total days:
DD=(2004-(2004-1))×12×32+(9-1)×32+30=670
step two: compress the time/min/sec time information into total seconds:
SS=10×3600+15×60+36=36936;
step three: store total days and total seconds in combination, and send:
total days 670 converted to 000001010011110, total seconds 36936 converted to 01001000001001000, combined stored as 00000101001111001001000001001000, and converted to 87855176 decimal.
Step four: decompression year/month/day/hour/minute/second information:
the total days are taken out to be 670, the total seconds are 36936, and the information of year/month/day/hour/minute/second is solved according to a formula to be 9, 30, 10, 15 and 36 seconds in 2004:
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 (regular year-2019 year 5 month 28 day 12 hour 20 min 18 sec)
The method comprises the following steps: and Y is 2019, the year range of compressible transmission is determined to be [2019, 2104], the year/month/day time information is compressed to total days:
DD=(2019-(2019-1))×12×32+(5-1)×32+28=540
step two: compress the time/min/sec time information into total seconds:
SS=12×3600+20×60+18=44418;
step three: store total days and total seconds in combination, and send:
the total days 540 were converted to 000001000011100 and the total seconds 44418 to 01010110110000010, combined for 00000100001110001010110110000010 and converted to 70823298 decimal.
Step four: decompression year/month/day/hour/minute/second information:
taking out the total days as 540 and the total seconds as 44418, and solving the information of year/month/day/hour/minute/second as 2019, 5, month, 28, 12, hour, 20, 18 and seconds according to a formula:
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 invention, 32 days per month are taken as an example, and the number can be calculated according to the number of 32 or more, but the year range which can be represented by 4 bytes is smaller along with the increase of the number, and 85 years of information can be represented when 32 is selected.

Claims (6)

1. A method for compressed transmission of time information, comprising: the method compresses the time information of year/month/day/hour/minute/second to 4 bytes at least for transmission, and receives and decompresses the time information at a receiving end, wherein the compression process comprises the following steps:
s1, determining the year range [ Y1, Y2] of compressible transmission according to the year Y in the time information, wherein
Y is not less than Y1 and not more than Y2, and Y2 is Y1+ 85;
s2, compressing the time information of year/month/day into 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 hour/minute/second into SS of total seconds
SS=H×3600+m×60+S;
Wherein, H is the time in the time information, m is the minute in the time information, and S is the second in the time information;
s4, storing total days DD and total seconds SS in combination
The 4 bytes of upper 15 bits are used to store the total number of days DD and the lower 17 bits are used to store the total number of seconds SS.
2. The method for compressed transmission of time information according to claim 1, wherein: and the sending end sends out the compressed time information.
3. The method for compressed transmission of time information according to claim 2, wherein: the receiving end releases the time information of year/month/day/hour/minute/second according to the pressing rule.
4. A method for compressed transmission of time information according to claim 3, characterized in that: the decompression process comprises the following steps:
s1, respectively taking out total days DD and total seconds SS;
s2, decompressing the time information of year/month/day;
Y=(DD-DD%384)/384+(Y1-1);
M=((DD%384)-(DD%384)%32)/32+1;
D=(DD%384)%32;
s3, decompressing time information of time/minute/second;
H=(SS-(SS%3600))/3600;
S=(SS%60);
m=(SS-H×3600-S)/60。
5. method for compressed transmission of time information according to any of claims 1-4, characterized in that: the method is effective for both conventional years and leap years.
6. Method for compressed transmission of time information according to any of claims 1-4, characterized in that: the method can also adjust the calculation days per month, the adjustment range is more than or equal to thirty-two days, and the year range [ Y1, Y2] of compressible transmission needs to be adjusted synchronously after adjustment.
CN201911255946.1A 2019-12-10 2019-12-10 Method for compressing and transmitting time information Active CN111147083B (en)

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 true CN111147083A (en) 2020-05-12
CN111147083B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113268460A (en) * 2021-05-28 2021-08-17 中科计算技术西部研究院 Multilayer parallel-based gene data lossless compression method and device

Citations (6)

* Cited by examiner, † Cited by third party
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

Patent Citations (6)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
王红: "IRIG-B格式时间码解码装置的设计" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113268460A (en) * 2021-05-28 2021-08-17 中科计算技术西部研究院 Multilayer parallel-based gene data lossless compression method and device

Also Published As

Publication number Publication date
CN111147083B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
US7692560B2 (en) Two stage loss-less compressor for a clear channel over a packet network
US9575863B2 (en) Apparatus of wireless gigabit display extension (WDE) device
CN109040786B (en) Camera data transmission method, device and system and storage medium
US20240045641A1 (en) Screen sharing display method and apparatus, device, and storage medium
WO2024061295A1 (en) Video data processing method and system
CN105227962B (en) A kind of lossless information concealing method based on data difference
CN106713922B (en) Image processing method and electronic device
CN111556322A (en) FPGA-based rapid image compression and transmission system
CN103152573A (en) Method and system for transmitting image frame between mobile terminal and intelligent television set
CN110381278A (en) Method and apparatus for color space 4:4:4 transmission
CN111147083A (en) Method for compressing and transmitting time information
CN103796018A (en) Remote-sensing image real-time compression and progressive transmission system
CN113709493B (en) Video stream data encryption device, method and equipment of KVM system
US20210125580A1 (en) Wireless programmable media processing system
CN116489236B (en) Electroencephalogram signal real-time lossless compression method and device, electronic equipment and storage medium
CN107318021B (en) Data processing method and system for remote display
CN116155362A (en) Multi-source data processing system and method
CN105610979B (en) Network resource transmission system and method based on virtualization technology
CN111490984B (en) Network data coding and encryption algorithm thereof
CN104202124A (en) Erp (enterprise resource planning) data package communication method
CN107318020A (en) The data processing method and system remotely shown
CN215452983U (en) 5G video transmission system based on distributed architecture
CN117041358A (en) Optimization method and system for data transmission overhead, storage medium and electronic equipment
JPH08317404A (en) System and method for image data transmission/reception
CN115379207A (en) Camera simulation method and device, electronic equipment and readable medium

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