CN111835609B - Bus resource allocation method and device and air conditioning system - Google Patents

Bus resource allocation method and device and air conditioning system Download PDF

Info

Publication number
CN111835609B
CN111835609B CN202010470595.2A CN202010470595A CN111835609B CN 111835609 B CN111835609 B CN 111835609B CN 202010470595 A CN202010470595 A CN 202010470595A CN 111835609 B CN111835609 B CN 111835609B
Authority
CN
China
Prior art keywords
bus
internal
internal machine
communication
air conditioning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010470595.2A
Other languages
Chinese (zh)
Other versions
CN111835609A (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.)
Gree Electric Appliances Inc of Zhuhai
Original Assignee
Gree Electric Appliances Inc of Zhuhai
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 Gree Electric Appliances Inc of Zhuhai filed Critical Gree Electric Appliances Inc of Zhuhai
Priority to CN202010470595.2A priority Critical patent/CN111835609B/en
Publication of CN111835609A publication Critical patent/CN111835609A/en
Application granted granted Critical
Publication of CN111835609B publication Critical patent/CN111835609B/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
    • H04L12/40006Architecture of a communication node
    • 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
    • H04L12/40013Details regarding a bus controller

Abstract

The invention provides a bus resource allocation method and device and an air conditioning system, wherein the method comprises the following steps: acquiring bus occupation parameters of an air conditioning system, wherein the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameters are used for representing the internal machine access number and bus occupation information of the CAN bus; and adjusting the communication period of the internal machine according to the bus occupation parameter. The invention solves the technical problem of low utilization rate of CAN bus resources in the related technology, improves the resource utilization rate of the CAN bus, realizes the maximum utilization of the bus resources and also improves the data updating speed of the internal unit and the external unit.

Description

Bus resource allocation method and device and air conditioning system
Technical Field
The invention relates to the field of automation, in particular to a bus resource allocation method and device and an air conditioning system.
Background
In the related art, a Controller Area Network (CAN) is one of the field buses that are widely used at present, and the CAN bus is a serial communication bus that effectively supports distributed control or real-time control. The distributed control system constructed by the CAN bus has the advantage of strong real-time performance of data communication among node devices, in the distributed control system constructed by the CAN bus, each device node CAN actively send information to other device nodes at any time, and the communication order is determined according to the priority order of the information sent by each device node.
In the related art, the air conditioning network generally has more internal machines and large data volume. If the RS485 communication bus technology is adopted, all the internal machine data can be updated in each round through the working modes of roll calling and replying, but the updating is very slow. In order to solve the problem, the air conditioning network also adopts a CAN bus technology, has the characteristic of multiple masters, and sends data according to different priorities in a competition mode, and has the most obvious advantage of timely updating of data, especially important data.
Due to the characteristic of multiple masters, each internal unit can send data to the bus at any time, the sent data volume is uncertain, the data priorities are different, and when the network bus is busy, the data with low priority cannot be sent successfully. Based on this, the conventional method is to theoretically calculate the longest occupied time of the bus according to the maximum number of the internal machines and parameters, and preset a fixed communication period for each air conditioner internal machine. This method is simple and versatile, but it has one drawback: when the number of internal machines in the network is smaller than the theoretical value or the bus data volume is less and the number of internal machines changes in real time, the bus is not fully utilized, most of the situations are in an idle state, the waste of bus resources is caused, and the data updating does not reach the optimal state.
In view of the above problems in the related art, no effective solution has been found at present.
Disclosure of Invention
The embodiment of the invention provides a bus resource allocation method and device and an air conditioning system, and aims to solve the technical problem of low utilization rate of CAN bus resources in the related art.
According to an embodiment of the present invention, there is provided a method for allocating bus resources, including: acquiring bus occupation parameters of an air conditioning system, wherein the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameters are used for representing the internal machine access number and bus occupation information of the CAN bus; and adjusting the communication period of the internal machine according to the bus occupation parameter.
Optionally, the obtaining of the bus occupation parameter of the air conditioning system includes: counting the number of the internal machines accessed to the air conditioning system, and calculating the communication time length of each internal machine occupying the CAN bus; and calculating the bus idle time of the CAN bus in the bus period and the maximum occupation time of the internal machines based on the number of the internal machines and the communication time.
Optionally, adjusting the communication cycle of the internal machine according to the bus occupation parameter includes: calculating the actual deviation value of subtracting the reserved idle time from the idle time of the CAN bus, wherein the adjustment of the bus occupation parameters comprises the idle time of the CAN bus; and if the actual deviation value is larger than the preset deviation value, shortening the communication period of the internal machine.
Optionally, adjusting the communication cycle of the internal machine according to the bus occupation parameter includes: monitoring the increment of an internal machine accessed to the CAN bus in real time; if the increment of the internal machine is not equal to 0, calculating a change value of the communication period according to the increment of the internal machine; and if the increment of the internal machine is equal to 0, increasing the communication period of the internal machine according to the bus idle time.
Optionally, calculating a variation value of the communication cycle according to the internal unit increment includes: calculating the bus required change time length of the CAN bus in each bus period according to the internal machine increment; the variation value T is calculated by the following formulaVariation value of each indoor unit:TVariation value of each indoor unit=N*TThe length of time that the bus needs to be changed(ii)/M + N; and M is the original internal machine access amount of the CAN bus, and N is the internal machine increment.
Optionally, increasing the communication cycle of the internal unit according to the bus idle duration includes: continuously detecting whether the idle time of the bus is smaller than a preset value according to a detection period; and if the bus idle time is less than the preset value, increasing the communication period of the internal machine according to a preset step length until the bus idle time is greater than or equal to the preset value.
Optionally, after adjusting the communication cycle of the internal unit according to the bus occupation parameter, the method further includes: judging whether the communication period meets a preset working state of the air conditioning system or not; and if the preset working state is met, sending a control instruction to the internal machine, wherein the control instruction is used for indicating the internal machine to store the communication period and taking the communication period as an initialization parameter when the internal machine is powered on next time.
According to another embodiment of the present invention, there is provided an apparatus for allocating bus resources, including: the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring bus occupation parameters of an air conditioning system, the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameters are used for representing the internal machine access quantity and bus occupation information of the CAN bus; and the adjusting module is used for adjusting the communication period of the internal machine according to the bus occupation parameter.
Optionally, the obtaining module includes: the processing unit is used for counting the number of the internal machines connected to the air conditioning system and calculating the communication time length of each internal machine occupying the CAN bus; and the calculating unit is used for calculating the bus idle time of the CAN bus in a bus period and the maximum occupation time of the internal machine based on the number of the internal machines and the communication time.
Optionally, the adjusting module includes: the calculating unit is used for calculating the actual deviation value of subtracting the reserved idle time from the idle time of the CAN bus, wherein the adjustment of the bus occupation parameters comprises the idle time of the CAN bus; and the shortening unit is used for shortening the communication period of the internal machine if the actual deviation value is greater than a preset deviation value.
Optionally, the adjusting module includes: the monitoring unit is used for monitoring the increment of the internal machine accessed to the CAN bus in real time; the processing unit is used for calculating the change value of the communication period according to the increment of the internal machine if the increment of the internal machine is not equal to 0; and if the increment of the internal machine is equal to 0, increasing the communication period of the internal machine according to the bus idle time.
Optionally, the processing unit includes: the first calculating subunit is used for calculating the time length of the CAN bus required to change in each bus period according to the internal machine increment; a second calculating subunit for calculating the variation value T by using the following formulaVariation value of each indoor unit:TVariation value of each indoor unit=N*TThe length of time that the bus needs to be changed(ii)/M + N; and M is the original internal machine access amount of the CAN bus, and N is the internal machine increment.
Optionally, the processing unit includes: the detection subunit is used for continuously detecting whether the bus idle time length is smaller than a preset value according to a detection period; and the adding subunit is used for increasing the communication cycle of the internal machine according to a preset step length if the bus idle time is less than the preset value until the bus idle time is greater than or equal to the preset value.
Optionally, the apparatus further comprises: the judging module is used for judging whether the communication period meets the preset working state of the air conditioning system or not after the adjusting module adjusts the communication period of the internal unit according to the bus occupation parameter; and the sending module is used for sending a control instruction to the internal unit if the preset working state is met, wherein the control instruction is used for indicating the internal unit to store the communication period and taking the communication period as an initialization parameter when the internal unit is powered on next time.
According to another embodiment of the present invention, there is also provided an air conditioning system including an external unit and a plurality of internal units communicatively connected via a controller area network CAN bus, wherein the external unit includes the apparatus as described in the above embodiments.
According to a further embodiment of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps in any of the apparatus embodiments described above when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the invention, the bus occupation parameter of the air conditioning system is obtained, then the communication period of the internal unit is adjusted according to the bus occupation parameter, the bus resource between the external unit and the internal unit CAN be distributed based on the real-time occupation state of the CAN bus, the bus idle time of the internal unit in each communication period is reduced, the bus idle time of the external unit is further shortened, the technical problem of low utilization rate of the CAN bus resource in the related technology is solved, the resource utilization rate of the CAN bus is improved, the maximum utilization of the bus resource is realized, and the data updating speed of the internal unit and the external unit is also improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a block diagram of a bus resource allocation controller according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method for allocating bus resources according to an embodiment of the present invention;
FIG. 3 is a flow chart of the operation of an embodiment of the present invention;
fig. 4 is a block diagram of a bus resource allocation apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by the first embodiment of the present application may be executed in a processor, an air conditioner, an outdoor unit of an air conditioner, a controller, or similar electronic devices. Taking an air conditioner as an example, fig. 1 is a block diagram of a bus resource allocation air conditioner according to an embodiment of the present invention. As shown in fig. 1, the air conditioner 10 may include one or more (only one shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally, an input and output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and it does not limit the structure of the air conditioner. For example, the air conditioner 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store an air conditioner program, for example, a software program and a module of an application software, such as an air conditioner program corresponding to a bus resource allocation control method in an embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the air conditioner program stored in the memory 104, that is, implements the above-described method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the air conditioner 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the air conditioner 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In this embodiment, a method for allocating bus resources is provided, and fig. 2 is a flowchart of a method for allocating bus resources according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, bus occupation parameters of the air conditioning system are obtained, wherein the air conditioning system is connected with an external machine and a plurality of internal machines through CAN bus communication, and the bus occupation parameters are used for representing the internal machine access quantity and bus occupation information of a CAN bus;
in this embodiment, the external machine is connected to the multiple internal machines through the CAN bus, and in each bus cycle, the multiple internal machines report data to the external machine according to priority or randomly, so that the external machine monitors the multiple internal machines in the air conditioning system in real time.
Optionally, the bus occupation parameters include: the access number of the internal machines, the bus occupation time, the bus idle time, the bus utilization rate, the occupation time of each internal machine and the like.
And step S204, adjusting the communication period of the internal machine according to the bus occupation parameter.
In this embodiment, each of the internal units is allocated with a communication cycle having the same duration, an initial value in the power-on initialization stage may be preset, and the durations of the communication cycles of the multiple internal units are adjusted simultaneously during adjustment.
Through the steps, the bus occupation parameter of the air conditioning system is obtained, then the communication period of the inner unit is adjusted according to the bus occupation parameter, the bus resource between the outer unit and the inner unit CAN be distributed based on the real-time occupation state of the CAN bus, the bus idle time of the inner unit in each communication period is reduced, the bus idle time of the outer unit is further shortened, the technical problem that the utilization rate of the CAN bus resource in the related technology is low is solved, the resource utilization rate of the CAN bus is improved, the maximum utilization of the bus resource is realized, and the data updating speed of the inner unit and the outer unit is also improved.
In one embodiment of this embodiment, the acquiring the bus occupation parameter of the air conditioning system includes: counting the number of the internal machines accessed to the air conditioning system, and calculating the communication time length of each internal machine occupying a CAN bus; and calculating the bus idle time of the CAN bus in the bus period and the maximum occupation time of the internal machines based on the number of the internal machines and the communication time.
After the whole machine of the air conditioning system is powered on, the air conditioner external unit is powered on, and after initialization is completed, heartbeat data frames are sent to the communication bus regularly through the communication port. After the air conditioner internal unit is electrified and initialized for the first time, the communication port of the air conditioner internal unit monitors whether a heartbeat data frame sent by the air conditioner external unit exists all the time, and when the heartbeat data frame is detected, communication is successfully established. Meanwhile, the air conditioner internal unit is preset according to the factory according to a preset parameter (T)Data update period) (factory correction value T in initialization stage)Correction value0) and every (T) time from the heartbeat data frameData update period) All data of the bus is sent to the bus. The data contains a start frame and an end frame,the starting frame is initiated first, and the ending frame is sent after all data are ended, wherein the two frames of data have higher priority.
Bus air conditioner indoor unit is monitored in real time to outer machine of air conditioner (C)Number of internal machines) The number and the starting frame and the ending frame of each air conditioner indoor unit. Simultaneously calculating the idle time (T) of the communication busBus idle time) And calculating the time (T) occupied by the internal unit occupying the longest bus time in the networkBus internal machine with maximum occupation)。
When the communication period of the internal machine is adjusted, the communication period of the internal machine can be shortened, the communication period of the internal machine can be increased, and in some examples, the communication period of the internal machine can be maintained.
In this embodiment, adjusting the communication cycle of the internal unit according to the bus occupation parameter includes: comparing the bus utilization rate with the preset utilization rate of the CAN bus; if the bus utilization rate is greater than the preset utilization rate, increasing the communication period of the internal machine; if the bus utilization rate is equal to the preset utilization rate, maintaining the current communication cycle of the internal machine; if the bus utilization rate is less than the preset utilization rate, the communication period of the internal machine is shortened.
When the bus utilization rate is greater than the preset utilization rate, the communication period of the internal machine is increased, namely, the interval of reporting data to the external machine by the internal machine is increased, the idle time of each internal machine in the communication period is increased, and the communication delay between the external machine and the internal machine can be shortened on the premise of ensuring the resource utilization rate. If the bus utilization rate is less than the preset utilization rate, the communication period of the inner machine is shortened, the bus utilization rate is too low, and the communication period of the inner machine is shortened, namely, the interval of reporting data to the outer machine by the inner machine is shortened, so that the idle time of the outer machine is shortened, and the utilization rate of bus resources is improved.
In one embodiment of this embodiment, adjusting the communication cycle of the internal unit according to the bus occupation parameter includes: calculating the actual deviation value of the idle time minus the reserved idle time of the CAN bus, wherein the adjustment of the bus occupation parameters comprises the idle time of the CAN bus; if the actual deviation value is larger than the preset deviation value, the communication period of the internal machine is shortened.
In one example, when the out-of-air-conditioner unit detects that the bus has idle time N times(TBus idle time) Which is less than the reserved bus minimum idle time (T)Reserving idle time) A large certain value (T)Deviation value) I.e. satisfy TBus idle time>TReserving idle time+TDeviation value. And the start frame and the end frame of each intra can be detected, it is determined that intra-bus data transmission can be shortened. Recalculating the optimal time, T, allocatable to the indoor unitCorrection valueThe calculation may take the following formula: t isShortening time of each indoor unit=(TBus idle time-TReserving idle time-TDeviation value)/CNumber of internal machines
Such as calculating to obtain TShortening time of each indoor unit1.2 seconds, i.e. TCorrection value-1.2 seconds. Calculating N times according to the above formula, taking uniform value, and calculating TCorrection valueAnd sending the data to the internal units, and informing each internal unit to shorten the data updating period.
In another embodiment of this embodiment, the number of the access internal units can be monitored in real time, and the current communication cycle of the internal units is adjusted when the access internal units are increased or decreased. The method for adjusting the communication cycle of the internal unit according to the bus occupation parameters comprises the following steps:
s11, monitoring the increment of the internal machine accessed to the CAN bus in real time;
s12, if the increment of the internal machine is not equal to 0, calculating the change value of the communication period according to the increment of the internal machine; and if the increment of the internal machine is equal to 0, increasing the communication period of the internal machine according to the idle time of the bus.
Optionally, calculating a variation value of the communication cycle according to the indoor unit increment includes: calculating the bus required change time length of the CAN bus in each bus period according to the internal machine increment; the variation value T is calculated by the following formulaVariation value of each indoor unit:TVariation value of each indoor unit=N*TThe length of time that the bus needs to be changed(ii)/M + N; wherein, M is the original internal machine access amount of the CAN bus, and N is the internal machine increment.
Optionally, increasing the communication cycle of the internal unit according to the bus idle time includes: continuously detecting whether the idle time of the bus is less than a preset value according to a detection period; and if the bus idle time is less than the preset value, increasing the communication period of the internal machine according to the preset step length until the bus idle time is greater than or equal to the preset value.
In some scenes, the situation that part of the internal machines are not electrified or abnormal in communication or the internal machines are temporarily electrified and offline exists, so that the external machines monitor the communication bus data all the time, and if the change of the number of the internal machines of the bus is detected, and if the number of the internal machines is increased, the time (T) required to be increased of the bus is obtained according to the number of the electrified internal machines by calculation (T)Bus time increase) (if 3 machines are added, TBus time increase=3*TBus internal machine with maximum occupation). Calculating to obtain the average data sending time T which needs to be increased for each indoor unitIncreasing time of each indoor unitThe following formula may be adopted:
if the original bus has M-75 internal machines and N-5 new internal machines, i.e. 80 internal machines, T isIncreasing time of each indoor unit=TBus time increase/(75+5)=5*TMaximum bus internal machine occupation time/80。
Such as calculating to obtain TIncreasing time of each indoor unit1.6 seconds, i.e. TCorrection value1.6 seconds.
According to the above calculation formula, after calculating for many times, taking uniform value, and calculating TCorrection valueAnd sending the data to the internal units, and informing each internal unit to increase the data updating period.
If the number of the internal machines is not changed, the external machine of the air conditioner detects that the idle time of the bus is too short for many times, TBus idle time<TReserving idle time-TDeviation valueThen, the communication period T which should be increased for each internal unit is recalculatedIncreasing time of each indoor unit
The following formula can be used for calculation:
Tincreasing time of each indoor unit=(TReserving idle time+TDeviation value-TBus idle time)/CNumber of internal machines
Such as calculating to obtain TIncreasing time of each indoor unit0.5 seconds, i.e. TCorrection value0.5 second.
According to the above calculation formulaAfter calculating for many times, taking uniform value and calculating TCorrection valueAnd sending the data to the internal units, and informing each internal unit to shorten the data updating period.
If no idle time of the bus is continuously detected, each indoor unit is directly informed of the increased time T of the communication periodFixingWill TCorrection value(TCorrection value=TFixing) And sending to the communication network. And simultaneously monitoring the bus state, and if the idle time is not detected after a certain time, sending the T againCorrection value(TCorrection value=TFixing) Until it is detected that the bus idle time reaches a predetermined requirement.
Optionally, after adjusting the communication cycle of the internal unit according to the bus occupation parameter, the method includes: judging whether the communication period meets the preset working state of the air conditioning system or not; and if the preset working state is met, sending a control instruction to the internal unit, wherein the control instruction is used for indicating the internal unit to store a communication period and taking the communication period as an initialization parameter when the internal unit is powered on next time.
After automatic adjustment, the air conditioner external unit detects bus data and idle time for a period of time, and if both the bus data and the idle time reach preset conditions and meet preset working states (if the bus utilization rate is higher than a preset value, the number of the internal units is not abnormal, and the like), the internal unit is informed to store a correction value. And the next time the internal unit is powered on, data is sent according to the stored correction value.
Fig. 3 is a flowchart of the operation of the embodiment of the present invention, which automatically adjusts the data update cycle of the bus internal unit according to the number of internal units in the communication network and the bus data amount, so as to achieve the maximum bus utilization rate and update the data at the highest speed. The process comprises the following steps:
s31, electrifying the whole machine, and initializing an internal machine and an external machine of the air conditioning system;
s32, the air conditioner external unit is connected with the internal unit, the external unit determines whether the internal unit is on line or not through heartbeat, and the internal unit reports data to the external unit;
s331, monitoring the number of the internal machines, and jumping to S34 if the number of the internal machines changes;
s332, monitoring the idle time of the data frame and the bus of the internal machine, and jumping to S34 if the idle time is too long or too short;
and S34, calculating the correction value, and sending the correction value to all internal machines, wherein the internal machines receive the correction value and store the correction value locally.
By the scheme, the data updating period of the bus internal machine can be automatically adjusted according to the number of the internal machines of the communication network and the bus data volume, the maximum utilization rate of the bus is realized, and the data is updated at the highest speed. The bus internal machine data sending period can be dynamically adjusted in real time, the maximum utilization rate of the bus is achieved, and the data can be updated at the highest speed.
Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a bus resource allocation device and an air conditioning system are further provided for implementing the foregoing embodiments and preferred embodiments, which have already been described and are not repeated. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
An embodiment provides an apparatus for allocating bus resources, and fig. 4 is a block diagram of an apparatus for allocating bus resources according to an embodiment of the present invention, where the apparatus includes: an acquisition module 40, an adjustment module 42, wherein,
the system comprises an acquisition module 40, a bus occupation parameter calculation module and a control module, wherein the acquisition module is used for acquiring the bus occupation parameter of the air conditioning system, the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameter is used for representing the internal machine access quantity and the bus occupation information of the CAN bus;
and the adjusting module 42 is configured to adjust a communication cycle of the internal machine according to the bus occupation parameter.
Optionally, the obtaining module includes: the processing unit is used for counting the number of the internal machines connected to the air conditioning system and calculating the communication time length of each internal machine occupying the CAN bus; and the calculating unit is used for calculating the bus idle time of the CAN bus in a bus period and the maximum occupation time of the internal machine based on the number of the internal machines and the communication time.
Optionally, the adjusting module includes: the calculating unit is used for calculating the actual deviation value of subtracting the reserved idle time from the idle time of the CAN bus, wherein the adjustment of the bus occupation parameters comprises the idle time of the CAN bus; and the shortening unit is used for shortening the communication period of the internal machine if the actual deviation value is greater than a preset deviation value.
Optionally, the adjusting module includes: the monitoring unit is used for monitoring the increment of the internal machine accessed to the CAN bus in real time; the processing unit is used for calculating the change value of the communication period according to the increment of the internal machine if the increment of the internal machine is not equal to 0; and if the increment of the internal machine is equal to 0, increasing the communication period of the internal machine according to the bus idle time.
Optionally, the processing unit includes: the first calculating subunit is used for calculating the time length of the CAN bus required to change in each bus period according to the internal machine increment; a second calculating subunit for calculating the variation value T by using the following formulaVariation value of each indoor unit:TVariation value of each indoor unit=N*TThe length of time that the bus needs to be changed(ii)/M + N; and M is the original internal machine access amount of the CAN bus, and N is the internal machine increment.
Optionally, the processing unit includes: the detection subunit is used for continuously detecting whether the bus idle time length is smaller than a preset value according to a detection period; and the adding subunit is used for increasing the communication cycle of the internal machine according to a preset step length if the bus idle time is less than the preset value until the bus idle time is greater than or equal to the preset value.
Optionally, the apparatus further comprises: the judging module is used for judging whether the communication period meets the preset working state of the air conditioning system or not after the adjusting module adjusts the communication period of the internal unit according to the bus occupation parameter; and the sending module is used for sending a control instruction to the internal unit if the preset working state is met, wherein the control instruction is used for indicating the internal unit to store the communication period and taking the communication period as an initialization parameter when the internal unit is powered on next time.
The embodiment also provides an air conditioning system, which comprises an external unit and a plurality of internal units, wherein the external unit and the internal units are in communication connection through a Controller Area Network (CAN) bus, and the external unit comprises the device described in the embodiment.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in an aspect of the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, bus occupation parameters of the air conditioning system are obtained, wherein the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameters are used for representing the internal machine access quantity and bus occupation information of the CAN bus;
and S2, adjusting the communication cycle of the internal machine according to the bus occupation parameter.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in an aspect of this embodiment, the processor may be configured to execute the following steps by a computer program:
s1 and S1, bus occupation parameters of the air conditioning system are obtained, wherein the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameters are used for representing the internal machine access number and bus occupation information of the CAN bus;
and S2, adjusting the communication cycle of the internal machine according to the bus occupation parameter.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
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 principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for allocating bus resources, comprising:
acquiring bus occupation parameters of an air conditioning system, wherein the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameters are used for representing the internal machine access number and bus occupation information of the CAN bus;
adjusting the communication period of the internal machine according to the bus occupation parameter; which comprises the following steps: calculating the actual deviation value of subtracting the reserved idle time from the idle time of the CAN bus, wherein the adjustment of the bus occupation parameters comprises the idle time of the CAN bus;
and if the actual deviation value is larger than the preset deviation value, shortening the communication period of the internal machine.
2. The method of claim 1, wherein obtaining bus occupancy parameters for an air conditioning system comprises:
counting the number of the internal machines accessed to the air conditioning system, and calculating the communication time length of each internal machine occupying the CAN bus;
and calculating the bus idle time of the CAN bus in the bus period and the maximum occupation time of the internal machines based on the number of the internal machines and the communication time.
3. The method of claim 1, wherein adjusting the communication cycle of the indoor unit according to the bus occupancy parameter comprises:
monitoring the increment of an internal machine accessed to the CAN bus in real time;
if the increment of the internal machine is not equal to 0, calculating a change value of the communication period according to the increment of the internal machine; and if the increment of the internal machine is equal to 0, increasing the communication period of the internal machine according to the bus idle time.
4. The method of claim 3, wherein calculating the change value of the communication cycle based on the indoor unit increment comprises:
calculating the bus required change time length of the CAN bus in each bus period according to the internal machine increment;
the variation value T is calculated by the following formulaVariation value of each indoor unit:TVariation value of each indoor unit=N*TThe length of time that the bus needs to be changed/M+N;
And M is the original internal machine access amount of the CAN bus, and N is the internal machine increment.
5. The method of claim 3, wherein increasing the communication cycle of the internal unit according to the bus idle duration comprises:
continuously detecting whether the idle time of the bus is smaller than a preset value according to a detection period;
and if the bus idle time is less than the preset value, increasing the communication period of the internal machine according to a preset step length until the bus idle time is greater than or equal to the preset value.
6. The method of claim 1, wherein after adjusting the communication cycle of the internal unit according to the bus occupancy parameter, the method further comprises:
judging whether the communication period meets a preset working state of the air conditioning system or not;
and if the preset working state is met, sending a control instruction to the internal machine, wherein the control instruction is used for indicating the internal machine to store the communication period and taking the communication period as an initialization parameter when the internal machine is powered on next time.
7. An apparatus for allocating bus resources, comprising:
the system comprises an acquisition module, a control module and a control module, wherein the acquisition module is used for acquiring bus occupation parameters of an air conditioning system, the air conditioning system is in communication connection with an external machine and a plurality of internal machines through a Controller Area Network (CAN) bus, and the bus occupation parameters are used for representing the internal machine access quantity and bus occupation information of the CAN bus;
the adjusting module is used for adjusting the communication period of the internal machine according to the bus occupation parameter;
the adjustment module includes: the calculating unit is used for calculating the actual deviation value of subtracting the reserved idle time from the idle time of the CAN bus, wherein the adjustment of the bus occupation parameters comprises the idle time of the CAN bus; and the shortening unit is used for shortening the communication period of the internal machine if the actual deviation value is greater than a preset deviation value.
8. An air conditioning system comprising an external unit and a plurality of internal units communicatively connected via a controller area network, CAN, bus, wherein the external unit comprises the apparatus of claim 7.
9. A storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 6 when executed.
10. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 6.
CN202010470595.2A 2020-05-28 2020-05-28 Bus resource allocation method and device and air conditioning system Active CN111835609B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010470595.2A CN111835609B (en) 2020-05-28 2020-05-28 Bus resource allocation method and device and air conditioning system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010470595.2A CN111835609B (en) 2020-05-28 2020-05-28 Bus resource allocation method and device and air conditioning system

Publications (2)

Publication Number Publication Date
CN111835609A CN111835609A (en) 2020-10-27
CN111835609B true CN111835609B (en) 2021-08-03

Family

ID=72914060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010470595.2A Active CN111835609B (en) 2020-05-28 2020-05-28 Bus resource allocation method and device and air conditioning system

Country Status (1)

Country Link
CN (1) CN111835609B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113483462B (en) * 2021-04-30 2022-12-16 佛山市顺德区美的电子科技有限公司 Air conditioner and data transmission method and storage medium thereof based on power line communication

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203718934U (en) * 2013-11-27 2014-07-16 广东美的制冷设备有限公司 Air conditioner indoor unit and air conditioner adopting same
WO2016019938A1 (en) * 2014-08-08 2016-02-11 Gentherm Gmbh Bus system and method for controlling the same
CN105910238A (en) * 2016-05-13 2016-08-31 广东美的暖通设备有限公司 Multi-online air-conditioning system and communication method and device thereof
CN106452671A (en) * 2016-09-28 2017-02-22 青岛海尔空调电子有限公司 Internal unit and external unit communication method of multi-split air-conditioner
CN108234266A (en) * 2018-01-22 2018-06-29 珠海格力电器股份有限公司 The data transmission method and device and storage medium of bus-type communication network
CN110906517A (en) * 2019-10-16 2020-03-24 华中师范大学 Central air-conditioning centralized control system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105698340B (en) * 2016-03-23 2019-01-25 珠海格力电器股份有限公司 Control system, modularization computer-room air conditioning system and its control method of air conditioner in machine room

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN203718934U (en) * 2013-11-27 2014-07-16 广东美的制冷设备有限公司 Air conditioner indoor unit and air conditioner adopting same
WO2016019938A1 (en) * 2014-08-08 2016-02-11 Gentherm Gmbh Bus system and method for controlling the same
CN105910238A (en) * 2016-05-13 2016-08-31 广东美的暖通设备有限公司 Multi-online air-conditioning system and communication method and device thereof
CN106452671A (en) * 2016-09-28 2017-02-22 青岛海尔空调电子有限公司 Internal unit and external unit communication method of multi-split air-conditioner
CN108234266A (en) * 2018-01-22 2018-06-29 珠海格力电器股份有限公司 The data transmission method and device and storage medium of bus-type communication network
CN110906517A (en) * 2019-10-16 2020-03-24 华中师范大学 Central air-conditioning centralized control system

Also Published As

Publication number Publication date
CN111835609A (en) 2020-10-27

Similar Documents

Publication Publication Date Title
CN112332889B (en) Data transmission method and device, power line communication network and power system
US20220272661A1 (en) Information transmission method and device
US9936497B2 (en) Node scheduling method and system and device
CN112671904B (en) Method and device for transmitting equipment state information, storage medium and electronic device
CN112565035B (en) Data transmission method, device and storage medium
CN111835609B (en) Bus resource allocation method and device and air conditioning system
CN110972120A (en) Low-power-consumption Bluetooth device multilink management method, system and device
CN111148085B (en) Bluetooth gateway circuit, intelligent room subsystem, link control method and device
EP3541120A1 (en) Data processing apparatus and method
CN112437454A (en) Data transmission method and device, storage medium and electronic device
CN108605114B (en) Control method, control device and network controller
CN112752319A (en) Network switching method, device, terminal and storage medium
US20190182774A1 (en) Communicating timing information for a next dio transmission
CN110167120B (en) Wireless star-type network low-power consumption equipment of Internet of things
CN112887416B (en) Frequency adjustment method and device for sending keep-alive packets
CN112203357B (en) Random access method, device, storage medium and electronic equipment
CN110708707B (en) Method and equipment for returning terminal to resident sub-band in private network wireless communication
CN114554436A (en) Passive Internet of things node medium access control method, system, device and medium
CN113099536B (en) Data communication method and device
CN112804757B (en) Switching method and device of frequency domain resource allocation types and readable storage medium
CN116847474B (en) Data transmission method and device based on CSMA protocol, communication equipment and power system
CN116319712B (en) Wireless upgrading method and device for slave nodes of power equipment body area network
CN101977399B (en) LTE (Long Term Evolution) data business throughput rate counting method and network equipment
CN111491323A (en) IAB-based method and device for reserving uplink transmission resources
CN110391923A (en) The method and the network equipment of multicast message processing

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