Air conditioner and control method thereof
By using redundant check codes and remote update technology for updating device codes, the problem of requiring manual on-site visits for air conditioner updates has been solved, achieving efficient and accurate air conditioner updates while reducing costs and error rates.
Patent Information
- Application Number
- CN202411171141.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2026-03-03
AI Technical Summary
Existing air conditioner replacement technology requires manual on-site service, resulting in high time and labor costs, as well as a high failure or error rate.
Redundant check codes and updated device codes are used to remotely update the target device of the air conditioner. The validity of the updated data packet of the air conditioner is checked and the device is identified to ensure the accuracy of the data packet and the correct update of the device.
It reduced labor costs, improved the efficiency and accuracy of air conditioner updates, perfected the update process, avoided update failures and errors, and enhanced the convenience of remote updates.
Smart Images

Figure CN121597236A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of air conditioner technology, and in particular to an air conditioner and its control method. Background Technology
[0002] With the continuous development and maturation of the Internet of Things, big data, and Internet technologies, smart home products have entered thousands of households. As an important part of the home, air conditioners are experiencing expanding market demand and increasing levels of intelligence.
[0003] When an air conditioner's functions fail to meet user needs, its software needs to be updated to keep it up-to-date. However, most existing air conditioner update technologies require on-site service, which is time-consuming, labor-intensive, and involves high human resource costs.
[0004] Therefore, how to achieve rapid and efficient upgrades to air conditioners has become an urgent problem to be solved. Summary of the Invention
[0005] This application provides an air conditioner and its control method to improve the replacement efficiency of the air conditioner.
[0006] To achieve the above objectives, this application adopts the following technical solution.
[0007] In a first aspect, embodiments of this application provide an air conditioner, including: an outdoor unit; a peripheral device communicatively connected to the outdoor unit; a controller connected to both the outdoor unit and the peripheral device; the controller being configured to: acquire an update data packet of the air conditioner; determine a redundancy check code and an update device code for the update data packet; determine whether the update data packet is valid based on the redundancy check code; and update the target device corresponding to the update device code if the update data packet is valid; the target device is the outdoor unit or a peripheral device communicatively connected to the outdoor unit.
[0008] The technical solution provided in this application provides at least the following beneficial effects: This technical solution updates the target device based on the air conditioner's update data packet, avoiding the time and effort spent by staff on on-site updates and reducing labor costs; at the same time, determining the target device to be updated based on the update device code also avoids update failures or errors caused by updating other non-target devices, thus improving the air conditioner update process and enhancing the convenience of remote updates; furthermore, since the redundancy check code of the update data packet can detect whether there are errors in the data during transmission, the validity of the update data packet is checked by using the redundancy check code, avoiding the problem of update failure due to invalid update data packets, thus improving the update accuracy and efficiency of the target device.
[0009] In some embodiments, the update data packet includes a header file and a data file; the controller determines the redundancy check code of the update data packet by: determining the starting position of the data file based on the file size of the header file; and determining the redundancy check code of the update data packet based on the file size of the update data packet and the starting position of the data file.
[0010] In some embodiments, the data file is a decompressed data file or a compressed data file; the redundancy check code includes a high-byte redundancy check code and a low-byte redundancy check code; the controller determines whether the update data packet is valid based on the redundancy check code, specifically configured as follows: when the data file is a decompressed data file, if the encoding length of the high-byte redundancy check code is equal to the encoding length of the low-byte redundancy check code, the update data packet is determined to be valid; when the data file is a compressed data file, the data file is decompressed, and if the encoding length of the high-byte redundancy check code before decompression is equal to the encoding length of the low-byte redundancy check code before decompression, the encoding length of the high-byte redundancy check code after decompression, and the encoding length of the low-byte redundancy check code after decompression, the update data packet is determined to be valid.
[0011] In some embodiments, the header file includes decompression parameters for adjusting the compression ratio of the update data packet; the controller decompresses the data file, specifically configured to decompress the update data packet byte by byte according to the decompression parameters and the file size of the data file.
[0012] In some embodiments, the update data packet further includes an update version number; the controller updates the target device corresponding to the update device code, specifically configured as follows: if the target device corresponding to the update device code is an outdoor unit, the outdoor unit is updated if its version number includes the update version number; if the target device corresponding to the update device code is a peripheral device, the update data packet is sent to the peripheral device to update the peripheral device.
[0013] Secondly, embodiments of this application provide a control method for an air conditioner, the method comprising: acquiring an update data packet of the air conditioner; determining a redundancy check code and an update device code for the update data packet; determining whether the update data packet is valid based on the redundancy check code; and updating the target device corresponding to the update device code if the update data packet is valid; the target device is an outdoor unit or a peripheral device that is communicatively connected to the outdoor unit.
[0014] In some embodiments, the update data packet includes a header file and a data file; determining the redundancy check code of the update data packet includes: determining the starting position of the data file based on the file size of the header file; and determining the redundancy check code of the update data packet based on the file size of the update data packet and the starting position of the data file.
[0015] In some embodiments, the data file is a decompressed data file or a compressed data file; the redundancy check code includes a high-byte redundancy check code and a low-byte redundancy check code; determining whether the update data packet is valid based on the redundancy check code includes: if the data file is a decompressed data file, and the encoding length of the high-byte redundancy check code is equal to the encoding length of the low-byte redundancy check code, then the update data packet is valid; if the data file is a compressed data file, the data file is decompressed, and if the encoding length of the high-byte redundancy check code before decompression is equal to the encoding length of the low-byte redundancy check code before decompression, the encoding length of the high-byte redundancy check code after decompression, and the encoding length of the low-byte redundancy check code after decompression, then the update data packet is valid.
[0016] In some embodiments, the header file includes decompression parameters for adjusting the compression ratio of the update data packet; decompressing the data file includes: decompressing the update data packet byte by byte according to the decompression parameters and the file size of the data file.
[0017] In some embodiments, the update data packet further includes an update version number; updating the target device corresponding to the update device code includes: if the target device corresponding to the update device code is an outdoor unit, updating the outdoor unit if the version number of the outdoor unit includes the update version number; if the target device corresponding to the update device code is a peripheral device, sending the update data packet to the peripheral device to update the peripheral device.
[0018] Thirdly, embodiments of this application provide a controller, including: one or more processors; one or more memories; wherein the one or more memories are used to store computer program code, the computer program code including computer instructions, and when the one or more processors execute the computer instructions, the controller executes any of the air conditioner control methods provided in the second aspect.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium including computer instructions that, when executed on a computer, cause the computer to perform any of the air conditioner control methods provided in the second aspect.
[0020] Fifthly, embodiments of the present invention provide a computer program product that can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can implement the methods provided in the second aspect and possible implementations.
[0021] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on a computer-readable storage medium. This computer-readable storage medium may be packaged together with the controller's processor, or it may be packaged separately from the controller's processor; this application does not impose any limitations on this.
[0022] The beneficial effects described in aspects two through five of this application can be referred to the analysis of the beneficial effects of aspect one, and will not be repeated here. Attached Figure Description
[0023] The accompanying drawings are provided to further understand the technical solutions of the present invention and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of the present invention and do not constitute a limitation on the technical solutions of the present invention.
[0024] Figure 1 This is a schematic diagram of the structure of an air conditioner provided in an embodiment of this application;
[0025] Figure 2 A hardware configuration block diagram of an air conditioner provided in an embodiment of this application;
[0026] Figure 3 This application provides a schematic diagram of the control flow of an air conditioner controller.
[0027] Figure 4 A schematic diagram illustrating the format of an update data packet provided in an embodiment of this application;
[0028] Figure 5 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application;
[0029] Figure 6 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application;
[0030] Figure 7 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application;
[0031] Figure 8 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application;
[0032] Figure 9 This is a schematic flowchart of a control method for an air conditioner provided in an embodiment of this application;
[0033] Figure 10 This is a schematic diagram of another air conditioner provided in an embodiment of this application;
[0034] Figure 11 This is a schematic diagram of another air conditioner provided in an embodiment of this application;
[0035] Figure 12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0036] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0037] It should be noted that all directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present invention are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indication will also change accordingly.
[0038] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0039] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "connected" and "linked" should be interpreted broadly, for example, as a fixed connection, a detachable connection, or an integral connection. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. Furthermore, when describing pipelines, the terms "connected" and "linked" as used in this application have the meaning of establishing electrical connection. The specific meaning needs to be understood in conjunction with the context.
[0040] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0041] To facilitate understanding, we will first provide a brief introduction and explanation of some terms or basic concepts of technology involved in the embodiments of the present invention.
[0042] As mentioned above, existing methods for upgrading air conditioners are time-consuming, labor-intensive, and require a large amount of manpower.
[0043] Based on this, embodiments of this application provide an air conditioner and its control method, which remotely updates the target device according to a redundancy check code and an update device code. This reduces labor costs and improves the update efficiency of the air conditioner.
[0044] The embodiments provided in this application will now be described in detail with reference to the accompanying drawings.
[0045] Figure 1 This is a schematic diagram of the structure of an air conditioner provided as an example of an embodiment of this application, such as... Figure 1 As shown, the air conditioner 1 includes an outdoor unit 2.
[0046] It should be noted that the air conditioner can be a multi-split air conditioner, a central air conditioner, etc., and this application does not limit the type of air conditioner.
[0047] As a feasible implementation method, the air conditioner 1 and the remote control 4 are connected by communication.
[0048] As a feasible implementation method, outdoor unit 2 is usually installed outdoors for heat exchange in the indoor environment.
[0049] In some embodiments, the air conditioner 1 includes peripheral equipment 3.
[0050] Peripheral device 3, which communicates with outdoor unit 2, can be an indoor unit, a programmable device, a near field communication (NFC) module, etc. This application does not limit the number or type of devices included in peripheral device 3.
[0051] In some embodiments, the air conditioner 1 includes a transceiver module 5 ( Figure 1 (Not shown in the image), used to acquire or send data.
[0052] Figure 2 This is a hardware configuration block diagram of an air conditioner provided according to an exemplary embodiment of this application. For example... Figure 2 As shown, the air conditioner 1 may also include a controller 1000.
[0053] As a feasible implementation method, the controller 1000 is connected to the outdoor unit 2 and the peripheral equipment 3 respectively. It is the control center of the air conditioner 1. It connects various parts of the air conditioner 1 through various interfaces and lines. It executes various programs of the air conditioner 1 by running or executing programs stored in the memory and calling data stored in the memory.
[0054] As one possible implementation, the controller 1000 may include one or more processing units 1001.
[0055] In the embodiments shown in this application, controller 1000 refers to a device that can generate operation control signals according to instruction opcodes and timing signals, instructing air conditioner 1 to execute control commands. Exemplarily, controller 1000 can be a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. Controller 1000 can also be other devices with processing functions, such as circuits, devices, or software modules; this application does not impose any limitations on this.
[0056] In addition, the controller 1000 can be used to control the various components inside the air conditioner 1 so that each component can operate to achieve the predetermined functions of the air conditioner 1.
[0057] In some embodiments, such as Figure 2 As shown, the controller 1000 includes a communication unit 1002.
[0058] In some embodiments, the communication unit 1002 is used to establish a communication connection with other network entities, such as establishing a communication connection with a terminal device. The communication unit 1002 may include a radio frequency (RF) module, a cellular module, a wireless fidelity (WIFI) module, and a GPS module, etc. Taking an RF module as an example, the RF module can be used for signal reception and transmission; specifically, it sends received information to the controller 1000 for processing; additionally, it transmits signals generated by the controller 1000. Typically, the RF circuit may include, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc.
[0059] In some embodiments, such as Figure 2 As shown, the controller 1000 also includes a storage unit 1003.
[0060] In some embodiments, the storage unit 1003 can be used to store software programs and data. The controller 1000 executes various functions of the air conditioner 1 and data processing by running the software programs or data stored in the storage unit 1003. The storage unit 1003 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The storage unit 1003 stores an operating system that enables the air conditioner 1 to run. In this application, the storage unit 1003 may store the operating system and various applications, and may also store code that executes the control method of the air conditioner 1 provided in the embodiments of this application.
[0061] Those skilled in the art will understand that Figure 2 The hardware structure shown does not constitute a limitation on the air conditioner 1. The air conditioner 1 may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0062] As a feasible implementation method, the air conditioner 1 communicates with the remote controller 4 through the communication unit 1002.
[0063] In some embodiments, the remote controller 4 has the function of communicating with the controller 1000, for example, using infrared or other communication methods. Users can set various operating parameters of the air conditioner 1 using the remote controller 4.
[0064] Figure 3 This is a schematic diagram of the control flow of an air conditioner controller provided in an embodiment of this application, as shown below. Figure 3 As shown, the controller is configured to execute steps S101-S104:
[0065] S101, The controller obtains the update data packet of the air conditioner.
[0066] As one feasible approach, update data packages are used to remotely upgrade the target device of the air conditioner via over-the-air (OTA) technology. It should be understood that the target device is the outdoor unit or any peripheral device.
[0067] It should be noted that the peripheral device that communicates with the outdoor unit can be a programmable controller, an indoor unit, a near field communication (NFC) module, or other devices that have a communication connection with the outdoor unit. This application does not limit this.
[0068] In some embodiments, due to format mismatch issues in the original data packets, the controller may not be able to correctly identify or use them. Therefore, upon receiving the original update data packet from the cloud or server, the controller can determine whether it is a data packet with a preset format. If not, the original update data packet needs to be compressed and re-edited to generate a fixed-format update data packet. This updated data packet is then used to remotely upgrade the target device of the air conditioner, ensuring that the data format of the update data packet is more compatible with the target device.
[0069] As a feasible implementation method, the fixed-format update data packet can be a binary (Bin) data packet. Figure 4 This is a schematic diagram illustrating the format of an update data packet provided in an embodiment of this application, such as... Figure 4 As shown, the Bin update data package includes a header file (Bin head) and a data file (Bin data).
[0070] The Bin head includes the following parameters: ucBinHeadSize, ucPreBufSizeBits, ucDecodeBincrcHi, ucDecodeBincrcLo, ucEncodeBincrcHi, ucEncodeBincrcLo, ucNotCompress, ucReserve, ulEncodeSize, ulDecodeSize, ulRealBinSize, ucOTAExecuteState, ucOTATarget, and usOTARom.
[0071] Among them, the parameter ucBinHeadSize represents the file size of the Bin head and is used to locate the offset of the starting address of the Bin data; the parameter ucPreBufSizeBits is a decompression parameter, which can be adjusted to change the compression ratio of the Bin update data packet; the parameter ucDecodeBincrcHi is the high byte of the cyclic redundancy check (CRC) code after the Bin data is decompressed; the parameter ucDecodeBincrcLo is the low byte of the CRC code after the Bin data is decompressed; the parameter ucEncodeBincrcHi is the high byte of the CRC code after the Bin data is decompressed; the parameter ucEncodeBincrcLo is the low byte of the CRC code after the Bin data is decompressed; the parameter ucNotCompress is the data type of the Bin data (compressed or decompressed); the parameter ucReserve is the reserved space for the Bin update data packet; the parameter ulEncodeSize is the data size of the decompressed Bin data; and the parameter ulDecodeSize is the size of the compressed Bin data. The data size of the data packet; the parameter ulRealBinSize is the data size of the original Bin update data packet; the parameter ucOTAExecuteState indicates the execution status of the OTA; the parameter ucOTATarget is the target device that needs to be upgraded by OTA; the parameter usOTARom is the read-only memory (ROM) version number of the target device that needs to be upgraded by OTA.
[0072] It should be noted that in specific implementations, the Bin header file can include more or fewer parameters, and this application does not impose any restrictions on this.
[0073] In some embodiments, when the controller receives an update data packet sent by the cloud or server, it can save the update data packet to the flash memory in the microcontroller unit (MCU) so that the controller can determine the redundancy check code and update the device code from the update data packet.
[0074] S102, The controller determines the redundancy check code and update device code of the update data packet.
[0075] In some embodiments, the data file type of the update data packet varies, and the corresponding redundancy check code also varies.
[0076] It should be noted that redundancy check code, also known as cyclic redundancy check code, is a check code used to detect whether there are errors in data during transmission. It detects and corrects errors by adding redundant bits, ensuring the correctness and integrity of data transmission.
[0077] As a feasible implementation method, the controller can determine the CRC of the data file Bindata using the CRC32 lookup table method.
[0078] It should be noted that CRC32 checksum is a hash function that generates a short, fixed-length checksum based on data such as network packets or computer files. It is mainly used to detect or verify errors that may occur after data transmission or storage. The CRC32 lookup table method calculates the CRC quickly by pre-compiling a lookup table containing 256 entries and using XOR operations and the lookup table.
[0079] As a feasible implementation, the sending end needs to add redundant information (i.e., a CRC checksum) to the end of the data packet to achieve error detection. The CRC checksum is generated by the sending end performing a modulo-2 division operation on the data to be sent (considered a binary bit string) with a predefined generator polynomial, producing a checksum (remainder). This checksum is appended to the end of the data and sent to the receiving end. The CRC checksum is essentially a mathematical representation of the original data, containing crucial information about its integrity. Therefore, when errors occur during data transmission, the CRC checksum helps the receiving end identify the errors.
[0080] As one feasible approach, the data file type can be determined using parameters in the header file that characterize the data type (e.g., parameters in the Bin header file).
[0081] Does ucNotCompress decompress or compress a data file?
[0082] Furthermore, when the data file is a decompressed data file, the redundancy check code corresponding to the updated data packet is the decompression high byte redundancy check code and the decompression low byte redundancy check code.
[0083] Alternatively, when the data file is a compressed data file, the redundancy check code corresponding to the update data packet is a compressed high-byte redundancy check code and a compressed low-byte redundancy check code.
[0084] As one feasible approach, update the device code, which is the ROM version number of the target device pointed to by the parameter usOTARom.
[0085] S103. The controller determines whether the update data packet is valid based on the redundancy check code.
[0086] As a feasible implementation, the controller uses the same algorithm and parameters as the sender when calculating the redundancy check code to recalculate the check code on the original data and compares it with the received check code. If they match, the data is considered to have been transmitted without error and is valid. If they do not match, the data is considered to have been corrupted and requires further processing (such as error correction or retransmission requests).
[0087] In some embodiments, the redundancy check codes included in the update data packets are different due to the different types of update data packets, such as 8-bit, 16-bit, and 32-bit redundancy check codes. Therefore, it is necessary to determine the redundancy check codes according to the different types of data files of the update data packets. The solution provided in this application embodiment can determine the redundancy check code corresponding to the update data packet according to the different types of data files of the update data packet, and then determine whether the update data packet is valid based on the redundancy check code.
[0088] As a feasible approach, if the data file Bin data is of type decompressed data file, the starting position of the data file Bin data can be determined based on the parameters (such as parameter ucBinHeadSize) in the header file Bin head that represent the size of the header file Bin head.
[0089] Furthermore, based on the parameter ulRealBinSize in the Bin header and the starting address of the Bin data file, the Bin data file is read, and the CRC of the Bin data file is determined.
[0090] Furthermore, after determining the redundancy check codes corresponding to the decompressed data file and the compressed data file, the validity of the update data packet is determined based on the encoding length of the redundancy check codes corresponding to the decompressed data file and the compressed data file.
[0091] It should be noted that the redundancy check code is a fixed code obtained through a series of calculations or table lookups. Since data files may be lost or corrupted during compression or decompression, the redundancy check code before and after compression or decompression may be inconsistent. In this case, the update data packet cannot be used to update the target device. Therefore, the validity of the update data packet can be determined based on the encoding length of the redundancy check code before and after compression or decompression.
[0092] As a feasible implementation method, if the encoding length of the high-byte redundancy check code is equal to the encoding length of the low-byte redundancy check code when the data file is a decompressed data file, the updated data packet is determined to be valid.
[0093] For example, taking a redundancy check code with a coding length of 32 bits as an example, the first 16 bits are the high byte redundancy check code and the last 16 bits are the low byte redundancy check code. If the coding length of the high byte redundancy check code is equal to the coding length of the low byte redundancy check code (that is, both are 16 bits), it means that the data in the update data packet is accurate and complete, and the update data packet is determined to be valid.
[0094] Alternatively, if the data file is an uncompressed data file, and the encoding length of the high-byte redundancy check code is not equal to the encoding length of the low-byte redundancy check code, the update data packet is determined to be invalid.
[0095] For example, if the encoding length of the high byte redundancy check code is 16 bits and the encoding length of the low byte redundancy check code is 15 bits, that is, the encoding lengths of the high byte redundancy check code and the low byte redundancy check code are not equal, then there may be data loss or omission in the update data packet, and the update data packet is determined to be invalid.
[0096] As a feasible implementation method, when the data file is a compressed data file, the data file is decompressed. If the encoding length of the high byte redundancy check code before decompression is equal to the encoding length of the low byte redundancy check code before decompression, the encoding length of the high byte redundancy check code after decompression, and the encoding length of the low byte redundancy check code after decompression, the updated data packet is determined to be valid.
[0097] For example, taking a redundancy check code with a coding length of 32 bits as an example, the first 16 bits are the high byte redundancy check code and the last 16 bits are the low byte redundancy check code. If the coding length of the high byte redundancy check code before decompression, the coding length of the low byte redundancy check code after decompression, and the coding length of the low byte redundancy check code after decompression are all equal (i.e., all are 16 bits), it indicates that the data in the update data packet is accurate and complete, and the update data packet is determined to be valid.
[0098] Alternatively, if the data file is a compressed data file, decompress the data file. If any two of the following are not equal: the encoding length of the high-byte redundancy check code before decompression, the encoding length of the low-byte redundancy check code before decompression, the encoding length of the high-byte redundancy check code after decompression, and the encoding length of the low-byte redundancy check code after decompression, the update data packet is determined to be invalid.
[0099] For example, if the encoding length of the high byte redundancy check code before decompression is 16 bits, the encoding length of the low byte redundancy check code is 15 bits, the encoding length of the high byte redundancy check code after decompression is 16 bits, and the encoding length of the low byte redundancy check code after decompression is 16 bits, then there may be data loss or omission in the update data packet, and the update data packet is determined to be invalid.
[0100] S104. If the update data packet is valid, the controller updates the target device corresponding to the update device code.
[0101] The target device is the outdoor unit or a peripheral device that communicates with the outdoor unit.
[0102] As a feasible approach, if the target device corresponding to the updated device code is an outdoor unit, the outdoor unit is updated if its version number includes the update version number.
[0103] For example, if the outdoor unit's version number is V8.2.1 and the updated version number is V8.2, the controller updates the outdoor unit according to the update data packet.
[0104] As a feasible implementation method, if the target device corresponding to the updated device code is a peripheral device, the update data packet is sent to the peripheral device to update the peripheral device.
[0105] The peripheral equipment includes at least one device of the same type.
[0106] For example, if the target devices corresponding to the updated device code are indoor unit A and indoor unit B, the controller will send the update data packet to indoor unit A and indoor unit B, and update indoor unit A and indoor unit B respectively based on the update data packet.
[0107] In some embodiments, Figure 5 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application, as shown below. Figure 5 As shown, the controller is also configured to execute step S105:
[0108] S105. If the update data packet is invalid, issue an invalid reminder to the user.
[0109] As a feasible implementation method, the invalid reminder can be a text reminder, such as "The current update data packet is invalid" or "The current data packet is unavailable"; or it can be a voice reminder, prompting the user to resend the update data packet and execute the above steps S101-S104.
[0110] The technical solution provided in this application provides at least the following beneficial effects: This technical solution updates the target device based on the air conditioner's update data packet, avoiding the time and effort spent by staff on on-site updates and reducing labor costs; at the same time, determining the target device to be updated based on the update device code also avoids update failures or errors caused by updating other non-target devices, thus improving the air conditioner update process and enhancing the convenience of remote updates; furthermore, since the redundancy check code of the update data packet can detect whether there are errors in the data during transmission, the validity of the update data packet is checked by using the redundancy check code, avoiding the problem of update failure due to invalid update data packets, thus improving the update accuracy and efficiency of the target device.
[0111] In some embodiments, Figure 6 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application, used to determine the redundancy check code of the update data packet, such as... Figure 6 As shown, the controller is configured to execute steps S201-S202:
[0112] S201. The controller determines the starting position of the data file based on the file size of the header file.
[0113] The file size of the header file is determined by parameters used in the header file to characterize the file size, such as the parameter ucBinHeadSize.
[0114] For example, if the size of the Bin update data packet file is 8 and the size of the header file is 3, then the starting position of the data file is 4; if the size of the header file is 2, then the starting position of the data file is 3.
[0115] S202. The controller determines the redundancy check code of the update data packet based on the file size of the update data packet and the starting position of the data file.
[0116] As a feasible approach, if the data file is a decompressed data file, the data file is read starting from the beginning of the data file, and the decompression redundancy check code of the data file is determined at the same time.
[0117] It should be noted that the redundancy check code of the data file can be included in the data file. After the data file is determined, the controller can directly obtain the parameters used to characterize the redundancy check code (such as the parameter containing the byte "Bincrc") to determine the redundancy check code, or it can be determined by the controller based on the CRC32 lookup table method. For details on the specific implementation of the CRC32 lookup table method, please refer to steps S401-S404 below, which will not be repeated here.
[0118] As a feasible implementation method, if the data file is a compressed data file, the data file is decompressed byte by byte according to the decompression parameters (such as parameter ucPreBufSizeBits) used to characterize the compression ratio in the header file and the file size of the data file. The data file is read from the beginning of the decompressed data file, and the decompression redundancy check code of the data file is determined at the same time.
[0119] In some embodiments, the controller is configured such that step S103 described above can also be specifically configured as follows: Figure 7 The steps shown, Figure 7 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application, used to determine whether the update data packet is valid, such as... Figure 7 As shown, the controller is configured to execute steps S301-S302:
[0120] S301. If the data file is a decompressed data file, and the encoding length of the high byte redundancy check code is equal to the encoding length of the low byte redundancy check code, the updated data packet is determined to be valid.
[0121] It should be noted that the total length (N bits) of the CRC encoding is the result of adding the length of the original update data packet (K bits) to the length of the CRC code (R bits), i.e., N = K + R. The R bits of the CRC code are calculated based on the generator polynomial G(x), whose highest power is R.
[0122] In some embodiments, when the data file is a decompressed data file, if the encoding length of the high-byte redundancy check code is not equal to the encoding length of the low-byte redundancy check code, the update data packet is determined to be invalid.
[0123] S302. If the data file is a compressed data file, decompress the data file. If the encoding length of the high byte redundancy check code before decompression is equal to the encoding length of the low byte redundancy check code before decompression, the encoding length of the high byte redundancy check code after decompression, and the encoding length of the low byte redundancy check code after decompression, then the updated data packet is determined to be valid.
[0124] In some embodiments, when the data file is a compressed data file, the data file is decompressed. If any two of the following redundancy check codes are not equal: the encoding length of the high-byte redundancy check code before decompression, the encoding length of the low-byte redundancy check code before decompression, the encoding length of the high-byte redundancy check code after decompression, and the encoding length of the low-byte redundancy check code after decompression, the update data packet is determined to be invalid.
[0125] In some embodiments, the controller is configured to determine the redundancy check code using a CRC32 lookup table method, and may also be specifically configured as follows: Figure 8The steps shown, Figure 8 This is a schematic diagram of the control flow of another air conditioner controller provided in an embodiment of this application, as shown below. Figure 8 As shown, the controller is specifically configured to execute steps S404-S404:
[0126] S401, Pre-calculated lookup table.
[0127] Specifically, based on the CRC32 generator polynomial (usually 0x04C11DB7), a lookup table containing 256 entries is pre-computed, with each entry corresponding to an 8-bit input value (0 to 255) and its CRC32 check result.
[0128] S402, Input data processing.
[0129] Specifically, the data to be verified is subjected to XOR operation and byte reversal processing, and the processed data is matched one-to-one with the index of the lookup table.
[0130] S403, Lookup table query.
[0131] Specifically, the processed data is used as an index to look up the corresponding CRC32 check value in the lookup table (starting from the initial position of the table (i.e., the initial CRC value, usually 0xFFFFFFFF)). Steps S402-S403 are repeated until all bytes of the data have been processed.
[0132] S404, Combination Result.
[0133] Specifically, the values retrieved from the lookup table are combined to form the final CRC32 check value, i.e., the redundancy check code.
[0134] This method of determining the redundancy check code avoids a large number of modulo-2 division operations, significantly improving the calculation speed of CRC. Moreover, the algorithm logic is clear, easy to understand and implement, and can be applied to various scenarios that require data verification, such as file transfer and network communication.
[0135] It should be noted that when using the CRC32 lookup table method, it is necessary to ensure that the generator polynomial used is consistent with the polynomial used when generating the table. In some special application scenarios, it may be necessary to consider the CRC inversion issue, that is, the input and output order of data may be different from the standard CRC algorithm.
[0136] This application also provides a method for controlling an air conditioner, wherein the air conditioner includes: an outdoor unit; peripheral devices communicatively connected to the outdoor unit; and a controller communicatively connected to both the outdoor unit and the peripheral devices.
[0137] Please see Figure 9 The control method includes the following steps:
[0138] S501, Obtain the update data package for the air conditioner.
[0139] As one feasible approach, updating the data package includes header files and data files.
[0140] As one possible implementation, the header file may include the following parameters: ucBinHeadSize, ucPreBufSizeBits, ucDecodeBincrcHi, ucDecodeBincrcLo, ucEncodeBincrcHi, ucEncodeBincrcLo, ucNotCompress, ucReserve, ulEncodeSize, ulDecodeSize, ulRealBinSize, ucOTAExecuteState, ucOTATarget, and usOTARom.
[0141] S502. Determine the redundancy check code and update device code of the update data packet.
[0142] When the data file is an uncompressed data file, the redundancy check code corresponding to the update data packet is the decompression high byte redundancy check code and the decompression low byte redundancy check code.
[0143] Alternatively, when the data file is a compressed data file, the redundancy check code corresponding to the update data packet is a compressed high-byte redundancy check code and a compressed low-byte redundancy check code.
[0144] S503. Based on the redundancy check code, determine whether the update data packet is valid.
[0145] If the data file is an uncompressed data file, and the encoding length of the high-byte redundancy check code is equal to the encoding length of the low-byte redundancy check code, then the updated data packet is considered valid.
[0146] Alternatively, if the data file is a compressed data file, decompress the data file. If the encoding length of the high-byte redundancy check code before decompression is equal to the encoding length of the low-byte redundancy check code before decompression, the encoding length of the high-byte redundancy check code after decompression, and the encoding length of the low-byte redundancy check code after decompression, then the updated data packet is determined to be valid.
[0147] S504. If the update data packet is valid, update the target device corresponding to the update device code.
[0148] The target device is the outdoor unit or a peripheral device that communicates with the outdoor unit.
[0149] As a feasible approach, if the target device corresponding to the updated device code is an outdoor unit, the outdoor unit is updated if its version number includes the update version number.
[0150] As a feasible implementation method, if the target device corresponding to the updated device code is a peripheral device, the update data packet is sent to the peripheral device to update the peripheral device.
[0151] The peripheral equipment includes at least one device of the same type.
[0152] In this embodiment of the invention, electronic products can be divided into functional modules according to the above method examples. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0153] When dividing each function into modules according to its corresponding function. Figure 10 This is a schematic diagram of another air conditioner provided in an embodiment of this application, as shown below. Figure 10 As shown, the air conditioner 1 may include: an acquisition module 201, a determination module 202, and an update module 203.
[0154] In some embodiments, the acquisition module 201 is used to acquire the update data packet of the air conditioner.
[0155] In some embodiments, the determining module 202 is used to determine the redundancy check code and the update device code of the update data packet;
[0156] As a feasible implementation method, module 202 is also used to determine whether the update data packet is valid based on the redundancy check code;
[0157] In some embodiments, the update module 203 is used to update the target device corresponding to the update device code when the update data packet is valid; the target device is an outdoor unit or a peripheral device that is communicatively connected to the outdoor unit.
[0158] As a feasible implementation method, module 202 is also used to determine the starting position of the data file based on the file size of the header file.
[0159] As a feasible implementation method, the determination module 202 is also used to determine the redundancy check code of the update data packet based on the file size of the update data packet and the starting position of the data file.
[0160] As a feasible implementation method, the determination module 202 is also used to determine that the updated data packet is valid if the encoding length of the high byte redundancy check code is equal to the encoding length of the low byte redundancy check code when the data file is a decompressed data file.
[0161] As a feasible implementation method, module 202 is also used to decompress the data file when the data file is a compressed data file. If the encoding length of the high byte redundancy check code before decompression is equal to the encoding length of the low byte redundancy check code before decompression, the encoding length of the high byte redundancy check code after decompression, and the encoding length of the low byte redundancy check code after decompression, the updated data packet is determined to be valid.
[0162] In some embodiments, the air conditioner 1 may also include a decompression module 204.
[0163] In some embodiments, the decompression module 204 is used to decompress the update data packet byte by byte according to the decompression parameters and the file size of the data file.
[0164] As a feasible implementation method, the update module 203 is also used to update the outdoor unit if the target device corresponding to the update device code is an outdoor unit and the version number of the outdoor unit includes the update version number.
[0165] As a feasible implementation method, the update module 203 is also used to send the update data packet to the peripheral device and update the peripheral device if the target device corresponding to the update device code is a peripheral device.
[0166] Figure 11 This is a schematic diagram of another air conditioner provided in an embodiment of this application, as shown below. Figure 11 As shown, the air conditioner may also include a processing module 205, a storage module 206, and a communication module 207.
[0167] In some embodiments, processing module 205 may be a processor or a controller. Storage module 206 may be a memory. Communication module 207 may be a transceiver, transceiver circuit, or communication interface, etc.
[0168] In this configuration, when the processing module 205 is a processor, the storage module 206 is a memory, and the communication module 207 is a transceiver, the processor, transceiver, and memory can be connected via a bus. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc.
[0169] This application also provides an electronic device; please refer to [link / reference]. Figure 12 The electronic device 180 includes: one or more processors 1801; one or more memories 1802, wherein the one or more memories 1802 are used to store computer program code, the computer program code including computer instructions; when the one or more processors 1801 execute the computer instructions, the electronic device 180 performs the various steps of the method shown in the above method embodiments.
[0170] This invention also provides a computer-readable storage medium including computer-executable instructions that, when executed on a computer, cause the computer to perform the method provided in the above embodiments.
[0171] This invention also provides a computer program product that can be directly loaded into a memory and contains software code. After being loaded and executed by a computer, the computer program product can implement the methods provided in the above embodiments.
[0172] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in this invention can be implemented using hardware, software, firmware, or any combination thereof. When implemented in software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or code on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any medium that facilitates the transfer of a computer program from one place to another. Storage media can be any available medium accessible to a general-purpose or special-purpose computer.
[0173] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0174] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely exemplary; for instance, the division of modules or units is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed between each other may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate; components shown as units may be one physical unit or multiple physical units, i.e., they may be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0176] The above are merely specific embodiments of this application, and the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. An air conditioner, characterized in that, include: Outdoor unit; Peripheral devices that are communicatively connected to the outdoor unit; The controller is connected to both the outdoor unit and the peripheral equipment. The controller is configured as follows: Obtain the update data packet of the air conditioner; Determine the redundancy check code and update device code of the update data packet; Based on the redundancy check code, determine whether the updated data packet is valid; If the update data packet is valid, the target device corresponding to the update device code is updated; the target device is the outdoor unit or the peripheral device.
2. The air conditioner according to claim 1, characterized in that, The update data package includes a header file and a data file; The controller is configured to determine the redundancy check code of the update data packet, specifically configured as follows: The starting position of the data file is determined based on the file size of the header file; The redundancy check code of the update data packet is determined based on the file size of the update data packet and the starting position of the data file.
3. The air conditioner according to claim 2, characterized in that, The data file is a decompressed data file or a compressed data file; the redundancy check code includes a high-byte redundancy check code and a low-byte redundancy check code. The controller is configured to determine whether the update data packet is valid based on the redundancy check code, specifically configured as follows: If the data file is the decompressed data file, and the encoding length of the high-byte redundancy check code is equal to the encoding length of the low-byte redundancy check code, then the updated data packet is determined to be valid. If the data file is a compressed data file, the data file is decompressed. If the encoding length of the high-byte redundancy check code before decompression is equal to the encoding length of the low-byte redundancy check code before decompression, the encoding length of the high-byte redundancy check code after decompression, and the encoding length of the low-byte redundancy check code after decompression, the updated data packet is determined to be valid.
4. The air conditioner according to claim 3, characterized in that, The header file includes decompression parameters used to adjust the compression ratio of the update data packet; The controller is configured to decompress the data file, specifically configured as follows: The update data packet is decompressed byte by byte according to the decompression parameters and the file size of the data file.
5. The air conditioner according to claim 1, characterized in that, The update data packet also includes an update version number; The controller is configured to update the target device corresponding to the updated device code, specifically configured as follows: If the target device corresponding to the updated device code is the outdoor unit, the outdoor unit is updated if the version number of the outdoor unit includes the updated version number; If the target device corresponding to the updated device code is the peripheral device, the update data packet is sent to the peripheral device to update the peripheral device.
6. A control method for an air conditioner, characterized in that, The method includes: Obtain the update data packet of the air conditioner; Determine the redundancy check code and update device code of the update data packet; Based on the redundancy check code, determine whether the updated data packet is valid; If the update data packet is valid, the target device corresponding to the update device code is updated; the target device is an outdoor unit or a peripheral device that is communicatively connected to the outdoor unit.
7. The method according to claim 6, characterized in that, The update data package includes a header file and a data file; Determining the redundancy check code of the updated data packet includes: The starting position of the data file is determined based on the file size of the header file; The redundancy check code of the update data packet is determined based on the file size of the update data packet and the starting position of the data file.
8. The method according to claim 7, characterized in that, The data file is a decompressed data file or a compressed data file; the redundancy check code includes a high-byte redundancy check code and a low-byte redundancy check code. The step of determining whether the updated data packet is valid based on the redundancy check code includes: If the data file is the decompressed data file, and the encoding length of the high-byte redundancy check code is equal to the encoding length of the low-byte redundancy check code, then the updated data packet is determined to be valid. If the data file is a compressed data file, the data file is decompressed. If the encoding length of the high-byte redundancy check code before decompression is equal to the encoding length of the low-byte redundancy check code before decompression, the encoding length of the high-byte redundancy check code after decompression, and the encoding length of the low-byte redundancy check code after decompression, the updated data packet is determined to be valid.
9. The method according to claim 8, characterized in that, The header file includes decompression parameters used to adjust the compression ratio of the update data packet; The decompression of the data file includes: The update data packet is decompressed byte by byte according to the decompression parameters and the file size of the data file.
10. The method according to claim 6, characterized in that, The update data packet also includes an update version number; The step of updating the target device corresponding to the updated device code includes: If the target device corresponding to the updated device code is the outdoor unit, the outdoor unit is updated if the version number of the outdoor unit includes the updated version number; If the target device corresponding to the updated device code is the peripheral device, the update data packet is sent to the peripheral device to update the peripheral device.