CN115343992A - Data transmission method, device, controller, control system and storage medium - Google Patents

Data transmission method, device, controller, control system and storage medium Download PDF

Info

Publication number
CN115343992A
CN115343992A CN202210974094.7A CN202210974094A CN115343992A CN 115343992 A CN115343992 A CN 115343992A CN 202210974094 A CN202210974094 A CN 202210974094A CN 115343992 A CN115343992 A CN 115343992A
Authority
CN
China
Prior art keywords
bus
data transmission
sent
instruction
equipment
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.)
Pending
Application number
CN202210974094.7A
Other languages
Chinese (zh)
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 CN202210974094.7A priority Critical patent/CN115343992A/en
Publication of CN115343992A publication Critical patent/CN115343992A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/21Pc I-O input output
    • G05B2219/21063Bus, I-O connected to a bus

Abstract

The disclosure provides a data transmission method, a device, a controller, a control system and a storage medium, wherein the method comprises the following steps: determining the data transmission rate of the bus, and judging whether the bus is in a busy state or not based on the data transmission rate and the maximum allowable data transmission rate of the bus; when the bus is in a busy state, stopping sending the instruction needing to be sent to the equipment through the bus; and caching the instructions in the first cache unit and merging the instructions. The bus data communication method and the device can implement arbitration scheduling on the instruction needing to be sent to the equipment according to the judgment result of whether the bus is in a busy state, provide a buffer processing mechanism for the instruction, ensure the real-time property, the certainty and the reliability of bus data communication, and avoid the occurrence of the abnormity of overload, congestion and the like of the bus.

Description

Data transmission method, device, controller, control system and storage medium
Technical Field
The present invention relates to the field of control technologies, and in particular, to a data transmission method, apparatus, controller, control system, and storage medium.
Background
The control system can control and manage the equipment through the controller, and the control system can be a building automatic control system and other various control systems. For example, a building automation system is divided into a management layer, a control layer and a device layer, as shown in fig. 1; the device at the device layer is accessed to the management software of the management device at the management layer through the controller at the control layer for data display. The controller and the management software generally use the Ethernet to carry out high-speed communication, the controller and the equipment generally use a low-speed bus to carry out communication, and under the conditions that the management software frequently sends control instructions, the data transmitted by the bus is overloaded and the like, the field bus data congestion is easily caused, and the phenomena of data serial codes and code missing are caused.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a data transmission method, apparatus, controller, control system and storage medium, which can stop sending instructions and cache and merge the instructions when a bus is busy.
According to a first aspect of the present disclosure, there is provided a data transmission method applied in a controller, including: determining the data transmission rate of a bus, and judging whether the bus is in a busy state or not based on the data transmission rate and the maximum allowable data transmission rate of the bus; when the bus is judged to be in a busy state, stopping sending an instruction needing to be sent to equipment through the bus; and caching the instructions in a first cache unit and carrying out merging processing on the instructions.
Optionally, the determining whether the bus is in a busy state based on the data transfer rate and the maximum allowed data transfer rate of the bus comprises: calculating the ratio of the data transmission rate to the maximum allowable data transmission rate as a bus load rate; and judging whether the bus load rate is greater than a preset load rate threshold value, if so, judging that the bus is in a busy state, and if not, judging that the bus is in a non-busy state.
Optionally, when it is determined that the bus is in a non-busy state, determining, according to the maximum allowable data transmission rate, the load rate threshold, and a transmission data prediction amount corresponding to transmitting each cached instruction, an instruction to be transmitted that needs to be transmitted to the device in each transmission cycle; and sending a message corresponding to the instruction to be sent to the equipment through the bus in the sending period.
Optionally, the merging the instruction includes: when the instruction is cached in the first cache unit, if the same instruction is determined to be cached in the first cache unit, the instruction is not cached in the first cache unit.
Optionally, the device data sent by the device through the bus is received, the device data is cached in the second cache unit, and the cached corresponding device data in the second cache unit is updated.
Optionally, the instruction is generated according to the device data cached in the second cache unit and/or a command sent by the management device.
Optionally, the determining the data transmission rate of the bus comprises: receiving a message sent by the equipment through the bus by using a receiving task; sending a message to the equipment through the bus by using a sending task; and determining the data transmission rate according to the number of the messages sent by the equipment and the number of the messages sent to the equipment.
Optionally, at least one of the message sent by the device, the instruction, and the message sent to the device is checked.
Optionally, the bus comprises: a CAN bus and an R485 bus; the first cache unit includes: and (6) buffering the queue.
According to a second aspect of the present disclosure, there is provided a data transmission apparatus, applied in a controller, including: the state judgment module is used for determining the data transmission rate of a bus and judging whether the bus is in a busy state or not based on the data transmission rate and the maximum allowable data transmission rate of the bus; and the scheduling processing module is used for stopping sending the instruction needing to be sent to the equipment through the bus when the bus is judged to be in a busy state, caching the instruction in the first cache unit and combining the instruction.
Optionally, the state determining module includes: a busy determining unit, configured to calculate a ratio of the data transmission rate to the maximum allowable data transmission rate as a bus load rate; and judging whether the bus load rate is greater than a preset load rate threshold value, if so, judging that the bus is in a busy state, and if not, judging that the bus is in a non-busy state.
Optionally, the scheduling processing module is further configured to determine, when it is determined that the bus is in a non-busy state, an instruction to be sent that needs to be sent to the device in each sending period according to the maximum allowed data transmission rate, the load rate threshold, and a transmission data prediction amount corresponding to each instruction that is sent to be cached; and sending a message corresponding to the instruction to be sent to the equipment through the bus in the sending period.
Optionally, the scheduling processing module is further configured to, when the instruction is cached in the first cache unit, if it is determined that the same instruction is already cached in the first cache unit, not cache the instruction in the first cache unit.
Optionally, the device data processing module is configured to receive device data sent by the device through a bus, cache the device data in a second cache unit, and update corresponding device data cached in the second cache unit.
Optionally, the instruction generating module is configured to generate the instruction according to the device data cached in the second caching unit and/or a command sent by the management device.
Optionally, the state determining module includes: a transmission rate determining unit, configured to receive, by using a receiving task, a packet sent by the device through the bus; sending a message to the equipment through the bus by using a sending task; and determining the data transmission rate according to the number of the messages sent by the equipment and the number of the messages sent to the equipment.
Optionally, the compliance verification module is configured to perform verification processing on at least one of the message sent by the device, the instruction, and the message sent to the device.
According to a third aspect of the present disclosure, there is provided a data transmission apparatus comprising: a memory; and a processor coupled to the memory, the processor configured to perform the method as described above based on instructions stored in the memory.
According to a fourth aspect of the present disclosure, there is provided a controller comprising: a data transmission apparatus as described above.
According to a fifth aspect of the present disclosure, there is provided a control system comprising: a controller as described above.
According to a sixth aspect of the present disclosure, there is provided a computer readable storage medium storing computer instructions for execution by a processor to perform the method as described above.
The data transmission method, the device, the controller, the control system and the storage medium can implement arbitration scheduling on the instruction needing to be sent to the equipment according to the judgment result of whether the bus is in a busy state, provide a buffering processing mechanism for the instruction, ensure the real-time performance, the certainty and the reliability of bus data communication, avoid the bus from being overloaded, congested and other abnormalities, avoid the situations of data serial codes, code missing and the like, and enhance the user experience.
Drawings
In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without inventive exercise.
Fig. 1 is a schematic topology diagram of a building automation system in the prior art;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a data transmission method according to the present disclosure;
FIG. 3 is a schematic flow chart of a busy status determination in an embodiment of a data transmission method according to the present disclosure;
FIG. 4 is a schematic flow chart diagram illustrating sending commands in one embodiment of a data transmission method according to the present disclosure;
FIG. 5 is a schematic diagram of a functional implementation of a controller in an embodiment of a data transmission method according to the present disclosure;
FIG. 6 is a block schematic diagram of one embodiment of a data transmission device according to the present disclosure;
FIG. 7 is a block diagram representation of another embodiment of a data transmission device according to the present disclosure;
FIG. 8 is a block diagram illustrating a status determination module in an embodiment of a data transmission device according to the present disclosure;
fig. 9 is a block schematic diagram of yet another embodiment of a data transmission device according to the present disclosure.
Detailed Description
The present disclosure now will be described more fully hereinafter with reference to the accompanying drawings, in which exemplary embodiments of the disclosure are shown. The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are only a part of the embodiments of the present disclosure, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
The terms "first", "second", and the like are used hereinafter only for descriptive distinction and have no other special meaning.
In the related art known by the inventor, the controllers and management software of the building automation system usually use ethernet to perform high-speed communication (with a rate of 10-1000 Mbps), while the controllers and devices usually use low-speed buses (such as RS485, RS232 bus, etc., with a communication rate of 2400-115200 bps), and there is a large rate difference between the two layers. If the management software frequently issues control instructions, the phenomena of data string codes and code deficiency caused by field bus data congestion are easily caused, and if the phenomena are serious, the condition that the field equipment is down is caused.
Currently, it is common to set a sufficient duration frame interval (e.g., a fixed duration such as 10 ms) between two frames of data to ensure the stability of the bus, for example, the Modbus protocol of RS485 bus requires a duration frame interval of 3.5 characters or more. However, for buses with different rates (for example, an RS485 bus may be switched to 4800, 9600, 57600, etc., with the same duration interval processing manner, the frame interval duration cannot be dynamically adapted according to the rate of the bus, the performance of the bus cannot be fully utilized, the real-time performance of the system is reduced, and when the interval duration is insufficient, the bus is easily impacted.
Fig. 2 is a schematic flowchart of an embodiment of a data transmission method according to the present disclosure, which is applied in a controller, as shown in fig. 2:
step 201, determining the data transmission rate of the bus, and judging whether the bus is in a busy state based on the data transmission rate and the maximum allowable data transmission rate of the bus.
In one embodiment, the bus may be a variety of buses, such as a CAN bus, an R485 bus, or the like. The data transfer rate of the bus is the amount of data transferred on the bus per unit time, e.g., the number of bytes transferred per second of the bus, and can be determined in real time. The maximum allowed data transfer rate of the bus is the maximum amount of data that can be transferred on the bus per unit time, for example, the maximum number of bytes per second that can be transferred on the bus.
Step 202, when the bus is determined to be in a busy state, stopping sending the instruction to be sent to the device through the bus.
Step 203, caching the instructions in the first cache unit and merging the instructions.
In one embodiment, the device may be a variety of devices located at a device layer, such as an air conditioner, a monitoring device, and the like, and the command may be a control command, and the like. And when the bus is in a busy state, stopping sending the instruction to the equipment through the bus, and at the stage, caching the instruction needing to be sent to the equipment in the first cache unit and merging the instruction.
When the bus is judged to be restored to the non-busy state, instructions are extracted from the first cache unit and sent to the equipment through the bus; and caching the instructions to be sent to the equipment in the first cache unit and merging the instructions. The instructions can be packaged into corresponding messages according to the bus type and the adopted protocol, the instructions are sent to the equipment through the messages, and the messages can have various frame structures.
Fig. 3 is a schematic flow chart of a busy state determination in an embodiment of a data transmission method according to the present disclosure, as shown in fig. 3:
step 301, calculating the ratio of the data transmission rate to the maximum allowable data transmission rate as the bus load rate.
Step 302, judging whether the bus load rate is greater than a preset load rate threshold, if so, judging that the bus is in a busy state, and if not, judging that the bus is in a non-busy state.
In one embodiment, a number of methods may be employed to determine the data transfer rate of the bus. For example, a message sent by a device over a bus is received by a receiving task, and a message is sent to a device over a bus by a sending task. The receiving task and the sending task set by the controller can be a thread or a process, and can realize concurrent execution processing of data receiving and sending. And determining the data transmission rate according to the number of the messages sent by the equipment and the number of the messages sent to the equipment. For example, the data transfer rate is determined by counting the number of bytes of a message transmitted by the device and a message transmitted to the device, which are transmitted on the bus per unit time.
The receiving task and the sending task directly interact with the bus, and the receiving task monitors a message sent by equipment on the bus in real time through hardware interrupt processing of the controller; and the sending task sends the message to be sent to the equipment to the bus. And recording the number of messages sent by the equipment and the number of messages sent to the equipment through a counter. The maximum allowed data transfer rate of the bus can be obtained by the baud rate of the bus. For example, the bus is an RS485 bus, the baud rate of the bus is 9600bps, and the start bit 1, the data bit 8, the stop bit 1, and the check bit 0 of the message transmitted on the bus. Under the condition that the Baud rate of the access bus is 9600bps, the maximum allowable transmission byte number of the bus per second is 960 message bytes, namely the maximum allowable data transmission rate of the bus.
The number of bytes transmitted by the bus per second, namely the data transmission rate of the bus, can be calculated by collecting the data transmitted in the bus in real time through the receiving task and the sending task. If the number of bytes transmitted by the bus per second/the maximum allowed number of bytes transmitted by the bus is larger than a preset load rate threshold (for example, 70%, 75%, etc.), it is determined that the bus is busy, the sending of the instruction to be sent to the device through the bus is stopped, and the instruction is buffered in the first buffer unit and merged.
Fig. 4 is a schematic flowchart of a sending instruction in an embodiment of a data transmission method according to the present disclosure, as shown in fig. 4:
step 401, when the bus is determined to be in a non-busy state, determining the instructions to be sent to the device in each sending cycle based on the maximum allowed data transmission rate, the load rate threshold, and the transmission data prediction amount corresponding to each instruction to be sent.
In one embodiment, the bus is determined to be in a non-busy state when the value of the data transfer rate/maximum allowed data transfer rate is less than or equal to a preset load rate threshold (e.g., 75%). And under the condition that the bus is in a non-busy state, buffering the instructions in the first buffer unit and carrying out merging processing on the instructions. And extracting the instruction from the first cache unit, and sending the instruction to the device through the bus. The first buffer unit may be a buffer queue, and the like, and may send the instructions in the order of the receiving time based on a first-in first-out principle of the buffer queue.
There may be more instructions buffered in the first buffer unit, and if all the buffered instructions are sent at one time, the bus may be congested. A transmission period may be set, and the transmission period may be 1 second or the like. For example, the transmission cycle is set to 1 second, that is, the instructions are periodically transmitted at 1 second intervals. When the load factor threshold is 75%, the maximum allowable data transmission rate is multiplied by the load factor threshold, and the product is determined as the data transmission allowable rate, or the product is multiplied by a coefficient (e.g., 0.6, 0.7, etc.), and the result is determined as the data transmission allowable rate, for example, the data transmission allowable rate is B bytes/sec.
A predicted amount of transfer data corresponding to each instruction buffered in the first buffer unit is retrieved for transmission. For example, for the buffered instruction 1, the message for sending the instruction 1 in the bus is determined to be C bytes, and the real-time response message of each device for the instruction 1 is expected to be D bytes, so that the transmission data prediction amount corresponding to sending the buffered instruction 1 is determined to be C + D = E bytes. Determining the instructions to be sent which need to be sent to the equipment in each sending period from the instructions cached in the first caching unit, wherein the sum of the transmission data prediction quantity of all the instructions to be sent is obtained, and the data transmission rate of the bus is determined to be A bytes/second based on the transmission data prediction quantity, so that the A bytes/second is smaller than the data transmission allowable rate B bytes/second.
Step 402, sending a message corresponding to the command to be sent to the device through the bus in the sending period.
When bus communication scheduling is needed, determining a command to be sent which needs to be sent to equipment in each sending period. In a sending cycle, a corresponding message is generated by a command to be sent to the device and sent to the bus, and the data volume of the device responding to the message in the bus sending cycle can be adjusted, so that the data interaction of each device connected to the bus can be guaranteed, and the real-time performance, the certainty and the reliability of bus data communication can be guaranteed.
In one embodiment, the merging of instructions may take a variety of approaches. For example, when an instruction is cached in the first cache unit, if it is determined that the same instruction is already stored in the first cache unit, the instruction is not cached in the first cache unit.
For example, the management device continuously issues a plurality of identical control commands, and generates a plurality of instructions corresponding to the plurality of identical control commands; when the first instruction is cached in the first cache unit, if the same instruction is determined to be stored in the first cache unit when the rest instructions are cached in the first cache unit, the rest instructions are not cached in the first cache unit, and therefore merging processing of the same commands repeatedly issued by the management equipment for multiple times can be achieved, and only one issuing is carried out.
In one embodiment, the device data sent by the receiving device through the bus is cached in the second cache unit, and the cached corresponding device data in the second cache unit is updated. The second cache unit may be any of a variety of existing cache units. The controller may communicate with the device via a protocol and receive device data sent by the device via the bus.
For example, the device is an air conditioner, the device data includes device operating state data such as an operating state of the air conditioner, a wind speed, a temperature and the like, and the controller caches the device data in the second cache unit. When the device data is cached in the second cache unit, updating is performed when it is determined that the corresponding device data is cached in the second cache unit. For example, the running state of the air conditioner a cached in the second cache unit is the starting state, the received device data is the running state of the air conditioner a is the closing state, and when the device data is cached, the running state of the air conditioner a cached in the second cache unit is updated, so that the running state of the air conditioner a cached in the second cache unit is updated to be the closing state.
In one embodiment, the instruction is generated according to the device data cached in the second cache unit, a command sent by the management device, and the like. For example, the device data cached in the second cache unit includes that the operation state of the air conditioner a is the off state, the device data is acquired, and if the air conditioner a is judged to be the on state at this time based on the service logic, the on instruction for the air conditioner a is generated. The management device can be a mobile phone, a PC and the like, receives a starting command for the air conditioner B sent by the management device, and generates a starting instruction for the air conditioner B.
One or more of the messages and the instructions sent by the equipment and the messages sent to the equipment are checked, and various checking methods can be used. For example, format check is performed on a message sent by the device and a message sent to the device, and whether an error occurs in the message is detected. And (4) performing compliance verification on the instruction, for example, if the instruction is an instruction for setting the temperature of the air conditioner to be 100 degrees, determining that the instruction is not compliant, and filtering the instruction.
In one embodiment, as shown in fig. 5, the receiving task interrupts the real-time receiving device from the message sent to the controller through the controller hardware, and extracts the device data and other data from the message. The sending task extracts the instruction from the queue (first cache unit), generates a message corresponding to the instruction, and sends the message into the bus. The receiving task and the sending task are both processes and the like.
The dynamic data synchronization reloading function is called in the receiving task, after the receiving task obtains the device data from the bus, the device data is cached in a CACHE (second CACHE unit), and the cached corresponding device data is updated. The service logic is a service logic function operated in the controller, and management equipment is not needed to participate in regulation and control. For example, for a fan setting wind speed, the gear and speed of the motor can be determined by the business logic function. And the control management function generates a corresponding instruction for a control command issued by the external management equipment. The arbitration scheduling is an arbitration scheduling function operated in the controller, and is used for realizing functions of judging that the bus is in a busy state, scheduling instructions to be sent to equipment and the like.
The data transmission method can implement arbitration scheduling on the instruction to be sent to the equipment according to the judgment result of whether the bus is in a busy state, provides a buffering processing mechanism for the instruction, can ensure the real-time property, the certainty and the reliability of bus data communication, and can avoid the occurrence of the abnormity of overload, congestion and the like of the bus.
In one embodiment, as shown in fig. 6, the present disclosure provides a data transmission apparatus 60 including a status determination module 61 and a scheduling processing module 62. The status judging module 61 determines the data transfer rate of the bus and judges whether the bus is in a busy state based on the data transfer rate and the maximum allowable data transfer rate of the bus. When it is determined that the bus is busy, the scheduling processing module 62 stops sending instructions over the bus that need to be sent to the device. The dispatch processing module 62 caches and merges the instructions in the first cache unit.
In one embodiment, as shown in FIG. 7, the data transmission apparatus 60 further includes a device data processing module 63, an instruction generation module 64, and a compliance verification module 65. The device data processing module 63 receives device data sent by the device through the bus, caches the device data in the second cache unit, and updates the cached corresponding device data in the second cache unit.
The instruction generating module 64 generates an instruction according to the device data cached in the second caching unit and/or a command sent by the management device. The compliance verification module 65 performs verification processing on at least one of the message, the instruction, and the message sent to the device.
In one embodiment, as shown in fig. 8, the status determination module 61 includes a busy determination unit 611 and a transmission rate determination unit 612. The busy determination unit 611 calculates a ratio of the data transmission rate to the maximum allowable data transmission rate as the bus load rate. The busy determining unit 611 determines whether the bus load rate is greater than a preset load rate threshold, if so, the busy determining unit 611 determines that the bus is in a busy state, and if not, the busy determining unit 611 determines that the bus is in a non-busy state.
The transmission rate determining unit 612 receives a message sent by a device through a bus by using a receiving task; the transmission rate determining unit 612 transmits a message to the device through the bus by using the transmission task; the transmission rate determining unit 612 determines a data transmission rate according to the number of messages sent by the device and the number of messages sent to the device.
When it is determined that the bus is not busy, the scheduling processing module 62 determines the instructions to be sent to the device in each sending cycle based on the maximum allowed data transmission rate, the load rate threshold, and the predicted amount of transmission data corresponding to sending each buffered instruction. The scheduling processing module 62 sends a message corresponding to the instruction to be sent to the device through the bus in the sending period. When the scheduling processing module 62 caches the instruction in the first cache unit, if it is determined that the same instruction is already cached in the first cache unit, the instruction is not cached in the first cache unit.
Fig. 9 is a block schematic diagram of yet another embodiment of a data transmission device according to the present disclosure. As shown in fig. 9, the data transmission device may include a memory 91, a processor 92, a communication interface 93, and a bus 94. The memory 91 is used for storing instructions, the processor 92 is coupled to the memory 91, and the processor 92 is configured to implement the data transmission method described above based on the instructions stored in the memory 91.
The memory 91 may be a high-speed RAM memory, a non-volatile memory (non-volatile memory), or the like, and the memory 91 may be a memory array. The storage 91 may also be partitioned and the blocks may be combined into virtual volumes according to certain rules. The processor 92 may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement the data transmission method of the present disclosure.
In one embodiment, the present disclosure provides a controller comprising the data transmission device as in any of the above embodiments.
In one embodiment, the present disclosure provides a control system comprising a controller as in any of the above embodiments. The control system can be various control systems, such as a building automatic control system and the like.
In one embodiment, the present disclosure provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement a data transmission method as in any one of the above embodiments.
The data transmission method, the data transmission device, the controller, the control system and the storage medium in the embodiments can implement arbitration scheduling on the instruction to be sent to the device according to the judgment result of whether the bus is in a busy state, provide a buffering processing mechanism for the instruction, ensure the real-time performance, the certainty and the reliability of bus data communication, avoid the occurrence of the abnormal conditions of overload, congestion and the like of the bus, avoid the occurrence of the conditions of data serial codes, code missing and the like, and improve the use sensitivity of a user.
The method and system of the present disclosure may be implemented in a number of ways. For example, the methods and systems of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
The description of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the disclosure in the form disclosed. Many modifications and variations will be apparent to practitioners skilled in this art. The embodiment was chosen and described in order to best explain the principles of the disclosure and the practical application, and to enable others of ordinary skill in the art to understand the disclosure for various embodiments with various modifications as are suited to the particular use contemplated.

Claims (14)

1. A data transmission method is applied to a controller and comprises the following steps:
determining the data transmission rate of a bus, and judging whether the bus is in a busy state or not based on the data transmission rate and the maximum allowable data transmission rate of the bus;
when the bus is judged to be in a busy state, stopping sending an instruction needing to be sent to equipment through the bus;
and caching the instructions in a first cache unit and carrying out merging processing on the instructions.
2. The method of claim 1, the determining whether the bus is in a busy state based on the data transfer rate and a maximum allowed data transfer rate for the bus comprising:
calculating the ratio of the data transmission rate to the maximum allowable data transmission rate as a bus load rate;
and judging whether the bus load rate is greater than a preset load rate threshold value, if so, judging that the bus is in a busy state, and if not, judging that the bus is in a non-busy state.
3. The method of claim 2, further comprising:
when the bus is judged to be in a non-busy state, determining a command to be sent which needs to be sent to the equipment in each sending period according to the maximum allowed data transmission rate, the load rate threshold and the transmission data prediction quantity corresponding to each command which is cached in sending;
and sending a message corresponding to the instruction to be sent to the equipment through the bus in the sending period.
4. The method of claim 1, the merging the instructions comprising:
when the instruction is cached in the first cache unit, if the instruction is determined to be cached in the first cache unit, the instruction is not cached in the first cache unit.
5. The method of claim 1, further comprising:
and receiving the device data sent by the device through the bus, caching the device data in a second cache unit, and updating the cached corresponding device data in the second cache unit.
6. The method of claim 5, further comprising:
and generating the instruction according to the equipment data cached in the second cache unit and/or a command sent by the management equipment.
7. The method of claim 1, the determining a data transfer rate of the bus comprising:
receiving a message sent by the equipment through the bus by using a receiving task;
sending a message to the equipment through the bus by using a sending task;
and determining the data transmission rate according to the number of the messages sent by the equipment and the number of the messages sent to the equipment.
8. The method of claim 7, further comprising:
and at least one of the message sent by the equipment, the instruction and the message sent to the equipment is checked.
9. The method of any one of claims 1 to 8,
the bus includes: a CAN bus and an R485 bus; the first cache unit includes: and (6) buffering the queue.
10. A data transmission device is applied to a controller and comprises:
the state judgment module is used for determining the data transmission rate of a bus and judging whether the bus is in a busy state or not based on the data transmission rate and the maximum allowable data transmission rate of the bus;
the scheduling processing module is used for stopping sending the instruction which needs to be sent to the equipment through the bus when the bus is judged to be in a busy state; and caching the instructions in a first cache unit and carrying out merging processing on the instructions.
11. A data transmission apparatus comprising:
a memory; and a processor coupled to the memory, the processor configured to perform the method of any of claims 1-9 based on instructions stored in the memory.
12. A controller, comprising:
a data transmission arrangement as claimed in claim 10 or 11.
13. A control system, comprising:
the controller of claim 12.
14. A computer readable storage medium storing computer instructions for execution by a processor of the method of any one of claims 1 to 9.
CN202210974094.7A 2022-08-15 2022-08-15 Data transmission method, device, controller, control system and storage medium Pending CN115343992A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210974094.7A CN115343992A (en) 2022-08-15 2022-08-15 Data transmission method, device, controller, control system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210974094.7A CN115343992A (en) 2022-08-15 2022-08-15 Data transmission method, device, controller, control system and storage medium

Publications (1)

Publication Number Publication Date
CN115343992A true CN115343992A (en) 2022-11-15

Family

ID=83952838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210974094.7A Pending CN115343992A (en) 2022-08-15 2022-08-15 Data transmission method, device, controller, control system and storage medium

Country Status (1)

Country Link
CN (1) CN115343992A (en)

Similar Documents

Publication Publication Date Title
CN101460912B (en) Data communication flow control device and methods thereof
CA2046950C (en) Expert system method for performing window protocol-based data flow analysis within a data communication network
US8942089B2 (en) Method and apparatus for adaptive fast start in link aggregation
JP4257307B2 (en) Communication control system and communication control method
CN103326953A (en) Flow limiting method and device based on token buckets
CN111683252B (en) Server and output system and method of video compression image
CN109525447B (en) Method and device for adjusting network transmission bandwidth and electronic equipment
US6192440B1 (en) System and method for dynamically selecting interrupt storage time threshold parameters
US7177963B2 (en) System and method for low-overhead monitoring of transmit queue empty status
WO2015018003A1 (en) Ltr/obff design scheme for ethernet adapter application
CN114968556A (en) Data center energy consumption management method and system
CN115343992A (en) Data transmission method, device, controller, control system and storage medium
US6189067B1 (en) System and method for dynamically selecting interrupt quantity threshold parameters
CN101159700A (en) Flow control method and control equipment
CN115514710B (en) Weak connection flow management and control method based on self-adaptive sliding window
JP4849270B2 (en) Computer equipment
CN113612624B (en) Method and device for processing heartbeat between nodes
KR20110102983A (en) Apparatus and method for dynamic lane operation in multi-lane based ethernet
US11646971B2 (en) Limiting backpressure with bad actors
JP2009135567A (en) Data transfer apparatus
US10951526B2 (en) Technologies for efficiently determining a root of congestion with a multi-stage network switch
CN103973671A (en) Method and device for controlling number of users accessing firewall of local area network
EP1110150B1 (en) Communicating the status of a peripheral device controller to a host processor
CN115883465A (en) Flow control method, device, server, system and storage medium
JP2010272905A (en) Repeater device and air conditioning network system including the same

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