CN111478837A - Data communication method, air conditioner, air conditioning system and storage medium - Google Patents

Data communication method, air conditioner, air conditioning system and storage medium Download PDF

Info

Publication number
CN111478837A
CN111478837A CN202010256147.2A CN202010256147A CN111478837A CN 111478837 A CN111478837 A CN 111478837A CN 202010256147 A CN202010256147 A CN 202010256147A CN 111478837 A CN111478837 A CN 111478837A
Authority
CN
China
Prior art keywords
registers
register
group
data
reading
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010256147.2A
Other languages
Chinese (zh)
Other versions
CN111478837B (en
Inventor
赵海龙
李银平
刘凯
雷海涛
黄隽
陈挺波
梁健敏
黄海
吴楚源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Avic Cloud Data Co ltd
Midea Group Co Ltd
GD Midea Heating and Ventilating Equipment Co Ltd
Guangdong Midea HVAC Equipment Co Ltd
Original Assignee
Avic Cloud Data Co ltd
Midea Group Co Ltd
GD Midea Heating and Ventilating Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Avic Cloud Data Co ltd, Midea Group Co Ltd, GD Midea Heating and Ventilating Equipment Co Ltd filed Critical Avic Cloud Data Co ltd
Priority to CN202010256147.2A priority Critical patent/CN111478837B/en
Publication of CN111478837A publication Critical patent/CN111478837A/en
Application granted granted Critical
Publication of CN111478837B publication Critical patent/CN111478837B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • FMECHANICAL ENGINEERING; LIGHTING; HEATING; WEAPONS; BLASTING
    • F24HEATING; RANGES; VENTILATING
    • F24FAIR-CONDITIONING; AIR-HUMIDIFICATION; VENTILATION; USE OF AIR CURRENTS FOR SCREENING
    • F24F11/00Control or safety arrangements
    • F24F11/50Control or safety arrangements characterised by user interfaces or communication
    • F24F11/56Remote control
    • F24F11/58Remote control using Internet communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Chemical & Material Sciences (AREA)
  • Combustion & Propulsion (AREA)
  • Mechanical Engineering (AREA)
  • General Engineering & Computer Science (AREA)
  • Air Conditioning Control Device (AREA)

Abstract

The invention provides a data communication method, an air conditioner, an air conditioning system and a storage medium. The data communication method comprises the following steps: acquiring a data reading request; reading register data of a first group of registers, and determining register addresses of a second group of registers according to the register data of the first group of registers; and reading register data of the second group of registers corresponding to the register addresses of the second group of registers, and sending the register data of the second group of registers. On one hand, the external equipment can smoothly acquire data only by sending a data reading request, the whole reading process is carried out at the local equipment, and the external equipment does not sense the data; on the other hand, as long as the register address of the second group of registers needing to be read is set in the first group of registers in advance, the first group of registers can be used for reading the register data of the second group of registers with the least communication times, the response time of data acquisition is shortened, and the communication efficiency is improved.

Description

Data communication method, air conditioner, air conditioning system and storage medium
Technical Field
The invention relates to the technical field of communication, in particular to a data communication method, an air conditioner, an air conditioning system and a computer readable storage medium.
Background
Communication between different devices in the field of central air conditioning is mostly based on the Modbus communication protocol. The Modbus communication protocol is a serial communication protocol, and a register table needs to be customized by using the Modbus communication protocol. In the related art, the definition of a register of an address is fixed and is directly accessed. For example, if register [0x00] is used for power on and power off and register [0x01] is used to set temperature, then accessing register [0x00] is always equivalent to directly accessing the power on and power off register.
However, as the register table is iterated, the table becomes increasingly bulky. For example, the V01 version has only 200 registers, and after the table iterates to V10, there are already 1000 registers. Due to the specification of the Modbus communication protocol, at most 125 registers with consecutive addresses can be accessed in one communication. When the table is bloated, since the addresses of the registers needing to be accessed are often separated by more than 125, the communication needs to be completed many times when two or three registers are required to be accessed, and the communication efficiency is very low.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art or the related art.
To this end, an aspect of the present invention is to propose a data communication method.
Another aspect of the present invention is to provide an air conditioner.
Yet another aspect of the present invention is to provide an air conditioning system.
Yet another aspect of the present invention is to provide a computer-readable storage medium.
In view of the above, according to an aspect of the present invention, a data communication method is provided, including: acquiring a data reading request; reading register data of a first group of registers, and determining register addresses of a second group of registers according to the register data of the first group of registers; and reading register data of the second group of registers corresponding to the register addresses of the second group of registers, and sending the register data of the second group of registers.
In the technical scheme, the data communication is based on a Modbus communication protocol. The Modbus communication protocol has a first set of registers and a second set of registers, each set of registers includes one or more register addresses, each register address corresponds to register data, that is, each set of registers includes one or more registers. Each register data of the first group of registers is a register address of the second group of registers, that is, the register address of part (or all) of the second group of registers is recorded in the first group of registers. When the external device has a data reading requirement, the external device sends a data reading request to a local device (such as an air conditioner), and the local device reads the registered data of the second group of registers through the first group of registers and then sends the registered data to the external device. According to the technical scheme, on one hand, the external equipment can smoothly acquire data only by sending a data reading request, the whole reading process is carried out at the local equipment, and the external equipment does not sense the data; on the other hand, since the register data of the second group of registers can be read according to the register address of the second group of registers recorded in the first group of registers, as long as the register address of the second group of registers to be read is set in the first group of registers in advance, the register data of the second group of registers can be read by using the first group of registers with the least number of communication times, the response time of data acquisition is shortened, and the communication efficiency is improved.
The data communication method according to the present invention may further include the following technical features:
in the above technical solution, the register data of the first group of registers is the register address of the second group of registers, which is continuous or discontinuous.
In the technical scheme, the register addresses of the second group of registers recorded in the first group of registers can be continuous or discontinuous, the registers with discontinuous addresses can be accessed by single communication by utilizing the first group of registers, and on the premise of not violating the regulation of the original Modbus communication protocol, the limitation that the registers with continuous addresses can only be read by single communication of the Modbus communication protocol is broken through.
In any of the above technical solutions, the method further includes: setting register addresses of a second group of registers of the Modbus communication protocol and register data of the second group of registers; setting register addresses of a first group of registers and register data of the first group of registers of a Modbus communication protocol, and setting the register data of the first group of registers as register addresses of a second group of registers which are continuous or discontinuous.
In order to increase communication speed in the related art, a policy of redefining a register table is often adopted, and registers required by a current item and a current device are reprogrammed to have continuous addresses, so that all the registers can be accessed back after one-time communication. The problem is that the different devices cannot be connected compatibly due to different register definitions. In the technical scheme, in addition to the second group of registers, namely static registers, which are necessary for the Modbus communication protocol, the first group of registers, namely dynamic pointer registers, are set. The register addresses of the second group of registers correspond to the register data of the second group of registers one to one, the register addresses of the first group of registers correspond to the register data of the first group of registers one to one, the number of the register addresses of the second group of registers is larger than or equal to the number of the register addresses of the first group of registers, and the register data of the first group of registers are set to be the register addresses of the second group of registers continuously or discontinuously. In a pointer register with continuous addresses, unlike direct access of a conventional register, the main access mode of the pointer register is (but not limited to) indirect access, and indirect access means that when a register [5] is equal to x and a register [ x ] is equal to a, and the value of the register [5] is obtained, the value a of the register [ x ] pointed to by the value x of the register [5] as a new address is obtained. The first group of registers are set for the equipment of a plurality of different types (which can be air conditioners under the same project) to access the second group of registers, the second group of registers do not need to be re-planned, so that the equipment of different types can more easily realize the unification of protocols, the expandability of communication protocols is improved, the equipment of different types can be more flexibly connected with each other, and the flexibility and the compatibility of the communication protocols are improved.
It should be noted that the register addresses of the second group of registers pointed to by the first group of registers of the device under the same item are the same.
In any of the above technical solutions, before the step of reading the register data of the first group of registers and determining the register address of the second group of registers according to the register data of the first group of registers, the method further includes: determining to perform indirect reading operation or direct reading operation on the first group of registers according to the register data of the third register; and determining to perform indirect reading operation on the first group of registers, reading register data of the first group of registers, and determining register addresses of the second group of registers according to the register data of the first group of registers.
In the technical scheme, a third register is defined, whether direct reading or indirect reading is carried out on a first group of registers is determined according to register data of the register, if the first group of registers is determined to be indirectly read, a register address is determined according to the register data of the first group of registers, and the register data of a second group of registers corresponding to the register address is read, so that the communication efficiency is improved.
In any of the above technical solutions, the method further includes: and if the direct reading operation on the first group of registers is determined, the register data of the first group of registers is read.
In this technical solution, if it is determined from the register data of the third register that the direct read operation is performed on the first group of registers, only the register data of the first group of registers is read, and no more read operation is performed on the second group of registers. The method for reading the register data of the first group of registers has two reading modes, wherein one mode is to read the register data of the first group of registers so as to read a second group of registers corresponding to the register data of the first group of registers; the other is to directly read the first group of registers, and the access mode can be flexibly switched according to the practical application.
It should be noted that, if the register data of the first group of registers is directly read, the register data of the first group of registers is also sent, that is, the register data of the first group of registers is sent to the external device.
In any of the above technical solutions, the method further includes: acquiring a data writing request, and determining to perform indirect writing operation or direct writing operation on the first group of registers according to the register data of the fourth register; determining to perform indirect write operation on the first group of registers, determining register addresses of a second group of registers according to register data of the first group of registers, and taking data included in the data write request as register data of the second group of registers corresponding to the register addresses of the second group of registers; and if the direct write operation on the first group of registers is determined, taking the data included in the data write request as the register data of the first group of registers.
In the technical scheme, a fourth register is defined, and indirect write operation or direct write operation is determined to be carried out on the first group of registers according to register data of the register. The indirect write operation is to determine a register address by using the registered data of the first group of registers, so as to write the data included in the data write request into a group of registers (i.e. a second group of registers) corresponding to the register address, and the direct write operation is to write the data included in the data write request into the first group of registers, so as to implement definition or modification of the first group of registers or the second group of registers.
For example, the register data of the fourth register is 0, and the direct write operation is performed on the first group of registers, and the register data of the fourth register is 1, and the indirect write operation is performed on the first group of registers; or the register data of the fourth register is 1 to carry out direct write operation on the first group of registers, and the register data of the fourth register is 0 to carry out indirect write operation on the first group of registers.
In any of the above technical solutions, the register address of the third register is the same as or different from the register address of the fourth register.
In the technical scheme, the third register and the fourth register are the same register or two different registers. The third register and the fourth register may be a set of registers when they are two different registers. When the register is the same register, the selection of reading the first group of registers or the second group of registers or the selection of writing the first group of registers or the second group of registers is flexibly performed by setting different register data.
According to another aspect of the present invention, there is provided an air conditioner including: a memory storing a computer program; a processor, which when executing the computer program implements the data communication method according to any of the above-mentioned technical solutions.
The air conditioner provided by the application reads the register data of the first group of registers when receiving the data reading request of the external equipment, determines the register address of the second group of registers according to the register data of the first group of registers, reads the register data of the second group of registers corresponding to the register address of the second group of registers, and sends the register data of the second group of registers to the external equipment. The second set of registers register data includes operating parameters of the air conditioner such as return air temperature, return air humidity, supply air temperature, supply air humidity, condensing pressure, etc. Each register data of the first group of registers is a register address of the second group of registers, and the register data of the second group of registers can be read through the first group of registers. According to the technical scheme, on one hand, the external equipment can smoothly acquire data only by sending a data reading request, the whole reading process is carried out at the local equipment, and the external equipment does not sense the data; on the other hand, the register data of the second group of registers is read by utilizing the first group of registers with the least communication times, so that the response time of data acquisition is shortened, and the communication efficiency is improved.
According to still another aspect of the present invention, there is provided an air conditioning system including: the external equipment sends a data reading request or a data writing request; according to the air conditioner in the technical scheme, the air conditioner responds to a data reading request or a data writing request.
The air conditioning system provided by the invention comprises external equipment and an air conditioner, the number of the external equipment and the air conditioner is not limited, and the external equipment can be the air conditioner, a remote controller, display equipment and the like. The external equipment and the air conditioner are communicated according to a Modbus communication protocol, the external equipment needs to acquire the operating parameters of the air conditioner and send a data reading request to the air conditioner, the air conditioner responds to the data reading request, and the operating parameters registered in the second group of registers are read by using the first group of registers, so that the operating parameters of the air conditioner are read with the least communication times, the response time of data acquisition is shortened, and the communication efficiency is improved.
According to a further aspect of the present invention, a computer-readable storage medium is proposed, on which a computer program is stored, which computer program, when being executed by a processor, carries out the data communication method according to any one of the above-mentioned technical solutions.
The computer-readable storage medium provided by the present invention, when being executed by a processor, implements the steps of the data communication method according to any one of the above-mentioned technical solutions, and therefore, the computer-readable storage medium includes all the advantages of the data communication method according to any one of the above-mentioned technical solutions.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The above and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 shows a flow chart diagram of a data communication method of a first embodiment of the present invention;
fig. 2 shows a schematic flow chart of a data communication method of a second embodiment of the present invention;
FIG. 3 is a diagram illustrating a dynamic pointer register pointing to a static register, according to one embodiment of the invention;
FIG. 4 is a diagram illustrating a dynamic pointer register pointing to a static register, according to one embodiment of the invention;
fig. 5 shows a flow chart of a data communication method of a third embodiment of the present invention;
fig. 6 shows a flow chart of a data communication method of a fourth embodiment of the present invention;
fig. 7 is a schematic block diagram showing an air conditioner according to a first embodiment of the present invention;
fig. 8 shows a schematic block diagram of an air conditioning system of a first embodiment of the present invention.
Detailed Description
In order that the above objects, features and advantages of the present invention can be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings. It should be noted that the embodiments of the present invention and features of the embodiments may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
In the field of central air conditioning, different devices communicate with each other based on a Modbus communication protocol, for example, communication between an air conditioner and an air conditioner, communication between the air conditioner and a remote controller, communication between an indoor unit and an outdoor unit of the air conditioner, and the like. Each device communicates according to a static register table, each register address in the register table corresponds to a device parameter (on/off state, operation parameter, etc.), and as the registers in the table iteration are more and more, since only 125 registers with continuous addresses can be accessed at one time, multiple communications occur when the parameters with addresses more than 125 apart are acquired.
Tables 1 and 2 are static registers, including register addresses and register contents (i.e., register data). When the static register is well defined, as in table 1, when reading and writing to register 100, a read operation returns a "return air temperature" and a write operation writes a "return air temperature". As the product is iteratively upgraded, the number of registers increases and many of them are wasted, which results in the address of the required register being discontinuous. The Modbus communication protocol provides that a maximum of 125 consecutive addresses of register data are returned in a single request, so that as registers become more and more, due to the fact that the addresses of the registers to be read are scattered and the distance exceeds 125, the required data can be obtained by multiple requests, and the communication efficiency is low. For example, as shown in table 2, when data with addresses 100 to 103 and data with addresses 305 to 309 need to be requested, the requests need to be made twice.
TABLE 1
Figure BDA0002437399810000071
Figure BDA0002437399810000081
TABLE 2
Register address Register content
100 Temperature of return air
101 Return air humidity
102 Temperature of the air supply
103 Humidity of air supply
...... ......
305 Percentage of refrigeration output
306 Heating output percentage
307 Percentage of humidification output
308 Percentage of dehumidification output
309 Percentage of fan output
The embodiment of the application provides a data communication method, an air conditioner, an air conditioning system and a computer readable storage medium, wherein a pointer register with continuous addresses is defined, the pointer register registers the addresses of static registers to be accessed, and the pointer register can be used for finishing the data acquisition of the static registers to be accessed in the least times. For example, with the pointer register, data with addresses 100 to 103 and data with addresses 305 to 309 in table 2 are acquired by one communication request.
Hereinafter, a data communication method, an air conditioner, an air conditioning system, and a computer-readable storage medium proposed in the embodiments of the present application will be described in detail with reference to fig. 1 to 8.
An embodiment of a first aspect of the present invention provides a data communication method. Fig. 1 shows a flow chart of a data communication method of a first embodiment of the present invention. Wherein, the method comprises the following steps:
step 102, acquiring a data reading request;
step 104, reading register data of the first group of registers, and determining register addresses of the second group of registers according to the register data of the first group of registers;
and 106, reading register data of the second group of registers corresponding to the register addresses of the second group of registers, and sending the register data of the second group of registers.
In this embodiment, the data communication is a data communication based on the Modbus communication protocol. The Modbus communication protocol has a first set of registers and a second set of registers, each set of registers includes one or more register addresses, each register address corresponds to register data, that is, each set of registers includes one or more registers. Each register data of the first group of registers is a register address of the second group of registers, that is, the register address of part (or all) of the second group of registers is recorded in the first group of registers. When the external device has a data reading requirement, the external device sends a data reading request to a local device (such as an air conditioner), and the local device reads the registered data of the second group of registers through the first group of registers and then sends the registered data to the external device. According to the embodiment of the application, on one hand, the external equipment can smoothly acquire data only by sending a data reading request, the whole reading process is carried out on the local equipment, and the external equipment does not sense the data; on the other hand, since the register data of the second group of registers can be read according to the register address of the second group of registers recorded in the first group of registers, as long as the register address of the second group of registers to be read is set in the first group of registers in advance, the register data of the second group of registers can be read by using the first group of registers with the least number of communication times, the response time of data acquisition is shortened, and the communication efficiency is improved.
In the above embodiments, the register addresses of the second set of registers recorded in the first set of registers may be continuous or discontinuous. For example, the first set of registers includes 6 registers, and the register address of the second set of registers recorded in the first set of registers may be 100, 101, 102, 103, 104, 105, or may be 100, 101, 102, 106, 107, 108. Wherein the discontinuity includes an error, and the register address of the second set of registers recorded in the first set of registers may be 100, 103, 108, 104, 110, 105. By utilizing the first group of registers, the registers with discontinuous addresses can be accessed through single communication, and the limitation that the registers with continuous addresses can only be read through single communication of the Modbus is broken through on the premise of not violating the regulations of the original Modbus communication protocol.
Fig. 2 shows a flow chart of a data communication method according to a second embodiment of the present invention. Wherein, the method comprises the following steps:
step 202, setting register addresses of a second group of registers of the Modbus communication protocol and register data of the second group of registers; setting register addresses of a first group of registers of a Modbus communication protocol and register data of the first group of registers, and setting the register data of the first group of registers as register addresses of a second group of registers which are continuous or discontinuous;
step 204, acquiring a data reading request;
step 206, reading the register data of the first group of registers, and determining the register address of the second group of registers according to the register data of the first group of registers;
step 208, reading the register data of the second group of registers corresponding to the register address of the second group of registers, and sending the register data of the second group of registers.
In the embodiment of the present application, there are 1 fixed total table in the register table, where the fixed total table is a static register (second group of registers), and the register table is added with a series of dynamic pointer registers (first group of registers) with consecutive addresses, unlike direct access of the static register, where the access manner (but not limited to) of the dynamic pointer registers is indirect access, that is, the static register is accessed through the dynamic pointer registers.
According to the static register needed to be used, the address combination of the equipment of a certain model is used as an address parameter table and is written into the dynamic pointer register, and the equipment of the certain model can complete the reading and the access of the needed register through minimum communication. If the register addresses required to be read are less than or equal to 125, the reading and accessing of the required registers can be completed by one communication.
As shown in fig. 3, pointer values are initially filled in the dynamic pointer register, that is, the register contents (register data) of the dynamic pointer register are set as the register address of the static register, so that when the dynamic pointer register is indirectly read, the value of the static register pointed to by the register contents of the dynamic pointer register as the new register address is read, and indirect access of the dynamic pointer register is realized. For example, reading the dynamic pointer register [0], the actual return is the "return air temperature" for the static register [100 ].
As shown in fig. 4, the register contents of the dynamic pointer register are register addresses 100, 101, 102, 103, 305, 306, 307, 308, 309 of the static register, respectively, and when the dynamic pointer register is read, the values of the static register pointed to by the register address of the dynamic pointer register as a new register address, that is, the return air temperature, the return air humidity, the supply air temperature, the supply air humidity, the cooling output percentage, the heating output percentage, the humidification output percentage, the dehumidification output percentage, and the fan output percentage, are read. No matter how big and large the static register is with the iteration of the version, the data can be read back with the least number of requests by reasonably rearranging the really used address of the static register in the dynamic pointer register, thereby realizing the high efficiency of communication. To read back the values of the 9 registers in the static register of FIG. 4, only the dynamic pointer registers 0 through 8 need to be read, and one request can be completed.
Obviously, by reading the static register by using the dynamic pointer register, communication protocol standardization can be realized, and devices between different machine types can share one standard protocol, so that the devices can be compatibly connected with each other. Moreover, the register table has high expandability and compatibility, and the expansion of the registers does not cause the reduction of communication efficiency, so that different machine types can realize communication based on the same register table (static register), and the register tables are compatible with each other. The standardization of the communication protocol can also improve the development efficiency and the production efficiency.
In some embodiments, the register table may be defined in a segmented taxonomy, eliminating the need for out-of-order ordering.
The static register is read by utilizing the dynamic pointer register, so that the data refreshing speed can be improved, and particularly, the data refreshing speed of a central control page can be remarkably improved in the application that a display screen needs more than one display screen and central control and centralized display are carried out. For example, the 1-by-64 display screen may need 30 seconds to refresh the data of the whole unit at a time by using the scheme of directly reading the static register, and the refresh time may be shortened to less than 10 seconds by using the scheme of indirectly reading the static register by using the dynamic pointer register.
In some embodiments, all devices that communicate based on the Modbus communication protocol may improve the Modbus communication protocol by defining a dynamic pointer register to point to a static register. All devices which communicate based on the Modbus communication protocol can communicate by using a method of defining a dynamic pointer register so as to indirectly read a static register.
Fig. 5 shows a flow chart of a data communication method according to a third embodiment of the present invention. Wherein, the method comprises the following steps:
step 502, acquiring a data reading request, and determining to perform indirect reading operation or direct reading operation on a first group of registers according to register data of a third register;
step 504, if the indirect reading operation of the first group of registers is determined, reading the register data of the first group of registers, determining the register address of the second group of registers according to the register data of the first group of registers, and reading the register data of the second group of registers corresponding to the register address of the second group of registers; if the direct reading operation of the first group of registers is determined, only the register data of the first group of registers is read;
step 506, sending the register data of the second set of registers or the register data of the first set of registers.
In the embodiment of the application, two ways of reading the registered data of the first group of registers are available, one way is to read the registered data of the first group of registers, so as to read the second group of registers corresponding to the registered data of the first group of registers; the other is to directly read the first group of registers, and the access mode can be flexibly switched according to the practical application.
For example, when the register data of the third register is set to 0, the register data of the second group of registers is read by performing a read operation on the first group of registers, and when the register data of the third register is set to 1, the read operation is performed only on the first group of registers; or when the register data of the third register is set to be 1, reading operation is carried out on the first group of registers so as to read the register data of the second group of registers, and when the register data of the third register is set to be 0, only reading operation is carried out on the first group of registers.
Fig. 6 shows a flow chart of a data communication method according to a fourth embodiment of the present invention. Wherein, the method comprises the following steps:
step 602, acquiring a data reading request, and determining to perform indirect reading operation or direct reading operation on a first group of registers according to register data of a third register;
step 604, if the indirect reading operation of the first group of registers is determined, reading the register data of the first group of registers, determining the register address of the second group of registers according to the register data of the first group of registers, and reading the register data of the second group of registers corresponding to the register address of the second group of registers; if the direct reading operation of the first group of registers is determined, only the register data of the first group of registers is read;
step 606, sending the register data of the second group of registers or the register data of the first group of registers;
step 608, acquiring a data write request, and determining to perform indirect write operation or direct write operation on the first group of registers according to the register data of the fourth register;
step 610, determining to perform indirect write operation on the first group of registers, determining register addresses of a second group of registers according to register data of the first group of registers, and taking data included in the data write request as register data of the second group of registers corresponding to the register addresses of the second group of registers; and if the direct write operation on the first group of registers is determined, taking the data included in the data write request as the register data of the first group of registers.
It should be noted that the order of steps 602 to 606 and steps 608 and 610 is not limited, that is, steps 608 and 610 may be performed first, and then steps 602 to 606 may be performed.
In this embodiment, it is determined whether a direct write operation or an indirect write operation is performed to the first group of registers, based on the registered data of the fourth register. For example, the register data of the fourth register is 0, and the direct write operation is performed on the first group of registers, and the register data of the fourth register is 1, and the indirect write operation is performed on the first group of registers; or the register data of the fourth register is 1 to carry out direct write operation on the first group of registers, and the register data of the fourth register is 0 to carry out indirect write operation on the first group of registers. Thereby enabling the definition or modification of the first set of registers or the second set of registers.
In a specific embodiment, when writing a register, it is necessary to select a value of the register according to a write operation to confirm whether to write the dynamic pointer register or to write the static register through the dynamic pointer register. As shown in table 3, the address of the special function select register is 1000, when the register [1000] is equal to 1, the dynamic pointer register [0] in fig. 3 is written, actually the static register [100], and when the register [1000] is equal to 0, the dynamic pointer register [0] in fig. 3 is written, and still the dynamic pointer register [0 ].
TABLE 3
Register address Register content
1000 Selecting register value for write operation
Note that the address of the special function selection register is not limited to 1000.
In some embodiments, the third register and the fourth register may be registers of the same address, or a third register is defined to select a read operation, and a fourth register different from the third register is defined to select a write operation. When the third register and the fourth register are the same special function selection register, it can be defined as follows: when the register [1000] is equal to 1, the write dynamic pointer register is actually a write static register [100], and when the register [1000] is equal to 0, the write dynamic pointer register is a write dynamic pointer register; when the register [1000] is 2, the read dynamic pointer register is actually a read static register, and when the register [1000] is 3, the read dynamic pointer register is a read dynamic pointer register. When the third register and the fourth register are two different registers, the third register and the fourth register may be a set of registers, and as shown in table 4, the third register address is 1001 and the fourth register address is 1002.
TABLE 4
Register address Register content
1001 Reading the value of the selection register
1002 Selecting register value for write operation
In an embodiment of the second aspect of the present invention, an air conditioner is provided. Fig. 7 shows a schematic block diagram of an air conditioner 700 according to a first embodiment of the present invention. Wherein, this air conditioner 700 includes:
a memory 702, the memory 702 storing a computer program;
a processor 704, the processor 704 when executing the computer program implementing the data communication method according to any of the embodiments described above.
The air conditioner 700 provided by the present application, when receiving a data reading request from an external device, reads the register data of the first set of registers, determines the register address of the second set of registers according to the register data of the first set of registers, reads the register data of the second set of registers corresponding to the register address of the second set of registers, and sends the register data of the second set of registers to the external device. The second set of registers register data includes operating parameters of the air conditioner such as return air temperature, return air humidity, supply air temperature, supply air humidity, condensing pressure, etc. Each register data of the first group of registers is a register address of the second group of registers, and the register data of the second group of registers can be read through the first group of registers. According to the embodiment of the application, on one hand, the external equipment can smoothly acquire data only by sending a data reading request, the whole reading process is carried out on the local equipment, and the external equipment does not sense the data; on the other hand, the register data of the second group of registers is read by utilizing the first group of registers with the least communication times, so that the response time of data acquisition is shortened, and the communication efficiency is improved.
In an embodiment of the third aspect of the present invention, an air conditioning system is provided. Fig. 8 shows a schematic block diagram of an air conditioning system 800 of a first embodiment of the present invention. Among them, this air conditioning system 800 includes:
an external device 802, the external device 802 sending a data read request or a data write request;
as with the air conditioner 700 of the above embodiment, the air conditioner 700 responds to a data read request or a data write request.
The air conditioning system 800 provided by the invention comprises the external device 802 and the air conditioner 700, the number of the external device 802 and the air conditioner 700 is not limited, and the external device 802 can be an air conditioner, a remote controller, a display device and other devices. The external device 802 and the air conditioner 700 communicate with each other according to a Modbus communication protocol, the external device 802 needs to obtain the operating parameters of the air conditioner 700 and send a data reading request to the air conditioner 700, the air conditioner 700 responds to the data reading request and reads the operating parameters registered in the second set of registers by using the first set of registers, so that the operating parameters of the air conditioner are read with the least number of communication times, the response time of data acquisition is shortened, and the communication efficiency is improved.
An embodiment of the fourth aspect of the present invention proposes a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the data communication method according to any of the embodiments described above.
The present invention provides a computer-readable storage medium, which when executed by a processor implements the steps of the data communication method of any of the above embodiments, and therefore includes all the benefits of the data communication method of any of the above embodiments.
In the description herein, the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance unless explicitly stated or limited otherwise; the terms "connected," "mounted," "secured," and the like are to be construed broadly and include, for example, fixed connections, removable connections, or integral connections; may be directly connected or indirectly connected through an intermediate. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the description herein, the description of the terms "one embodiment," "some embodiments," "specific embodiments," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of data communication, comprising:
acquiring a data reading request;
reading register data of a first group of registers, and determining register addresses of a second group of registers according to the register data of the first group of registers;
and reading register data of the second group of registers corresponding to the register addresses of the second group of registers, and sending the register data of the second group of registers.
2. The data communication method according to claim 1,
the register data of the first group of registers are continuous or discontinuous register addresses of the second group of registers.
3. The data communication method according to claim 1, further comprising:
setting register addresses of a second group of registers of a Modbus communication protocol and register data of the second group of registers;
setting register addresses of a first group of registers of the Modbus communication protocol and register data of the first group of registers, and setting the register data of the first group of registers as continuous or discontinuous register addresses of a second group of registers.
4. The data communication method according to any one of claims 1 to 3, further comprising, before the step of reading the registered data of the first set of registers and determining the register address of the second set of registers based on the registered data of the first set of registers:
determining to perform indirect reading operation or direct reading operation on the first group of registers according to register data of a third register;
and if the indirect reading operation of the first group of registers is determined, reading the register data of the first group of registers, and determining the register address of a second group of registers according to the register data of the first group of registers.
5. The data communication method according to claim 4, further comprising:
and if the direct reading operation of the first group of registers is determined, reading the register data of the first group of registers.
6. The data communication method according to claim 4, further comprising:
acquiring a data writing request, and determining to perform indirect writing operation or direct writing operation on the first group of registers according to the register data of the fourth register;
determining register addresses of a second group of registers according to register data of the first group of registers when determining that the indirect write operation is performed on the first group of registers, and taking data included in the data write request as register data of the second group of registers corresponding to the register addresses of the second group of registers;
and if the direct write operation of the first group of registers is determined, taking the data included in the data write request as the register data of the first group of registers.
7. The data communication method according to claim 6,
and the register address of the third register is the same as or different from the register address of the fourth register.
8. An air conditioner, comprising:
a memory storing a computer program;
a processor implementing the data communication method of any one of claims 1 to 7 when executing the computer program.
9. An air conditioning system, comprising:
an external device that sends a data read request or a data write request;
the air conditioner of claim 8, the air conditioner being responsive to the data read request or the data write request.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data communication method according to any one of claims 1 to 7.
CN202010256147.2A 2020-04-02 2020-04-02 Data communication method, air conditioner, air conditioning system and storage medium Active CN111478837B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010256147.2A CN111478837B (en) 2020-04-02 2020-04-02 Data communication method, air conditioner, air conditioning system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010256147.2A CN111478837B (en) 2020-04-02 2020-04-02 Data communication method, air conditioner, air conditioning system and storage medium

Publications (2)

Publication Number Publication Date
CN111478837A true CN111478837A (en) 2020-07-31
CN111478837B CN111478837B (en) 2022-01-11

Family

ID=71749651

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010256147.2A Active CN111478837B (en) 2020-04-02 2020-04-02 Data communication method, air conditioner, air conditioning system and storage medium

Country Status (1)

Country Link
CN (1) CN111478837B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291101A (en) * 2020-11-06 2021-01-29 珠海格力电器股份有限公司 Communication node and communication framing optimization method of upper computer to lower computer
CN113076142A (en) * 2021-03-31 2021-07-06 海信视像科技股份有限公司 TCON parameter initialization method and display device
CN113099279A (en) * 2021-03-31 2021-07-09 海信视像科技股份有限公司 TCON parameter writing method and display device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638451A (en) * 2012-03-14 2012-08-15 江苏斯菲尔电气股份有限公司 Dynamic regrouping method for register list data of Modbus communication protocol
CN104407983A (en) * 2014-12-02 2015-03-11 上海电器科学研究院 Modbus address remapping method used for electric quantity module
CN105527881A (en) * 2014-09-30 2016-04-27 上海安川电动机器有限公司 Command processing method and device
CN109450756A (en) * 2018-10-18 2019-03-08 南京海桐环境科技有限公司 A kind of ModbusRTU signal procedure based on SIMATIC S7-200 SMART
CN110737609A (en) * 2019-09-27 2020-01-31 厦门四信通信科技有限公司 Data management method, device, equipment and storage medium based on virtual register

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102638451A (en) * 2012-03-14 2012-08-15 江苏斯菲尔电气股份有限公司 Dynamic regrouping method for register list data of Modbus communication protocol
CN105527881A (en) * 2014-09-30 2016-04-27 上海安川电动机器有限公司 Command processing method and device
CN104407983A (en) * 2014-12-02 2015-03-11 上海电器科学研究院 Modbus address remapping method used for electric quantity module
CN109450756A (en) * 2018-10-18 2019-03-08 南京海桐环境科技有限公司 A kind of ModbusRTU signal procedure based on SIMATIC S7-200 SMART
CN110737609A (en) * 2019-09-27 2020-01-31 厦门四信通信科技有限公司 Data management method, device, equipment and storage medium based on virtual register

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291101A (en) * 2020-11-06 2021-01-29 珠海格力电器股份有限公司 Communication node and communication framing optimization method of upper computer to lower computer
CN113076142A (en) * 2021-03-31 2021-07-06 海信视像科技股份有限公司 TCON parameter initialization method and display device
CN113099279A (en) * 2021-03-31 2021-07-09 海信视像科技股份有限公司 TCON parameter writing method and display device

Also Published As

Publication number Publication date
CN111478837B (en) 2022-01-11

Similar Documents

Publication Publication Date Title
CN111478837B (en) Data communication method, air conditioner, air conditioning system and storage medium
CN104978361B (en) Method and device for storing real-time monitoring data of power environment
US20150362206A1 (en) System and method to manage energy consumption in an hvac system
CN111880490A (en) Environment adjusting method and device, electronic equipment and storage medium
CN107525207B (en) Air conditioner and communication method thereof
CN108317685B (en) Air conditioner control method and air conditioner terminal
WO2023065755A1 (en) Control method and apparatus for air source heat pump unit, and electronic device
CN101216206A (en) Air conditioner and method for controlling the same
JP2023060335A (en) Adaptor
EP2584277A1 (en) Network system equipped with air conditioner and control method thereof
CN113132158B (en) Point table configuration method, device, controller and storage medium
CN108507126A (en) A kind of fuzzy control method, device and the air-conditioning of central air-conditioning freezing water
CN111478835B (en) Air conditioning unit monitoring device, monitoring method, air conditioning system and storage medium
CN103292414A (en) Data interaction method and device of air conditioning unit
CN102063068B (en) Programming method, system and computer of DDC (Direct Digital Control) logic
CN116624990A (en) Method and device for controlling air conditioning system, air conditioning system and storage medium
CN107894076B (en) Multi-split air conditioning system, energy-saving control method and device thereof and storage medium
CN112612425B (en) Data read-write method and control device of semiconductor processing equipment
CN113849510A (en) Data storage method, device and equipment of air conditioner and storage medium
CN100516683C (en) Central control system of air conditioner and its renewing method
CN112346377B (en) Chip, intelligent terminal control method, intelligent terminal and storage medium
CN107120795B (en) Air conditioning control method, system and device
WO2021156912A1 (en) Simulation device, simulation method, and simulation program
CN116481140A (en) Display method and display device of control interface, terminal equipment and storage medium
CN213334860U (en) Remote control system and air conditioner

Legal Events

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