Slave event data uploading method and system based on time slot

Through the time slot-based slave event data upload method, the problem of low upload efficiency caused by the slave needs to wait for host polling in the prior art is solved, and more efficient and intelligent data upload is achieved.

CN120281599APending Publication Date: 2025-07-08SHENZHEN HERUNDA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510451184.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-07-08

AI Technical Summary

Technical Problem

In the existing RS485 communication method, the slave needs to wait for the host to poll before uploading event data, resulting in low upload efficiency and increased waiting time, and lack of intelligence.

Method used

The slave event data upload method based on slot is adopted, and the host sends polling frames and time slot divisions, allowing the slave to upload data directly to the host during a specific event upload time period, including event data and reply data.

Benefits of technology

It improves the efficiency of uploading slave event data, reduces waiting time, and improves the intelligence and accuracy of data upload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120281599A_ABST
    Figure CN120281599A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of multi-machine communication, and discloses a time slot-based slave event data uploading method and system, the method realizes data transmission of formation / capacity grading equipment through a communication system, and the method comprises the following steps: a slave receives a polling frame for a target slave sent by a host to the target slave, determines a receiving moment when the polling frame is received, and sends the polling frame to the host; determining that the host is in a data receiving state according to the polling frame; calculating an uploading time slot of the slave according to the event uploading time slot and the receiving time of the slave; in the uploading time slot, judging whether event data needing to be uploaded to the host exist in the current data of the slave; and when judging that the event exists, uploading the event data to a host. It can be seen that when any slave has the event data needing to be reported, the slave can directly upload the event data to the host no matter whether the host polls the slave or not currently, the event data uploading efficiency of the slave can be improved, and the waiting time for uploading the event data by the slave can be shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multi-machine communication, and in particular to a method and system for uploading slave event data based on time slots. Background Art

[0002] In a formation / grading device, large current charging and discharging almost always occur, and the large current will cause great interference to surrounding devices or electronic components in the device, especially to communication. Therefore, the RS485 communication method with strong anti-interference ability is usually adopted in the formation / grading device.

[0003] However, it is found in practice that the existing RS485 communication method is mainly as follows: the host polls each slave to query real-time data, events, alarms, etc. When a certain slave has event data that needs to be reported to the host, it must wait until the host polls this slave to upload, otherwise it cannot send. Once the polling order of the slave that needs to upload event data is relatively late, it is easy to cause the reduction of the upload efficiency of the event data of this slave, and will increase the waiting time required for this slave to upload event data, which is not intelligent enough. It can be seen that it is particularly important to propose a technical solution that can improve the upload efficiency of slave event data while avoiding disturbing the bus problem. Summary of the Invention

[0004] The present invention provides a method and system for uploading slave event data based on time slots, which can improve the upload efficiency of slave event data when the slave has event data that needs to be reported to the host, is beneficial to reducing the waiting time for the slave to upload event data, and is more intelligent.

[0005] To solve the above technical problems, a first aspect of the present invention discloses a method for uploading slave event data based on time slots. The method is used to implement data transmission of a formation / grading device through a communication system. The communication system includes a host and slaves. The method includes:

[0006] The slave receives a polling frame sent by the host to a target slave. The target slave is one of all slaves included in the communication system. The slave includes the target slave or other slaves included in the communication system;

[0007] The slave determines the reception time when receiving the polling frame, and determines that the host is in a data reception state according to the received polling frame;

[0008] The slave calculates an event upload time period of the slave according to the event upload time slot of the slave sent by the host and the reception time;

[0009] During the event upload time period, the slave determines whether there is event data in the current data of the slave that needs to be uploaded to the host;

[0010] When it is determined that there is event data that needs to be uploaded to the host, the slave uploads the event data to the host during the event upload time period.

[0011] As an optional implementation manner, in the first aspect of the present invention, the method further includes:

[0012] When receiving the polling frame sent by the host, the slave detects whether the host polling object corresponding to the polling frame is the slave itself according to the polling frame, and when it is detected that the host polling object is the slave itself, filters out the data matching the polling frame from the current data of the slave as the reply data of the slave for the polling frame;

[0013] The slave calculates the data reply time period of the slave according to the reception time and the reply time slot of the slave sent by the host;

[0014] The slave sends the reply data to the host within the data reply time period.

[0015] As an optional implementation manner, in the first aspect of the present invention, the communication system further includes a bus, and the host is communicatively connected to the slave through the bus;

[0016] Wherein, the host is configured to send the polling frame to the bus, trigger the slave to receive the polling frame through the bus, and trigger the slave to determine that the host is in a data reception state according to the received polling frame;

[0017] The data reception state is used to enable the host to receive the reply data sent by the target slave within the reply time slot of the target slave, and is also used to enable the host to receive the event data sent by the slave within the upload time slot of the slave.

[0018] As an optional implementation manner, in the first aspect of the present invention, the method further includes:

[0019] The host divides the polling interval of the polling frame according to the preset communication protocol of the communication system and the number of slaves in the communication system, and obtains a time slot division result of the polling interval, where the time slot division result includes the transmission time slot of the host, the reply time slot of the target slave, and the event upload time slot of the slave;

[0020] The host sends the polling frame and the time slot division result to the bus, and triggers the slave to receive the polling frame and the time slot corresponding to the slave through the bus.

[0021] As an optional implementation manner, in the first aspect of the present invention, the method further includes:

[0022] The host receives the reply data and determines whether the reply data is the data first sent by the target slave.

[0023] When it is determined that the reply data is the data first sent by the target slave, the host increments the number of slaves by 1, and re-executes the operation of dividing the polling interval of the polling frame according to the communication protocol of the preset communication system and the number of slaves in the communication system to obtain the time slot division result of the polling interval.

[0024] As an optional implementation manner, in the first aspect of the present invention, each time slot of the time slot division result corresponds to a time length, and the sum of the time lengths of all time slots of the time slot division result is less than or equal to the time length of the polling interval;

[0025] Wherein, the time length of the sending time slot is less than the time length of the reply time slot, and the time length of the reply time slot is less than the time lengths of all the event upload time slots.

[0026] As an optional implementation manner, in the first aspect of the present invention, the method further includes:

[0027] When receiving the data sent by any one of the slaves, the host detects the received data of the host.

[0028] When it is detected that there is at least one event data of the slave in the received data, the host executes an event processing process matching the event data, and re-executes the operation of detecting the received data of the host until the end time of the polling interval of the polling frame is reached.

[0029] The host determines, according to the preset polling order, the first slave whose polling order is after the target slave from all the slaves as the slave to be polled, and triggers the host to execute the operation of sending a polling frame for the slave to be polled to the slave to be polled.

[0030] The second aspect of the present invention discloses a system for realizing data transmission of a formation / grading device through a communication system. The communication system includes a host and slaves, and the slaves include:

[0031] A first receiving module, configured to receive a polling frame sent by the host to a target slave, where the target slave is one of all slaves included in the communication system, and the slaves include the target slave or other slaves included in the communication system;

[0032] A first determining module, configured to determine a receiving moment when the polling frame is received, and determine that the host is in a data receiving state according to the received polling frame;

[0033] A calculation module, configured to calculate an event upload time period of the slave according to an event upload time slot of the slave sent by the host received by the first receiving module and the receiving moment;

[0034] A first judging module, configured to judge whether there is event data that needs to be uploaded to the host in the current data of the slave within the event upload time period;

[0035] A first sending module, configured to upload the event data to the host within the event upload time period when the first judging module judges that there is event data that needs to be uploaded to the host.

[0036] As an optional implementation manner, in the second aspect of the present invention, the slave further includes:

[0037] A first detecting module, configured to detect whether a host polling object corresponding to the polling frame is the slave itself according to the polling frame when the first receiving module receives the polling frame sent by the host;

[0038] A screening module, configured to screen out data matching the polling frame from the current data of the slave as reply data of the slave for the polling frame when the first detecting module detects that the host polling object is the slave itself;

[0039] The calculation module is further configured to calculate a data reply time period of the slave according to the receiving moment and a reply time slot of the slave sent by the host received;

[0040] The first sending module is further configured to send the reply data to the host within the data reply time period.

[0041] As an optional implementation manner, in the second aspect of the present invention, the communication system further includes a bus, and the host is communicatively connected to the slave through the bus;

[0042] Wherein, the host is configured to send the polling frame to the bus, trigger the first receiving module to receive the polling frame through the bus, and trigger the first determining module to determine that the host is in a data receiving state according to the received polling frame;

[0043] The data receiving state is used to enable the host to receive the reply data sent by the target slave in the reply time slot of the target slave, and is also used to enable the host to receive the event data sent by the slave in the upload time slot of the slave.

[0044] As an optional implementation manner, in the second aspect of the present invention, the host includes:

[0045] A partitioning module, configured to partition the polling interval of the polling frame according to the communication protocol of the preset communication system and the number of slaves in the communication system, so as to obtain a time slot partitioning result of the polling interval, where the time slot partitioning result includes the transmission time slot of the host, the reply time slot of the target slave, and the event upload time slot of the slave;

[0046] A second sending module, configured to send the polling frame and the time slot partitioning result to the bus, and trigger the first receiving module to receive the polling frame and the time slot corresponding to the slave through the bus.

[0047] As an optional implementation manner, in the second aspect of the present invention, the host further includes:

[0048] A second receiving module, configured to receive the reply data;

[0049] A second judging module, configured to judge whether the reply data is the data sent by the target slave for the first time;

[0050] An updating module, configured to, when the second judging module judges that the reply data is the data sent by the target slave for the first time, increment the number of slaves by 1, and control the partitioning module to re-execute the operation of partitioning the polling interval of the polling frame according to the communication protocol of the preset communication system and the number of slaves in the communication system, so as to obtain the time slot partitioning result of the polling interval.

[0051] As an optional implementation manner, in the second aspect of the present invention, each time slot of the time slot partitioning result corresponds to a time length, and the sum of the time lengths of all time slots of the time slot partitioning result is less than or equal to the time length of the polling interval;

[0052] Wherein, the time length of the transmission time slot is less than the time length of the reply time slot, and the time length of the reply time slot is less than the time lengths of all the event upload time slots.

[0053] As an alternative implementation manner, in the second aspect of the present invention, the host further includes:

[0054] A second detection module, configured to detect the received data of the host when the second receiving module receives the data sent by any one of the slaves;

[0055] An execution module, configured to, when the second detection module detects that there is at least one event data of the slave in the received data, execute an event processing flow matching the event data, and control the second detection module to re-execute the operation of detecting the received data of the host until the end time of the polling interval of the polling frame is reached;

[0056] A second determination module, configured to determine, according to a preset polling order, the first slave whose polling order is after the target slave from all the slaves as the slave to be polled, and trigger the second sending module to execute an operation of sending a polling frame for the slave to be polled to the slave to be polled.

[0057] The third aspect of the present invention discloses another upload system for slave event data based on time slots, and the system includes:

[0058] A memory storing executable program code;

[0059] A processor coupled to the memory;

[0060] The processor calls the executable program code stored in the memory and executes the upload method for slave event data based on time slots disclosed in the first aspect of the present invention.

[0061] The fourth aspect of the present invention discloses a computer storage medium, and the computer storage medium stores computer instructions, which are used to execute the upload method for slave event data based on time slots disclosed in the first aspect of the present invention when being called.

[0062] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0063] In an embodiment of the present invention, a communication system includes a host and a slave. The slave receives a polling frame sent by the host to a target slave. The target slave is one of the slaves in the communication system. The slave includes the target slave or other slaves included in the communication system. The slave determines the reception time when the polling frame is received, and determines that the host is in a data reception state according to the received polling frame. The slave calculates the upload time slot of the slave according to the upload time slot of the slave sent by the host received and the reception time. The slave determines whether there is event data that needs to be uploaded to the host in the current data of the slave within the upload time slot. When it is determined that there is event data that needs to be uploaded to the host, the slave uploads the event data to the host. It can be seen that implementing the present invention can enable any slave with event data to be reported to directly upload the event data to the host regardless of whether the host polls the slave currently, which can improve the upload efficiency of the slave event data, is conducive to reducing the waiting time for the slave to upload event data, and is more intelligent. Description of the Drawings

[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0065] Figure 1 It is a flowchart of a method for uploading slave event data based on time slots disclosed in an embodiment of the present invention;

[0066] Figure 2 It is a flowchart of a slave communication processing process disclosed in an embodiment of the present invention;

[0067] Figure 3 It is a flowchart of a method for uploading slave event data based on time slots disclosed in an embodiment of the present invention;

[0068] Figure 4 It is a flowchart of a process for a host to read data of one slave and upload data of all slave events disclosed in an embodiment of the present invention;

[0069] Figure 5 It is a host communication processing process disclosed in an embodiment of the present invention;

[0070] Figure 6 It is a schematic structural diagram of a system for uploading slave event data based on time slots disclosed in an embodiment of the present invention;

[0071] Figure 7 It is a schematic structural diagram of another system for uploading slave event data based on time slots disclosed in an embodiment of the present invention;

[0072] Figure 8 It is a schematic structural diagram of another slave event data uploading system based on time slots disclosed in an embodiment of the present invention. Detailed implementation manners

[0073] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0074] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or terminal including a series of steps or units is not limited to the listed steps or units, but optionally further includes unlisted steps or units, or optionally further includes other steps or units inherent to these processes, methods, products or terminals.

[0075] Referring to "embodiment" herein means that a specific feature, structure or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein may be combined with other embodiments.

[0076] The present invention discloses a method and system for uploading slave event data based on time slots, which can directly upload event data from any slave to the host when the slave has event data to report, regardless of whether the host polls the slave currently, can improve the uploading efficiency of slave event data, is beneficial to reducing the waiting time for the slave to upload event data, and is more intelligent. The following will be described in detail respectively.

[0077] Embodiment 1

[0078] Please refer to Figure 1 , Figure 1 It is a schematic flowchart of a method for uploading slave event data based on time slots disclosed in an embodiment of the present invention. Among them, Figure 1The described method for uploading slave event data based on time slots can be applied to a system for uploading slave event data based on time slots, and this system for uploading slave event data based on time slots is used to implement data transmission of formation / formation and discharging equipment through a communication system. The communication system includes a host and a slave, and the embodiments of the present invention do not make limitations. As Figure 1 shown, the method for uploading slave event data based on time slots may include the following operations:

[0079] 101. The slave receives a polling frame sent by the host to the target slave for the target slave.

[0080] In the embodiments of the present invention, the target slave is one of all the slaves included in the communication system. Optionally, the slave includes the target slave or other slaves included in the communication system.

[0081] In the embodiments of the present invention, optionally, the slave receiving the polling frame sent by the host to the target slave for the target slave means that each slave receives the polling frame sent by the host to the target slave for the target slave. For example, assume that the communication system includes slave No. 1, slave No. 2,..., slave No. n (arranged in the polling order of the host). When the host sends a corresponding polling frame to slave No. m (1 < m < n), slaves No. 1 - n can all receive the polling frame sent by the host to slave No. m for slave No. m.

[0082] In the embodiments of the present invention, optionally, the polling frame sent by the host to the target slave for the target slave is used to enable the host to read relevant data of the read command corresponding to the polling frame in the target slave.

[0083] 102. The slave determines the reception time of the received polling frame, and determines that the host is in the data reception state according to the received polling frame.

[0084] In the embodiments of the present invention, the slave determines the reception time of the received polling frame specifically as follows: The slave records the reception time of the received polling frame. For example, the time point when this polling frame is received is recorded as t1. Specifically, the host enters the data reception state after sending the polling frame, and the slave can determine that the host is in this data reception state when receiving the polling frame.

[0085] In an embodiment of the present invention, specifically, the communication system further includes a bus (such as: RS485 bus), and the host is communicatively connected to the slave through the bus. Among them, the communication mode between the host and the slave can be the communication mode of the RS485 bus. Among them, the host is used to send a polling frame to the bus, trigger the slave to receive the polling frame through the bus, and trigger the slave to determine that the host is in a data receiving state according to the received polling frame. The data receiving state is used to enable the host to receive the reply data sent by the target slave within the reply time slot of the target slave, and is also used to enable the host to receive the event data sent by the slave within the upload time slot of the slave.

[0086] 103. The slave calculates the event upload time period of the slave according to the received event upload time slot of the slave sent by the host and the reception time.

[0087] In an embodiment of the present invention, optionally, when each slave of the communication system goes online (communicatively connected to the host), the host can set the transmission time slot set by the slave. The transmission time slot can include a reply time slot, and can also include the start and end times of the event upload time slot. The reply time slot can be denoted as t2, the start time of the event upload time slot can be denoted as t3, and the end time of the event upload time slot can be denoted as t4. Among them, the start time of the event upload time slot is later than the end time of the reply time slot. The slave can upload any data (including event data) within this event upload time slot. Among them, all the event upload time slots set by the host correspond to an event upload order, and this event upload order can be the same as the polling order of the host. For example: the end time of the event upload time slot of slave No. 1 is the start time of the event upload time slot of slave No. 2, and the end time of the event upload time slot of slave No. 2 is the start time of the event upload time slot of slave No. 3. This event upload order can also be different from the polling order of the host, and the embodiment of the present invention does not make a limitation.

[0088] In an embodiment of the present invention, each slave calculates the start and end times of its corresponding time slot with the reception time of receiving a complete and valid frame sent by the host (including the polling frame sent by the host to any slave) as the starting point. Specifically, the slave calculates the sum of the start time and the reception time as the upload start time of the slave according to the received start time of the event upload time slot of the slave sent by the host and the reception time; and calculates the sum of the end time and the reception time as the upload end time of the slave according to the end time of this event upload time slot and the reception time; and constructs the event upload time period of the slave according to the upload start time and the upload end time. Among them, the event upload time period can be denoted as {(t1 + t3)~(t1 + t4)}.

[0089] 104. The slave determines whether there is event data that needs to be uploaded to the host in the current data of the slave within the event upload time period.

[0090] In an embodiment of the present invention, optionally, the event data of each slave device may include alarm data, fault data, and data of other events, which are not limited in the embodiments of the present invention.

[0091] 105. When it is determined that there is event data that needs to be uploaded to the master device, the slave device uploads the event data to the master device within the event upload time period.

[0092] In an embodiment of the present invention, when it is determined that there is no event data that needs to be uploaded to the master device in the current data of the slave device, a slave device event detection result of the polling frame for the target slave device can be generated, and the slave device event detection result is used to indicate that no preset slave device events (such as alarm, fault, etc. events) have occurred before the time period of the polling frame for the target slave device for this slave device, or this process can be ended.

[0093] Exemplarily, assume that a communication system includes one master device and 32 slave devices. It takes 300 ms for the master device to read one slave device, and it takes 30 ms for a slave device to send an event data (such as alarm data) to the master device. If the traditional solution is adopted (when a slave device has data to report to the master device, it must wait until the master device polls this slave device to upload), in an extreme case (when the slave device that needs to upload event data is the 32nd slave device polled by the master device), it takes 300 * 32 = 9600 ms for the event data to be sent to the master device, while in this solution, in the extreme case, the event data only needs 300 + 30 * 32 = 1260 ms to be sent to the master device.

[0094] It can be seen that the implementation Figure 1The described slot-based slave event data uploading system can receive, by the slave, a polling frame sent by the master to the target slave, where the slave can be the target slave or other slaves, determine the reception moment of receiving the polling frame, and determine that the master is in the data reception state according to the received polling frame. Then, according to the event uploading time slot of the slave and the reception moment, calculate the event uploading time period of the slave. Subsequently, within the event uploading time period, determine whether there is event data in the current data of the slave that needs to be uploaded to the master. When it is determined that there is event data that needs to be uploaded to the master, upload the event data to the master within the event uploading time period. It can accurately determine the event uploading time period of the slave corresponding to the current polling frame according to the event uploading time slot of the slave and the determined reception moment of the polling frame, and can, when any slave (this slave can be the target slave currently polled by the master or other slaves) has event data to report, regardless of whether the master currently polls this slave, implement the direct uploading of the event data of this slave to the master within its event uploading time period. Compared with the traditional scheme where the slave has to wait until the master polls it when there is data to report to the master, this application can quickly and efficiently upload the event data of any slave to the master, improve the uploading efficiency of the slave event data, help reduce the waiting time for the slave to upload event data, and has a higher degree of intelligence.

[0095] In an alternative embodiment, the method may further include:

[0096] When receiving a polling frame sent by the master, the slave, according to the polling frame, detects whether the master polling object corresponding to the polling frame is the slave itself, and when it is detected that the master polling object is the slave itself, filters out the data matching the polling frame from the current data of the slave as the reply data of the slave for the polling frame;

[0097] The slave calculates the data reply time period of the slave according to the reception moment and the reply time slot of the slave sent by the master received;

[0098] The slave sends the reply data to the master within the data reply time period.

[0099] In the embodiment of the present invention, optionally, each slave corresponds to a forming / grading and capacitance-measuring device, or each slave corresponds to a power module in the forming / grading and capacitance-measuring device, where the forming / grading and capacitance-measuring device may include multiple power modules. When each slave corresponds to a power module, the reply data of each slave may include the module data of the power module corresponding to the slave, where the module data of the power module may include one or a combination of multiple power-related data such as the voltage data of the power module, the current data of the power module, and the capacitance data of the power module. The embodiment of the present invention does not make a limitation.

[0100] Specifically, when each slave receives a polling frame sent by the master, it can, based on the polling frame, detect whether the target slave indicated by the master polling object corresponding to the polling frame is the slave itself. If so, it is necessary to determine the data that the slave needs to reply and the time period during which the slave can reply with data. Subsequently, the slave replies to the master with data within the data reply time period, where the data reply time period can be denoted as {t1 to (t1 + t2)}. Optionally, when it is detected that the master polling object is not the slave itself, the slave does not reply to the master with data. For example, when the master accesses the m-th slave, when the 1st slave detects the master polling object, the detection result is that the master polling object is not the 1st slave itself; when the m-th slave detects the master polling object, the detection result is that the master polling object is the m-th slave itself.

[0101] In this optional embodiment, as Figure 2 shown, Figure 2 is a schematic flowchart of a slave communication processing procedure disclosed in an embodiment of the present invention. First, the slave waits to receive data; subsequently, the slave receives a complete polling frame and records the time point t1; the slave waits for t3 time and then determines whether there is event data to be sent; when the determination result is no, the slave resumes the operation of waiting to receive data; when the determination result is yes, the slave sends the event data to the master and resumes the operation of waiting to receive data.

[0102] It can be seen that in this optional embodiment, when the slave receives a polling frame sent by the master, it can, based on the polling frame, detect whether the master polling object corresponding to the polling frame is the slave itself. When it is detected that the master polling object is the slave itself, the data matching the polling frame is filtered out from the current data of the slave as the reply data of the slave for the polling frame. Based on the reception time and the reply time slot of the slave sent by the master received, the data reply time period of the slave is calculated. Furthermore, within the data reply time period, the reply data is sent to the master. When the slave receives a polling frame sent by the master, it can accurately detect the master polling object based on the polling frame, and when the master polling object is the slave itself, the reply data is accurately sent to the master through the determined reply data and data reply time period. Compared with the traditional solution where a slave performs a data reply operation only when the master polls a certain slave, the present application can achieve that regardless of whether the sending object of the master polling frame is incorrect, the accurate slave replies with accurate data, which is beneficial to improving the reply accuracy and reliability of the slave's reply data and reducing the occurrence of situations where the reply data is sent incorrectly due to the incorrect sending position of the master polling frame.

[0103] Embodiment 2

[0104] Please refer to Figure 3 , Figure 3It is a schematic flowchart of a method for uploading slave event data based on time slots disclosed in an embodiment of the present invention. Among them, Figure 3 The described method for uploading slave event data based on time slots can be applied to a system for uploading slave event data based on time slots, and the system for uploading slave event data based on time slots is used to implement data transmission of formation / formation and discharging equipment through a communication system. The communication system includes a host and a slave, and the embodiments of the present invention do not make any limitations. As Figure 3 shown, the method for uploading slave event data based on time slots may include the following operations:

[0105] 201. The host divides the polling interval of the polling frame according to a preset communication protocol of the communication system and the number of slaves in the communication system, and obtains a time slot division result of the polling interval.

[0106] In an embodiment of the present invention, the communication protocol of the communication system is used to determine the transmission time slot of the host, the reply time slot of each slave, and the event upload time slot of each slave. The time slot division result includes the transmission time slot of the host, the reply time slot of the target slave, and the event upload time slot of the slave. Among them, each time slot in the time slot division result corresponds to a time length, and the sum of the time lengths of all time slots in the time slot division result is less than or equal to the time length of the polling interval. The time length of the transmission time slot is less than the time length of the reply time slot, and the time length of the reply time slot is less than the time length of all event upload time slots.

[0107] Optionally, the event upload time slot of the above-mentioned slave may be the event upload time slots of all slaves, or the event upload time slots of some slaves set by the host. For example, the host may set that a certain part of the slaves need to be focused on whether there are events (such as alarms) occurring. At this time, only the event upload time slots of this part of the slaves can be set, so that this part of the slaves can upload event data to the host during the polling of any slave, and the remaining slaves cannot upload event data to the host when polling other slaves other than themselves. Exemplarily, as Figure 4 shown, Figure 4 is a schematic flowchart of a host reading data of one slave and event upload data of all slaves disclosed in an embodiment of the present invention. Figure 4 Taking one host and n slaves as an example, within the transmission time slot, the host sends a polling frame to access the mth (2 < m < n) slave to read the data of the mth slave; subsequently, within the reply time slot, the mth slave sends reply data to the host; then, within the event upload time slot of each slave, if the slave has event data to report, it uploads the event data to the host. Specifically: First, within the event upload time slot of the 1st slave, the 1st slave can upload the event data of the 1st slave to the host; subsequently, within the event upload time slot of the 2nd slave, the 2nd slave can upload the event data of the 2nd slave to the host, and so on.

[0108] 202. The host sends the polling frame and the time slot division result to the bus in a timely manner, and triggers the slave to receive the polling frame and the corresponding time slot through the bus.

[0109] In an embodiment of the present invention, optionally, the polling frame and the time slot division result can be sent synchronously, or the time slot division result can be sent first and then the polling frame. Taking the case of sending the time slot division result first and then the polling frame as an example, the host sends the time slot division result to the bus, and triggers the slave to receive the corresponding time slot of the slave through the bus, such as the reply time slot of the slave and the event reply time slot of the slave. At this time, the slave waits for the host to send a polling frame for the slave / other slaves; subsequently, the host sends the polling frame to the bus and triggers the slave to receive the polling frame through the bus.

[0110] For example, the host sends a polling frame for accessing the m-th slave to the RS485 bus and then enters the data receiving state. According to the characteristics of the RS485 bus, all slave devices can receive this polling frame and record the time point when this polling frame is received.

[0111] 203. The slave receives the polling frame sent by the host for the target slave.

[0112] 204. The slave determines the receiving moment when the polling frame is received, and determines that the host is in the data receiving state according to the received polling frame.

[0113] 205. The slave calculates the event upload time period of the slave according to the event upload time slot of the slave sent by the host received and the receiving moment.

[0114] 206. During the event upload time period, the slave judges whether there is event data in the current data of the slave that needs to be uploaded to the host.

[0115] 207. When it is judged that there is event data that needs to be uploaded to the host, the slave uploads the event data to the host during the event upload time period.

[0116] In an embodiment of the present invention, for other descriptions of steps 203 - 207, please refer to the detailed descriptions of steps 101 - 105 in Embodiment 1, which will not be elaborated in this embodiment of the present invention.

[0117] It can be seen that the implementation Figure 3The described method for uploading slave event data based on time slots enables the slave to receive a polling frame sent by the master to the target slave, where the slave can be the target slave or other slaves, determine the receiving moment of the received polling frame, and based on the received polling frame, determine that the master is in the data receiving state. According to the event upload time slot of the slave and the receiving moment, calculate the event upload time period of the slave. Subsequently, within the event upload time period, determine whether there is event data in the current data of the slave that needs to be uploaded to the master. When it is determined that there is event data that needs to be uploaded to the master, upload the event data to the master within the event upload time period. It can accurately determine the event upload time period of the slave corresponding to the current polling frame based on the event upload time slot of the slave and the determined receiving moment of the polling frame, and can, when any slave (this slave can be the target slave currently polled by the master or other slaves) has event data to report, regardless of whether the master currently polls this slave, enable this slave to directly upload event data to the master within its event upload time period. Compared with the traditional solution where the slave has to wait until the master polls it when there is data to report to the master, this application can quickly and efficiently upload the event data of any slave to the master, improve the upload efficiency of slave event data, help reduce the waiting time for the slave to upload event data, and has a higher degree of intelligence. In addition, it can also divide the polling interval of the polling frame through the communication protocol of the communication system and the number of slaves to obtain the time slot division result of the polling interval, such as the master sending time slot, the slave reply time slot, and the slave event upload time slot, and send the polling frame and the time slot division result to the bus, thereby triggering the slave to receive the polling frame and the corresponding time slot through the bus, and can accurately divide the polling interval of the polling frame based on the communication protocol of the communication system and the number of slaves to obtain the time slot division result, which is conducive to improving the accuracy of the time slot division of the polling interval, and thus conducive to improving the accuracy and efficiency of the subsequent slave to reply / upload event data within the time period corresponding to the accurately divided time slot.

[0118] In an alternative embodiment, the method further includes:

[0119] The master receives the reply data and determines whether the reply data is the data first sent by the target slave;

[0120] When it is determined that the reply data is the data first sent by the target slave, the master increments the number of slaves by 1 and re - executes the operation of dividing the polling interval of the polling frame according to the preset communication protocol of the communication system and the number of slaves in the communication system to obtain the time slot division result of the polling interval in step 201.

[0121] In an embodiment of the present invention, specifically, the host determines the slave identifier of the target slave according to the reply data sent by the target slave received, and determines whether there is historical reply data matching the slave identifier in the pre-stored slave database according to the slave identifier of the target slave; when it is determined that there is no historical reply data matching the slave identifier, it is determined that the reply data is the data sent by the target slave for the non-first time; when it is determined that there is historical reply data matching the slave identifier, it is determined that the reply data is the data sent by the target slave for the first time. When it is determined that the target slave sends reply data to the host for the first time, it indicates that the target slave is a newly added slave, and at this time the host increments the number of slaves by 1.

[0122] It can be seen that in this optional embodiment, the host can receive the reply data and determine whether the reply data is the data sent by the target slave for the first time. When it is determined that the reply data is the data sent by the target slave for the first time, the host increments the number of slaves by 1, and re-executes the above operation of dividing the polling interval of the polling frame according to the communication protocol of the preset communication system and the number of slaves in the communication system to obtain the time slot division result of the polling interval. The host can update the number of slaves in the communication system only when it is determined that the target slave sends reply data for the first time, and can improve the determination accuracy and reliability of the number of slaves in the communication system through the slave reply data, thereby facilitating the improvement of the polling interval division accuracy and reliability of the polling frame based on the number of slaves.

[0123] In this optional embodiment, as an optional implementation manner, the method may further include:

[0124] When receiving data sent by any slave, the host detects the received data of the host;

[0125] When it is detected that there is event data of at least one slave in the received data, the host executes the event processing process matching the event data, and re-executes the operation of detecting the received data of the host until the end time of the polling interval of the polling frame is reached;

[0126] The host determines the first slave after the target slave in the polling order from all slaves as the slave to be polled, and triggers the host to execute the operation of sending a polling frame for the slave to be polled to the slave to be polled.

[0127] In an embodiment of the present invention, optionally, the received data of the host includes at least the reply data of the target slave, and may also include the event data of any slave. Optionally, when the event data is alarm data, the host executes a disposal prompt operation matching the alarm data (such as: a charging prompt operation for out-of-power, a power-off prompt operation for overcharging, etc.); when the event data is fault data, the host executes a maintenance prompt operation matching the fault data, which is not limited in the embodiment of the present invention.

[0128] In an embodiment of the present invention, specifically, after the host sends a polling frame for a target slave, it waits for the polling interval of the polling frame, and sends a corresponding polling frame to the next slave after the end moment of the polling interval.

[0129] It can be seen that this optional implementation can detect the received data of the host when the host receives data sent by any slave. When it is detected that there is event data of at least one slave in the received data, an event processing process matching the event data is executed, and the operation of detecting the received data of the host is re-executed until the end moment of the polling interval of the polling frame. Then, according to the preset polling order, the first slave whose polling order is after the target slave is determined from all slaves as the slave to be polled, and the host is triggered to execute the operation of sending a polling frame for the slave to be polled to the slave to be polled. It can accurately detect slave event data through the received data of the host, directly execute the event processing process matching the event data when the slave event data is detected, improve the timeliness and accuracy of event data processing, and send a polling frame to the next slave after the polling interval. By strictly executing the corresponding data sending and receiving operations according to the time slot communication process set by the host, the upload efficiency, timeliness and accuracy of slave event data can be improved, and the flexible upload of slave event data can be realized by setting the time slot communication process, with higher intelligence.

[0130] In this optional embodiment, as Figure 5 shown, Figure 5 is a host communication processing process disclosed in an embodiment of the present invention. First, the host sends a polling frame to the target slave, and at this time the host is in the data receiving state; then the host receives data (this data includes reply data, and optionally, can also include event data), and determines whether the received data contains event data; when it is determined that there is no event data, the host determines whether the target slave replies data for the first time; when it is determined that the target slave does not reply data for the first time, the target slave is updated to the next slave, and the operation of the host sending a polling frame to the target slave is re-executed; when it is determined that the target slave replies data for the first time, the host sets the start and end times of the event upload time slot of this slave, and triggers the execution of the above operation of updating the target slave to the next slave, and re-executes the operation of the host sending a polling frame to the target slave; when it is determined that there is event data, the host executes an event processing process matching the event data, and triggers the execution of the above operation of the host determining whether the target slave replies data for the first time.

[0131] Embodiment III

[0132] Please refer to Figure 6 , Figure 6It is a schematic structural diagram of a slave event data uploading system based on time slots disclosed in an embodiment of the present invention. Figure 6 The described slave event data uploading system based on time slots takes a slave (such as Figure 6 the slave 302 shown) as an example. Further optionally, when the system takes three slaves as an example, the above-mentioned slave 302 can be denoted as the first slave 302, and the remaining slaves can be denoted as the second slave 303 and the third slave 304. Among them, Figure 6 the described slave event data uploading system based on time slots is used to implement data transmission of formation / formation and discharging equipment through a communication system. The communication system includes a host 301 and a slave 302, which are not limited in the embodiments of the present invention. As Figure 6 shown, the slave 302 can include:

[0133] A first receiving module 3021, configured to receive a polling frame sent by the host 301 to the target slave, where the target slave is one of all slaves included in the communication system, and the slave 302 includes the target slave or other slaves included in the communication system.

[0134] A first determining module 3022, configured to determine the receiving moment when the polling frame is received, and determine that the host 301 is in a data receiving state according to the received polling frame.

[0135] In the embodiments of the present invention, the communication system further includes a bus, and the host 301 is communicatively connected to the slave 302 through the bus. Among them, the host 301 is configured to send the polling frame to the bus, trigger the first receiving module 3021 to receive the polling frame through the bus, and trigger the first determining module 3022 to determine that the host 301 is in a data receiving state according to the received polling frame. The data receiving state is used to enable the host 301 to receive the reply data sent by the target slave within the reply time slot of the target slave, and is also used to enable the host 301 to receive the event data sent by the slave 302 within the uploading time slot of the slave 302.

[0136] A calculation module 3023, configured to calculate the event uploading time period of the slave 302 according to the event uploading time slot of the slave 302 sent by the host 301 received by the first receiving module 3021 and the receiving moment.

[0137] A first judgment module 3024, configured to judge whether there is event data that needs to be uploaded to the host 301 in the current data of the slave 302 during the event uploading time period.

[0138] A first sending module 3025, configured to upload the event data to the host 301 during the event uploading time period when the first judgment module 3024 judges that there is event data that needs to be uploaded to the host 301.

[0139] It can be seen that implementing Figure 6 the described slot-based slave event data uploading system enables the slave to receive a polling frame sent by the host to the target slave for the target slave. The slave can be the target slave or other slaves, determine the reception time of the received polling frame, and based on the received polling frame, determine that the host is in the data reception state. According to the slave's event upload time slot and the reception time, calculate the slave's event upload time period. Subsequently, within the event upload time period, determine whether there is event data in the slave's current data that needs to be uploaded to the host. When it is determined that there is event data that needs to be uploaded to the host, upload the event data to the host within the event upload time period. It can accurately determine the event upload time period of the slave corresponding to the current polling frame based on the slave's event upload time slot and the determined polling frame reception time, and can, when any slave (this slave can be the target slave currently polled by the host or other slaves) has event data to report, regardless of whether the host currently polls this slave, enable this slave to directly upload the event data to the host within its event upload time period. Compared with the traditional solution where the slave has to wait until the host polls this slave when there is data to report to the host, this application can quickly and efficiently upload the event data of any slave to the host, improve the upload efficiency of the slave event data, help reduce the waiting time for the slave to upload event data, and has a higher degree of intelligence.

[0140] In an optional embodiment, as Figure 7 shown, Figure 7 FIG. is a schematic structural diagram of another slot-based slave event data uploading system disclosed in an embodiment of the present invention. Figure 7 The described slot-based slave event data uploading system takes one slave (such as Figure 7 the slave 302 shown) as an example. Among them, the slave 302 further includes:

[0141] A first detection module 3026, configured to, when the first reception module 3021 receives a polling frame sent by the host 301, detect whether the polling object of the host 301 corresponding to the polling frame is the slave 302 itself according to the polling frame.

[0142] A screening module 3027, configured to, when the first detection module 3026 detects that the polling object of the host 301 is the slave 302 itself, screen out the data that matches the polling frame from the current data of the slave 302 as the reply data of the slave 302 for the polling frame.

[0143] A calculation module 3023 is further configured to calculate the data reply time period of the slave 302 according to the reception time and the reply time slot of the slave 302 sent by the host 301 received.

[0144] The first sending module 3025 is further configured to send the reply data to the host 301 within the data reply time period.

[0145] It can be seen that in this alternative embodiment, when the slave receives the polling frame sent by the host, according to the polling frame, it can detect whether the host polling object corresponding to the polling frame is the slave itself. When it is detected that the host polling object is the slave itself, the data matching the polling frame is filtered out from the current data of the slave as the reply data of the slave for the polling frame. According to the receiving time and the reply time slot of the slave sent by the host, the data reply time period of the slave is calculated. Furthermore, within the data reply time period, the reply data is sent to the host. When the slave receives the polling frame sent by the host, it can accurately detect the host polling object according to the polling frame. When the host polling object is the slave itself, the reply data is accurately sent to the host through the determined reply data and data reply time period. Compared with the traditional solution where the host polls a certain slave and then the slave performs the data reply operation, in this application, accurate data can be replied by the accurate slave regardless of whether the sending object of the host polling frame is incorrect, which is beneficial to improving the reply accuracy and reliability of the slave's reply data and reducing the occurrence of incorrect reply data due to incorrect sending positions of the host polling frame.

[0146] In another alternative embodiment, as Figure 7 shown, the host 301 includes:

[0147] A division module 3011, configured to divide the polling interval of the polling frame according to the communication protocol of the preset communication system and the number of slaves 302 in the communication system, to obtain a time slot division result of the polling interval. The time slot division result includes the sending time slot of the host 301, the reply time slot of the target slave, and the event upload time slot of the slave 302.

[0148] In the embodiment of the present invention, each time slot of the time slot division result corresponds to a time length, and the sum of the time lengths of all time slots of the time slot division result is less than or equal to the time length of the polling interval. Among them, the time length of the sending time slot is less than the time length of the reply time slot, and the time length of the reply time slot is less than the time length of all event upload time slots.

[0149] A second sending module 3012, configured to send the polling frame and the time slot division result to the bus, and trigger the first receiving module 3021 to receive the polling frame and the time slot corresponding to the slave 302 through the bus.

[0150] It can be seen that the optional embodiment can divide the polling interval of the polling frame according to the communication protocol of the communication system and the number of slave devices, obtaining the time slot division result of the polling interval, such as the host sending time slot, the slave device reply time slot, and the slave device event upload time slot, and sending the polling frame and the time slot division result to the bus, thereby triggering the slave device to receive the polling frame and the corresponding time slot through the bus. It can accurately divide the polling interval of the polling frame based on the communication protocol of the communication system and the number of slave devices to obtain the time slot division result, which is beneficial to improving the accuracy of the time slot division of the polling interval, and thus beneficial to improving the accuracy and efficiency of the subsequent slave device to reply data / upload event data within the time period corresponding to the accurately divided time slot.

[0151] In this optional embodiment, as an optional implementation manner, as Figure 7 shown, the host 301 may further include:

[0152] A second receiving module 3013, configured to receive reply data.

[0153] A second judging module 3014, configured to judge whether the reply data is the data first sent by the target slave device.

[0154] An updating module 3015, configured to, when the second judging module 3014 judges that the reply data is the data first sent by the target slave device, increment the number of slave devices 302 by 1, and control the dividing module 3011 to re-execute the above operation of dividing the polling interval of the polling frame according to the preset communication protocol of the communication system and the number of slave devices 302 in the communication system, obtaining the time slot division result of the polling interval.

[0155] It can be seen that this optional implementation manner can receive reply data through the host and judge whether the reply data is the data first sent by the target slave device. When it is judged that the reply data is the data first sent by the target slave device, the host increments the number of slave devices by 1 and re-executes the above operation of dividing the polling interval of the polling frame according to the preset communication protocol of the communication system and the number of slave devices in the communication system, obtaining the time slot division result of the polling interval. It can update the number of slave devices in the communication system only when the host judges that the target slave device first sends reply data, and can improve the determination accuracy and reliability of the number of slave devices in the communication system through the slave device reply data, thereby being beneficial to improving the division accuracy and reliability of the polling interval of the polling frame based on the number of slave devices.

[0156] In this optional implementation manner, optionally, as Figure 7 shown, the host 301 may further include:

[0157] A second detecting module 3016, configured to detect the received data of the host 301 when the second receiving module 3013 receives the data sent by any slave device 302;

[0158] An execution module 3017, configured to, when the second detection module 3016 detects that there is at least one event data of a slave 302 in the received data, execute an event processing procedure matching the event data, and control the second detection module 3016 to re-execute the operation of detecting the received data of the master 301 until the end time of the polling interval of the polling frame is reached;

[0159] A second determination module 3018, configured to determine, according to a preset polling order, the first slave 302 whose polling order is after the target slave from all the slaves 302 as the slave 302 to be polled, and trigger the second sending module 3012 to execute an operation of sending a polling frame for the slave 302 to be polled to the slave 302 to be polled.

[0160] It can be seen that this optional embodiment can also detect the received data of the master when the master receives the data sent by any slave. When it is detected that there is at least one event data of a slave in the received data, an event processing procedure matching the event data is executed, and the operation of detecting the received data of the master is re-executed until the end time of the polling interval of the polling frame is reached. Furthermore, according to the preset polling order, the first slave whose polling order is after the target slave is determined from all the slaves as the slave to be polled, and the master is triggered to execute an operation of sending a polling frame for the slave to be polled to the slave to be polled, which can accurately detect the slave event data through the received data of the master, directly execute the event processing procedure matching the event data when the slave event data is detected, improve the timeliness and accuracy of processing the event data, send a polling frame to the next slave after the polling interval, and improve the upload efficiency, timeliness and accuracy of the slave event data by strictly executing the corresponding data sending and receiving operations according to the time slot communication process set by the master, and can flexibly upload the slave event data by setting the time slot communication process, with a higher degree of intelligence.

[0161] Embodiment 4

[0162] Please refer to Figure 8 , Figure 8 which is a schematic structural diagram of another upload system for slave event data based on time slots disclosed in the embodiments of the present invention. As Figure 8 shown, the upload system for slave event data based on time slots may include:

[0163] A memory 401 storing executable program code;

[0164] A processor 402 coupled to the memory 401;

[0165] The processor 402 calls the executable program code stored in the memory 401 and executes the steps in the method for uploading slave event data based on time slots described in Embodiment 1 or Embodiment 2 of the present invention.

[0166] Embodiment 5

[0167] An embodiment of the present invention discloses a computer storage medium storing computer instructions which, when called, are used to execute the steps in the method for uploading slave event data based on time slots described in Embodiment 1 or Embodiment 2 of the present invention.

[0168] Embodiment 6

[0169] An embodiment of the present invention discloses a computer program product which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the steps in the method for uploading slave event data based on time slots described in Embodiment 1 or Embodiment 2.

[0170] The system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative work.

[0171] Through the specific descriptions of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, and the storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc memories, magnetic disk memories, tape memories, or any other medium that can be used to carry or store data and is computer-readable.

[0172] Finally, it should be noted that: The upload method and system for slave event data based on time slots disclosed in the embodiments of the present invention only disclose the preferred embodiments of the present invention, and are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for uploading slave event data based on time slots, characterized in that, The method is used to implement data transmission of formation / grading equipment through a communication system, the communication system includes a host and slave devices, and the method includes: The slave device receives a polling frame sent by the host to a target slave device, where the target slave device is one of all slave devices included in the communication system, and the slave device includes the target slave device or other slave devices included in the communication system; The slave device determines the reception time when the polling frame is received, and determines that the host is in a data reception state according to the received polling frame; The slave device calculates the event upload time period of the slave device according to the event upload time slot of the slave device sent by the host and the reception time; The slave device determines whether there is event data that needs to be uploaded to the host in the current data of the slave device during the event upload time period; When it is determined that there is event data that needs to be uploaded to the host, the slave device uploads the event data to the host during the event upload time period.

2. The method for uploading slave event data based on time slots according to claim 1, wherein The method further includes: When receiving the polling frame sent by the host, the slave device detects whether the host polling object corresponding to the polling frame is the slave device itself according to the polling frame, and when it is detected that the host polling object is the slave device itself, filters out the data matching the polling frame from the current data of the slave device as the reply data of the slave device for the polling frame; The slave device calculates the data reply time period of the slave device according to the reception time and the reply time slot of the slave device sent by the host; The slave device sends the reply data to the host during the data reply time period.

3. The method for uploading slave event data based on time slots according to claim 1 or 2, characterized in that The communication system further includes a bus, and the host is communicatively connected to the slave device through the bus; Wherein, the host is used to send the polling frame to the bus, trigger the slave device to receive the polling frame through the bus, and trigger the slave device to determine that the host is in a data reception state according to the received polling frame; The data reception state is used to enable the host to receive the reply data sent by the target slave device within the reply time slot of the target slave device, and is also used to enable the host to receive the event data sent by the slave device within the upload time slot of the slave device.

4. The method for uploading slave event data based on time slots according to claim 3, wherein The method further includes: The host divides the polling interval of the polling frame according to a preset communication protocol of the communication system and the number of slave devices in the communication system to obtain a time slot division result of the polling interval, and the time slot division result includes the transmission time slot of the host, the reply time slot of the target slave device, and the event upload time slot of the slave device; The host sends the polling frame and the time slot division result to the bus, and triggers the slave device to receive the polling frame and the corresponding time slot through the bus.

5. The method for uploading slave event data based on time slots according to claim 4, wherein The method further includes: The host receives the reply data and determines whether the reply data is the data sent by the target slave device for the first time; When it is determined that the reply data is the data sent by the target slave for the first time, the master increments the number of slaves by 1, and re-executes the operation of dividing the polling interval of the polling frame according to the communication protocol of the preset communication system and the number of slaves in the communication system to obtain the time slot division result of the polling interval.

6. The method for uploading slave event data based on time slots according to claim 4 or 5, characterized in that Each time slot of the time slot division result corresponds to a time length, and the sum of the time lengths of all time slots of the time slot division result is less than or equal to the time length of the polling interval; Among them, the time length of the sending time slot is less than the time length of the reply time slot, and the time length of the reply time slot is less than the time lengths of all the event upload time slots.

7. The method for uploading slave event data based on time slots according to claim 5, characterized in that, The method further includes: When receiving data sent by any one of the slaves, the master detects the received data of the master; When it is detected that there is at least one event data of the slave in the received data, the master executes an event processing process matching the event data, and re-executes the operation of detecting the received data of the master until the end time of the polling interval of the polling frame is reached; The master determines, according to the preset polling order, the first slave whose polling order is after the target slave from all the slaves as the slave to be polled, and triggers the master to execute the operation of sending a polling frame for the slave to be polled to the slave to be polled.

8. A time-slot-based slave event data uploading system, characterized in that, The system is used to realize data transmission of a formation / formation and discharging equipment through a communication system, and the communication system includes a master and slaves, and the slaves include: A first receiving module, configured to receive a polling frame sent by the master to a target slave, where the target slave is one of all slaves included in the communication system, and the slave includes the target slave or other slaves included in the communication system; A first determining module, configured to determine the receiving time when the polling frame is received, and determine that the master is in a data receiving state according to the received polling frame; A calculation module, configured to calculate the event upload time period of the slave according to the event upload time slot of the slave sent by the master received by the first receiving module and the receiving time; A first judging module, configured to judge whether there is event data that needs to be uploaded to the master in the current data of the slave during the event upload time period; A first sending module, configured to upload the event data to the master during the event upload time period when the first judging module judges that there is event data that needs to be uploaded to the master.

9. A slave event data uploading system based on time slots, characterized in that, The system includes: A memory storing executable program code; A processor coupled to the memory; The processor calls the executable program code stored in the memory and executes the method for uploading slave event data based on time slots according to any one of claims 1-7.

10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, which are used to execute the method for uploading slave event data based on time slots according to any one of claims 1-7 when the computer instructions are called.