Methods, devices, and computing equipment for storing infrared signals
By performing regularity searching and length compression on infrared signals, and combining AES128 encryption and Base64 encoding, the problems of low storage efficiency and insufficient security of infrared signals are solved, achieving efficient and secure infrared signal storage.
Patent Information
- Application Number
- CN202411975873.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In existing technologies, infrared signal storage is inefficient, requires a large amount of storage space, and is not secure enough. Especially in the case of large amounts of data, MCU storage costs are high, and the stored infrared signals are easily acquired.
By searching for patterns in the raw infrared signal data and compressing its length, the data with and without patterns are processed using the first and second compression methods, respectively. Then, the data is encrypted and stored using AES128 encryption and Base64 encoding.
It effectively reduces storage space requirements, improves storage efficiency and security, reduces system resource overhead and costs, and is suitable for the storage and transmission of large-scale signal data.
Smart Images

Figure CN119906434B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, specifically to a method, apparatus, and computing device for storing infrared signals. Background Technology
[0002] With the rapid development of the Internet of Things (IoT), smart devices, and remote control technologies, infrared signals are increasingly used in device control and data transmission. Due to their advantages such as low power consumption, low cost, and absence of electromagnetic interference, infrared signals have become a key communication method for many smart home and telemedicine devices. However, the transmission and storage of infrared signals face challenges, especially with the increasing volume of data; effectively compressing, encrypting, and storing these signals becomes particularly important.
[0003] In the prior art, see Figure 1 The system collects and receives infrared signals emitted by an infrared remote control using an infrared circuit, and records the signal data of all infrared signals. The Microcontroller Unit (MCU) acquires all infrared signals and directly stores all raw infrared signal data to a memory chip. This results in low efficiency when storing large amounts of data, requires more storage space for the MCU, and upgrading to a larger capacity MCU is more expensive. Furthermore, storing received infrared signal data locally makes it vulnerable to interception, leading to insufficient security. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention provide a method, apparatus and computing device for storing infrared signals, which overcomes or at least partially solves the above problems.
[0005] According to one aspect of the present invention, a method for storing infrared signals is provided. The method includes: acquiring raw infrared signal data; performing a pattern search on the raw infrared signal data and compressing its length according to the pattern search result to obtain compressed data; encrypting the compressed data to obtain encrypted compressed infrared signal data, and storing the encrypted compressed infrared signal data.
[0006] In one optional approach, the original infrared signal data is subjected to a pattern search, and the length of the pattern search results is compressed to obtain compressed data. This includes: performing a preset pattern search on the original infrared signal data, and applying a first compression method to compress the length of the original infrared signal data with a pattern to obtain compressed data; if no data matching the preset pattern is found in the original infrared signal data, then applying a second compression method to compress the length of the original infrared signal data to obtain compressed data.
[0007] In one optional approach, a preset pattern is searched for in the original infrared signal data, and a first compression method is applied to compress the length of the patterned original infrared signal data to obtain compressed data. This includes: dividing the original infrared signal data by a preset value to obtain infrared signal data after removing the carrier wave; searching for bit0 and bit1 in the infrared signal data after removing the carrier wave; if bit0 and bit1 are found, then traversing the infrared signal data after removing the carrier wave to search for bit0 and bit1 and applying bit0 and bit1 to the infrared signal data after removing the carrier wave for data compression to obtain compressed data; if bit0 and bit1 are not found, then it is determined that the application of the first compression method to compress the original infrared signal data has failed.
[0008] In one optional approach, the process involves iterating through the carrier-removed infrared signal data, searching for bit0 and bit1, and applying bit0 and bit1 to compress the carrier-removed infrared signal data to obtain compressed data. This includes: determining whether the carrier-removed infrared signal data has been completely traversed; if not, determining whether it is appropriate to compress eight bits of data into one byte using bit0 and bit1; if so, performing pre-compression processing on the carrier-removed infrared signal data; otherwise, storing the compressed data; if the carrier-removed infrared signal data has been completely traversed, determining whether bit0 and bit1 are used for data compression; if bit0 and bit1 are used to compress the carrier-removed infrared signal data, applying bit0 and bit1 to compress the data to obtain compressed data; otherwise, determining that the first compression method for compressing the original infrared signal data has failed.
[0009] In one alternative approach, the pre-compression processing of the carrier-removed infrared signal data includes: determining whether the carrier-removed infrared signal data is greater than 255; if so, adding 00 before the carrier-removed infrared signal data; otherwise, keeping the carrier-removed infrared signal data unchanged; adding ffff and data length to the header of the carrier-removed infrared signal data to obtain the integrated infrared signal data, and storing the integrated infrared signal data.
[0010] In one alternative approach, searching for bit0 and bit1 in the carrier-removed infrared signal data includes: defining a first string, which is bit0[0], bit0[1], bit1[0], and bit1[1]; iterating through the carrier-removed infrared signal data, combining every two digits, and determining whether the difference between two consecutive combinations is less than 7. If so, determining whether bit0[0] and bit0[1] exist in the two combinations; otherwise, continuing to search the first string; if bit0[0] and bit0[1] exist, determining whether bit1[0] and bit1[1] exist in the two combinations; if bit0[0]... If bit0[1] does not exist, record the first two digits of the two combinations into bit0[0] and bit0[1], and then continue to search for the first string; if bit1[0] and bit1[1] exist, subtract bit0[0] and bit0[1] or bit1[0] and bit1[1] from the combination of the first two digits of the two combinations. If the difference is within 7, take the average of the two combinations and update it to bit0[0] and bit0[1] or bit1[0] and bit1[1]; if bit1[0] and bit1[1] do not exist, record the first two digits of the two combinations into bit1[0] and bit1[1].
[0011] In one optional approach, a second compression method is applied to compress the length of the original infrared signal data to obtain compressed data. This includes: defining a global variable and dividing the original infrared signal data by a preset value to obtain carrier-removed infrared signal data; traversing the carrier-removed infrared signal data and determining whether all carrier-removed infrared signal data has been traversed; if not all carrier-removed infrared signal data has been traversed, determining whether the currently traversed data is greater than 255; if the currently traversed data is greater than 255, adding 00s before the currently traversed data, otherwise saving the currently traversed data; returning to the step of determining whether all carrier-removed infrared signal data has been traversed; if all carrier-removed infrared signal data has been traversed, the compressed data is obtained.
[0012] According to another aspect of the present invention, an infrared signal storage device is provided, the device comprising: a data acquisition unit for acquiring raw infrared signal data; a data compression unit for performing a pattern search on the raw infrared signal data and compressing the length according to the pattern search result to obtain compressed data; and an encryption storage unit for encrypting the compressed data to obtain encrypted compressed infrared signal data and storing the encrypted compressed infrared signal data.
[0013] According to another aspect of the present invention, a computing device is provided, comprising: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other via the communication bus; the memory is used to store at least one executable instruction, which causes the processor to perform the steps of the above-described infrared signal storage method.
[0014] According to another aspect of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the storage medium, the executable instruction causing a processor to perform the steps of the above-described infrared signal storage method.
[0015] This invention obtains raw infrared signal data; performs a pattern search on the raw infrared signal data and compresses its length based on the pattern search results to obtain compressed data; encrypts the compressed data to obtain encrypted compressed infrared signal data, and stores the encrypted compressed infrared signal data. This effectively compresses the raw infrared signal data, reduces storage space usage, ensures efficient and secure storage, and reduces system resource consumption and costs.
[0016] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0018] Figure 1 A schematic diagram of an infrared signal storage method in the prior art is shown;
[0019] Figure 2 A flowchart illustrating the infrared signal storage method provided in an embodiment of the present invention is shown.
[0020] Figure 3 This diagram illustrates the process of the first compression method zip01 provided in an embodiment of the present invention.
[0021] Figure 4 This diagram illustrates how to find bit0 and bit1 in infrared signal data after removing the carrier wave, according to an embodiment of the present invention.
[0022] Figure 5This diagram illustrates the process of the second compression method zip02 provided in an embodiment of the present invention.
[0023] Figure 6 A schematic diagram of an infrared signal storage method provided in an embodiment of the present invention is shown;
[0024] Figure 7 A schematic diagram of the structure of the infrared signal storage device provided in an embodiment of the present invention is shown;
[0025] Figure 8 A schematic diagram of the structure of a computing device provided in an embodiment of the present invention is shown. Detailed Implementation
[0026] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0027] Figure 2 A flowchart illustrating an infrared signal storage method provided in an embodiment of the present invention is shown. This infrared signal storage method is applied to a server, such as... Figure 2 As shown, the methods for storing infrared signals include:
[0028] Step S11: Acquire raw infrared signal data.
[0029] In this embodiment of the invention, the server includes an infrared circuit for receiving raw infrared signal data. This raw infrared signal data can be used for key communications in the Internet of Things (IoT), smart devices, and remote control, such as smart home and telemedicine devices. This application utilizes an infrared circuit to collect and receive raw infrared signal data emitted by an infrared remote controller.
[0030] Step S12: Perform a pattern search on the original infrared signal data and compress the length based on the pattern search results to obtain compressed data.
[0031] In this embodiment of the invention, a preset pattern is searched for in the original infrared signal data, and a first compression method is applied to compress the length of the patterned original infrared signal data to obtain compressed data. Optionally, the original infrared signal data is divided by a preset value to obtain infrared signal data after removing the carrier wave; bit0 and bit1 are searched for in the infrared signal data after removing the carrier wave. If bit0 and bit1 are found, the infrared signal data after removing the carrier wave is traversed to find bit0 and bit1, and data compression is performed on the infrared signal data after removing the carrier wave using bit0 and bit1 to obtain compressed data. Specifically, it determines whether the carrier-removed infrared signal data has been completely traversed. If not, it determines whether to compress the eight-bit data into one byte using bits 0 and 1. If applicable, pre-compression processing is performed on the carrier-removed infrared signal data; otherwise, the compressed data is stored. If the carrier-removed infrared signal data has been completely traversed, it determines whether to use bits 0 and 1 for data compression. If bits 0 and 1 are used for data compression, they are applied to compress the carrier-removed infrared signal data to obtain compressed data; otherwise, it is determined that the first compression method for compressing the original infrared signal data has failed. If bits 0 and 1 are not found, it is determined that the first compression method for compressing the original infrared signal data has failed.
[0032] During the pre-compression processing of the carrier-removed infrared signal data, it is determined whether the carrier-removed infrared signal data is greater than 255. If so, 00 is added before the carrier-removed infrared signal data; otherwise, the carrier-removed infrared signal data remains unchanged. FFFF and the data length are added to the header of the carrier-removed infrared signal data to obtain the integrated infrared signal data, which is then stored.
[0033] The format of the first compression method, zip01, is shown in Table 1.
[0034] Table 1. Format of the first compression method, zip01
[0035] Flag carrier frequency bit0 bit1 Infrared code 1 byte 1 byte 2 bytes 2 bytes N
[0036] The first compression method can effectively compress regular infrared waveform data into bytes, such as infrared waveforms based on the NEC (Nippon Electric Company) protocol. The NEC protocol is a commonly used infrared remote control protocol for controlling various consumer electronic devices, defining the encoding method for the time sequence of infrared signals. For a more detailed explanation of the first compression method zip01, please refer to [link to documentation]. Figure 3 ,include:
[0037] Step 100: Begin.
[0038] Step 101: Define a global variable char A
[1024] .
[0039] Step 102: Divide the original infrared signal data by 26.3 (data * 38 / 1000) and store it in memory.
[0040] The carrier frequency of the original infrared signal data is 38KHz. Multiplying the original infrared signal data by 38 / 1000, or dividing by 26.3, yields the infrared signal data after removing the carrier. This also reduces the amount of data to be stored, decreases the storage space requirements, and improves storage efficiency.
[0041] Step 103: Find bit0 and bit1.
[0042] Step 104: Determine if bit0 or bit1 has been found. If so, proceed to step 106; otherwise, proceed to step 105.
[0043] Step 105: Determine that the first compression method has failed. Then proceed to step 116.
[0044] Step 106: Traverse the data.
[0045] Step 107: Determine if all data has been traversed. If yes, proceed to step 114; otherwise, proceed to step 108.
[0046] Step 108: Determine if the eight-digit number can be compressed into one byte using bits 0 and 1. If yes, proceed to step 110; otherwise, proceed to step 109.
[0047] Step 109: Store the compressed data in A. Then return to step 107.
[0048] Step 110: Determine if the data is greater than 255. If so, proceed to step 112; otherwise, proceed to step 111.
[0049] Step 111: Then return to step 113.
[0050] Step 112: Add 00s before the data.
[0051] Step 113: Add ffff and data length to the data header, and finally store the integrated data in A.
[0052] Step 114: Determine whether to use bits 0 and 1 for data compression. If yes, proceed to step 115; otherwise, return to step 105.
[0053] Step 115: Obtain compressed data.
[0054] Step 116: End.
[0055] When searching for bit0 and bit1 in the infrared signal data after removing the carrier wave, the first string is defined as bit0[0], bit0[1], bit1[0], and bit1[1]. Then, the infrared signal data after removing the carrier wave is traversed, and every two digits are combined. It is determined whether the difference between two consecutive combinations is less than 7. If it is, it is determined whether bit0[0] and bit0[1] exist in the two combinations; otherwise, the search continues in the first string. If bit0[0] and bit0[1] exist, it is determined whether bit1[0] and bit1[1] exist in the two combinations; if bit0[0] and bit0[1] do not exist, the first two digits of the two combinations are recorded in bit0[0] and bit1[1]. 0[1], then continue searching for the first string; if bit1[0] and bit1[1] exist, then subtract bit0[0] and bit0[1] or bit1[0] and bit1[1] from the first two digits of the two combinations. If the difference is within 7, take the average of the two combinations and update it to bit0[0] and bit0[1] or bit1[0] and bit1[1]; if bit1[0] and bit1[1] do not exist, then record the first two digits of the two combinations to bit1[0] and bit1[1]. See details Figure 4 ,include:
[0056] Step 200: Begin.
[0057] Step 201: Define char bit0[0], bit0[1], bit1[0], bit1[1].
[0058] Step 202: Traverse the data.
[0059] Step 203: Determine if all data has been traversed. If yes, proceed to step 210; otherwise, proceed to step 204.
[0060] Step 204: For each two-digit combination, determine if the difference between the two combinations is less than or equal to 7. If so, proceed to step 205; otherwise, return to step 203.
[0061] Step 205: Determine if bit0[0] and bit0[1] exist. If they do, proceed to step 207; otherwise, proceed to step 206.
[0062] Step 206: Record the first two digits into bit0[0] and bit0[1]. Then return to execute step 203.
[0063] Step 207: Determine if bit1[0] and bit1[1] exist. If they do, proceed to step 208; otherwise, proceed to step 209.
[0064] Step 208: Subtract bit0[0], bit0[1] or bit1[0], bit1[1] from the combination of two digits; the difference is within 7. Take the average of these two combinations to cover bit0[0], bit0[1] or bit1[0], bit1[1].
[0065] Step 209: Record the first two digits into bit1[0] and bit1[1]. Then return to execute step 203.
[0066] Step 210: Determine if bit0[0], bit0[1], bit1[0], and bit1[1] exist. If they do, proceed to step 211; otherwise, proceed to step 212.
[0067] Step 211: The first compression method was successfully returned.
[0068] Step 212: Returning to the first compression method failed.
[0069] Step 213: End.
[0070] The following example illustrates the first compression method: Let the original infrared waveform data be:
[0071] 3419 1709 394 394 394 394 1341 394 394 394 394 1341 394 394 394 1341 394 394 394 1341 394 394 394 1341 394 394 394 394 394 1341 394 394 394 394 394 1341 394 394 394 394 1341 394 394 394 394 394 394 394 394 394 1341 394 394 394 394 3941341 394 394 394 1341 394 1341 394 394 394 1341 394 394 394 1341 394 394 394 1341 394 394 394 60490.
[0072] Dividing the original infrared waveform data by 26.3 yields the following data:
[0073] 130 65 15 15 15 15 15 51 ... 51 15 15 15 15 51 15 51 15 15 15 51 15 15 2300.
[0074] The data compressed using the first compression method, zip01, is as follows:
[0075] 01260F0F0F33ffff0282412AA222825A9Affff040F0008FC.
[0076] In this embodiment of the invention, the second compression method zip02 directly records and retains the original infrared signal data. When the first compression method zip01 fails, the original infrared signal data is compressed using the second compression method zip02. The format of the second compression method zip02 is shown in Table 2.
[0077] Table 2 shows the format of the second compression method, zip02.
[0078] Flag carrier frequency Infrared code 1 byte 1 byte N
[0079] If no data matching the preset pattern is found in the original infrared signal data, it is determined that the first compression method has failed to compress the original infrared signal data. The second compression method is then applied to compress the length of the original infrared signal data to obtain compressed data. Optionally, a global variable is defined, and the original infrared signal data is divided by a preset value to obtain the carrier-removed infrared signal data. The carrier-removed infrared signal data is traversed, and it is determined whether all carrier-removed infrared signal data has been traversed. If not all carrier-removed infrared signal data has been traversed, it is determined whether the currently traversed data is greater than 255. If the currently traversed data is greater than 255, 00s are added before the currently traversed data; otherwise, the currently traversed data is saved. The process returns to the step of determining whether all carrier-removed infrared signal data has been traversed. If all carrier-removed infrared signal data has been traversed, the compressed data is obtained. The second compression method, zip02, directly records and retains the original infrared signal data. For a more detailed process, see [link to documentation]. Figure 5 ,include:
[0080] Step 300: Begin.
[0081] Step 311: Define a global variable char A
[1024] .
[0082] Step 312: Divide the data by 26.3 (data * 38 / 1000) and store it in memory.
[0083] Step 313: Traverse the data.
[0084] Step 314: Determine if all data has been traversed. If yes, proceed to step 318; otherwise, proceed to step 315.
[0085] Step 315: Determine if the data is greater than 255. If so, proceed to step 316; otherwise, proceed to step 317.
[0086] Step 316: Add 00s to the beginning of the data and save it to A.
[0087] Step 317: Save the original data to A.
[0088] Step 318: Obtain compressed data.
[0089] Step 319: End.
[0090] The following example illustrates the second compression method: Let the original infrared waveform data be:
[0091] 9000 4500 550 550 550 550 550 550 550 550 1500 550 1500 550 1500 550 1500 550 1500
[0092] Dividing the original timing data by 26.3 yields the following data:
[0093] 342 171 21 21 21 21 21 21 21 21 21 57 21 57 21 57 21 57 21 57 21 57.
[0094] Considering the structure of the second compression method zip02: flag bit + carrier frequency + infrared code, the data compressed using the second compression method zip02 is as follows:
[0095] Flag bit: 01
[0096] Carrier frequency: 0x26
[0097] Infrared code: 000156AB1515151515151515391539153915391539
[0098] The infrared compression code obtained by the second compression method zip02 is: 0126000156AB151515151515151515391539153915391539.
[0099] Step S13: Encrypt the compressed data to obtain encrypted and compressed infrared signal data, and store the encrypted and compressed infrared signal data.
[0100] In this embodiment of the invention, AES128 encryption and Base64 encoding can be applied to encrypt compressed data. Advanced Encryption Standard (AES) is a symmetric-key encryption algorithm used to protect electronic data. AES128 uses ECB-pkcs7padding, where ECB represents the electronic codebook mode and pkcs7padding represents the padding mode. Base64 encodes binary data into text and is commonly used for data transmission and storage, improving compatibility.
[0101] This invention combines two compression schemes—a first compression method (zip01) and a second compression method (zip02)—along with AES encryption and Base64 encoding to compress and encrypt raw infrared signal data for storage. By efficiently compressing the raw infrared signal data, storage space is reduced. AES encryption ensures data security, and Base64 encoding facilitates text-based storage and transmission. This method is suitable for the secure storage, transmission, and management of raw infrared signal data. For detailed process information, please refer to [link to documentation]. Figure 6 ,include:
[0102] Step 400: Begin.
[0103] Step 401: Acquire raw infrared signal data.
[0104] Step 402: zip01 compresses the infrared source code.
[0105] Step 403: Determine if zip01 was successfully compressed. If yes, proceed to step 405; otherwise, proceed to step 404.
[0106] Step 404: Compress the infrared source code using zip02. Then proceed to step 405.
[0107] Step 405: AES128 (ECB-pkcs7padding) encryption.
[0108] Step 406: Base64 encoding.
[0109] Step 407: Infrared signal compression and encryption.
[0110] Step 408: Compress and encrypt the infrared signal and store it locally.
[0111] Step 409: End.
[0112] This invention uses two compression methods to compress redundant information in infrared signals. By compressing and encoding infrared signals containing a lot of redundant information, the compression rate can reach 30%-50%, effectively reducing the data storage space requirements, improving storage efficiency, and making it suitable for application scenarios that store large-scale signal data.
[0113] This invention employs the AES128 (ECB-pkcs7padding) encryption algorithm to encrypt data, ensuring the confidentiality and integrity of data stored in infrared signals. The AES algorithm, due to its wide application and security, can resist common attack methods such as man-in-the-middle attacks and brute-force attacks. Infrared signals encrypted with 128-bit AES have an extremely low probability of being cracked, basically meeting the requirements of high-security application scenarios. Compared to simple encryption methods, this represents a qualitative improvement in security.
[0114] This invention reduces the total amount of data to be processed, thereby achieving efficient storage and reducing computational load, thus accelerating data processing and storage efficiency. In low-power real-time embedded devices, reducing data volume and processing time means faster response to input signals, increased system throughput, and better real-time performance.
[0115] This invention significantly reduces storage device utilization by compressing data length, especially in systems that record signals for extended periods. Compared to uncompressed data, the storage cost of this invention is reduced by an average of approximately 20%, thereby extending the lifespan of storage devices. Furthermore, the optimized encryption algorithm consumes fewer computational resources, making it suitable for power-sensitive devices such as IoT terminals and smart home devices.
[0116] In summary, the embodiments of the present invention obtain raw infrared signal data; perform pattern searching on the raw infrared signal data and compress the length according to the pattern search results to obtain compressed data; encrypt the compressed data to obtain encrypted compressed infrared signal data; and store the encrypted compressed infrared signal data. This can effectively reduce the data storage space requirements, improve storage efficiency, and is suitable for application scenarios that store large-scale signal data.
[0117] Figure 7 A schematic diagram of the structure of an infrared signal storage device according to an embodiment of the present invention is shown. Figure 7 As shown, the infrared signal storage device includes: a data acquisition unit 701, a data compression unit 702, and an encrypted storage unit 703. Wherein:
[0118] Data acquisition unit 701 is used to acquire raw infrared signal data;
[0119] The data compression unit 702 is used to perform pattern search on the original infrared signal data and compress the length according to the pattern search result to obtain compressed data.
[0120] The encrypted storage unit 703 is used to encrypt compressed data to obtain encrypted and compressed infrared signal data, and to store the encrypted and compressed infrared signal data.
[0121] This invention, through obtaining raw infrared signal data; performing a pattern search on the raw infrared signal data and compressing its length based on the pattern search results to obtain compressed data; encrypting the compressed data to obtain encrypted and compressed infrared signal data; and storing the encrypted and compressed infrared signal data, can effectively reduce the data storage space requirements, improve storage efficiency, and is suitable for application scenarios that store large-scale signal data.
[0122] This invention provides a non-volatile computer storage medium storing at least one executable instruction that can execute the infrared signal storage method in any of the above method embodiments.
[0123] Executable instructions can specifically be used to cause the processor to perform the following operations:
[0124] Acquire raw infrared signal data;
[0125] The original infrared signal data is subjected to pattern searching, and the length is compressed based on the pattern search results to obtain compressed data.
[0126] The compressed data is encrypted to obtain encrypted and compressed infrared signal data, which is then stored.
[0127] This invention, through obtaining raw infrared signal data; performing a pattern search on the raw infrared signal data and compressing its length based on the pattern search results to obtain compressed data; encrypting the compressed data to obtain encrypted and compressed infrared signal data; and storing the encrypted and compressed infrared signal data, can effectively reduce the data storage space requirements, improve storage efficiency, and is suitable for application scenarios that store large-scale signal data.
[0128] This invention provides a computer program product, which includes a computer program stored on a computer storage medium. The computer program includes program instructions, which, when executed by a computer, cause the computer to perform the infrared signal storage method in any of the above method embodiments.
[0129] Executable instructions can specifically be used to cause the processor to perform the following operations:
[0130] Acquire raw infrared signal data;
[0131] The original infrared signal data is subjected to pattern searching, and the length is compressed based on the pattern search results to obtain compressed data.
[0132] The compressed data is encrypted to obtain encrypted and compressed infrared signal data, which is then stored.
[0133] This invention, through obtaining raw infrared signal data; performing a pattern search on the raw infrared signal data and compressing its length based on the pattern search results to obtain compressed data; encrypting the compressed data to obtain encrypted and compressed infrared signal data; and storing the encrypted and compressed infrared signal data, can effectively reduce the data storage space requirements, improve storage efficiency, and is suitable for application scenarios that store large-scale signal data.
[0134] Figure 8 The diagram shows a schematic of the structure of a computing device provided in an embodiment of the present invention. The specific embodiments of the present invention do not limit the specific implementation of the device.
[0135] like Figure 8As shown, the computing device may include: a processor 802, a communications interface 804, a memory 806, and a communications bus 808.
[0136] The processor 802, communication interface 804, and memory 806 communicate with each other via communication bus 808. Communication interface 804 is used to communicate with other network elements such as clients or other servers. Processor 802 executes program 810, specifically performing the relevant steps in the above-described infrared signal storage method embodiment.
[0137] Specifically, program 810 may include program code that includes computer operation instructions.
[0138] Processor 802 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The device may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0139] Memory 806 is used to store program 810. Memory 806 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0140] Specifically, program 810 can be used to cause processor 802 to perform the following operations:
[0141] Acquire raw infrared signal data;
[0142] The original infrared signal data is subjected to pattern searching, and the length is compressed based on the pattern search results to obtain compressed data.
[0143] The compressed data is encrypted to obtain encrypted and compressed infrared signal data, which is then stored.
[0144] This invention, through obtaining raw infrared signal data; performing a pattern search on the raw infrared signal data and compressing its length based on the pattern search results to obtain compressed data; encrypting the compressed data to obtain encrypted and compressed infrared signal data; and storing the encrypted and compressed infrared signal data, can effectively reduce the data storage space requirements, improve storage efficiency, and is suitable for application scenarios that store large-scale signal data.
[0145] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of the present invention are not directed to any particular programming language. It should be understood that the content of the invention described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the invention.
[0146] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0147] Similarly, it should be understood that, in order to streamline the invention and aid in understanding one or more of the various aspects of the invention, features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof in the above description of exemplary embodiments of the invention. However, this disclosure should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0148] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0149] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
Claims
1. A method for storing infrared signals, characterized in that, The method includes: Acquire raw infrared signal data; Divide the original infrared signal data by a preset value to obtain the infrared signal data after removing the carrier wave; Search for bit0 and bit1 in the infrared signal data after removing the carrier wave; If bit0 or bit1 is found, then the infrared signal data after carrier removal is traversed to find bit0 or bit1 and the first compression method is applied to the infrared signal data after carrier removal to compress the length of bit0 or bit1, so as to obtain compressed data. If bit0 or bit1 is not found, it is determined that the first compression method failed to compress the original infrared signal data. The second compression method is then applied to compress the length of the original infrared signal data to obtain the compressed data. The compressed data is encrypted to obtain encrypted and compressed infrared signal data, and the encrypted and compressed infrared signal data is stored. The step of searching for bit0 and bit1 in the infrared signal data after removing the carrier wave includes: Define a first string, which is bit0[0], bit0[1], bit1[0], bit1[1]; Traverse the infrared signal data after removing the carrier wave, combine every two digits, and determine whether the difference between two consecutive combinations is less than 7. If it is, determine whether bit0[0] and bit0[1] exist in the two combinations; otherwise, continue searching for the first string. If bit0[0] and bit0[1] exist, then continue to determine whether bit1[0] and bit1[1] exist in the two combinations; If bit0[0] and bit0[1] do not exist, then record the first two digits of the two combinations into bit0[0] and bit0[1], and then continue to search for the first string; If bit1[0] and bit1[1] exist, subtract bit0[0] and bit0[1] or bit1[0] and bit1[1] from the first two digits of the two combinations. If the difference is within 7, take the average of the two combinations and update it to bit0[0] and bit0[1] or bit1[0] and bit1[1]. If bit1[0] and bit1[1] do not exist, then the first two digits of the two combinations are recorded in bit1[0] and bit1[1].
2. The method according to claim 1, characterized in that, The process involves iterating through the carrier-removed infrared signal data to find bits 0 and 1, and applying the first compression method to compress the carrier-removed infrared signal data using bits 0 and 1, resulting in compressed data, including: Determine whether the infrared signal data after carrier removal has been completely traversed; If the infrared signal data after carrier removal has not been traversed, it is determined whether it is appropriate to compress the eight-bit data into one byte using bit0 and bit1. If it is appropriate, the infrared signal data after carrier removal is processed before compression; otherwise, the compressed data is stored. If the infrared signal data after carrier removal has been traversed, determine whether to use bit0 and bit1 for data compression. If bit0 and bit1 are used for data compression, then bit0 and bit1 are applied to compress the infrared signal data after removing the carrier wave to obtain the compressed data; otherwise, it is determined that the first compression method has failed to compress the original infrared signal data.
3. The method according to claim 2, characterized in that, The processing of the infrared signal data after carrier removal before compression includes: Determine whether the infrared signal data after carrier removal is greater than 255; if so, add 00 before the infrared signal data after carrier removal, otherwise keep the infrared signal data after carrier removal unchanged. Add ffff and data length to the header of the infrared signal data after removing the carrier wave to obtain integrated infrared signal data, and store the integrated infrared signal data.
4. The method according to claim 1, characterized in that, The second compression method is used to compress the length of the original infrared signal data to obtain the compressed data, including: Define a global variable and divide the original infrared signal data by a preset value to obtain the infrared signal data after removing the carrier wave; Iterate through the carrier-removed infrared signal data and determine whether all the carrier-removed infrared signal data has been traversed. If all the infrared signal data after carrier removal has not been traversed, then determine whether the currently traversed data is greater than 255; If the currently traversed data is greater than 255, then add 00 before the currently traversed data; otherwise, save the currently traversed data. Return to the step of determining whether all the carrier-removed infrared signal data has been traversed; If all the carrier-removed infrared signal data is traversed, the compressed data is obtained.
5. A storage device for infrared signal encryption, characterized in that, The device includes: The data acquisition unit is used to acquire raw infrared signal data; A data compression unit is used to divide the original infrared signal data by a preset value to obtain carrier-removed infrared signal data; search for bit0 and bit1 in the carrier-removed infrared signal data; if bit0 and bit1 are found, the unit iterates through the carrier-removed infrared signal data to find bit0 and bit1 and applies a first compression method to compress the length of the carrier-removed infrared signal data using bit0 and bit1 to obtain compressed data; if bit0 and bit1 are not found, the unit determines that the first compression method has failed to compress the original infrared signal data, and applies a second compression method to compress the length of the original infrared signal data to obtain the compressed data. The data compression unit is also used to define a first string, which is bit0[0], bit0[1], bit1[0], bit1[1]; iterates through the infrared signal data after removing the carrier, combines every two digits, and determines whether the difference between two consecutive combinations is less than 7. If it is, it determines whether bit0[0] and bit0[1] exist in the two combinations; otherwise, it continues to search for the first string; if bit0[0] and bit0[1] exist, it continues to determine whether bit1[0] and bit1[1] exist in the two combinations; if bit0[0] and bit0[1] do not exist, it continues to search for the first string. Record the first two digits of the two combinations into bit0[0] and bit0[1], and then continue to search for the first string; if bit1[0] and bit1[1] exist, subtract bit0[0] and bit0[1] or bit1[0] and bit1[1] from the first two digits of the two combinations. If the difference is within 7, take the average of the two combinations and update it to bit0[0] and bit0[1] or bit1[0] and bit1[1]; if bit1[0] and bit1[1] do not exist, record the first two digits of the two combinations into bit1[0] and bit1[1]. An encrypted storage unit is used to encrypt the compressed data to obtain encrypted and compressed infrared signal data, and to store the encrypted and compressed infrared signal data.
6. A computing device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the steps of the method for storing infrared signals according to any one of claims 1-4.
7. A computer storage medium, characterized in that, The storage medium stores at least one executable instruction that causes a processor to perform the steps of the infrared signal storage method according to any one of claims 1-4.
Citation Information
Patent Citations
Data compression method, device and equipment and computer readable storage medium
CN111262587A
Infrared code compression method and device, intelligent equipment and storage medium
CN116505952A