A communication method, device, ProfibusDP master station and medium

By adopting a priority-based polling mechanism in the ProfibusDP master station, prioritization is set according to the polling period of the slave station and processing it, the problem of inconsistent communication periods of the slave station is achieved, flexible communication and cost reduction are achieved.

CN114265808BActive Publication Date: 2024-12-10HANGZHOU HOLLYSYS AUTOMATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111584020.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2024-12-10
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

When the existing ProfibusDP master station faces slave stations with inconsistent communication cycle length requirements, the communication method is not flexible enough, resulting in an increase in hardware costs.

Method used

Adopt the priority-based polling mechanism, set priority according to the preset polling cycle of each slave, priority is given to slaves with short polling cycles, and record the next polling time in the waiting list to ensure different slaves. The station waits for different times.

Benefits of technology

It realizes flexible processing of slave stations in different communication cycles, without the need to add new Profibus DP master station and Profibus bus, reducing communication costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114265808B_ABST
    Figure CN114265808B_ABST
Patent Text Reader

Abstract

The invention provides a communication method and a related device. The method is applied to a Profibus DP master station and comprises: extracting a target slave station identifier with the highest preset priority from a preset ready list; setting the preset priority according to a preset polling cycle corresponding to each slave station identifier; performing slave station communication with a Profibus DP slave station corresponding to the target slave station identifier, and writing the target slave station identifier into a preset waiting list when the slave station communication ends; recording the next polling time of the target polling task according to the preset polling cycle corresponding to the target slave station identifier; extracting a to-be-processed slave station identifier from the waiting list and writing it into a ready list, and entering the step of extracting the target slave station identifier with the highest preset priority from the preset ready list; the interval between the next polling time of the to-be-processed slave station identifier and the current time is less than a preset threshold; and a priority-based polling mechanism can be used to meet the communication requirements of slave stations with different communication cycles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial communication, and in particular to a communication method, a device, a Profibus DP master station and a storage medium. Background Art

[0002] Profibus (Process Field Bus) is a fieldbus standard used in the field of automation technology, while ProfibusDP (Decentralized Periphery) is used for communication between device-level control systems and distributed I / O. In the related art, the communication method between the ProfibusDP master station and multiple ProfibusDP slave stations is as follows: the master station communicates with each slave station in turn according to a preset order, and after completing the communication with the last slave station, it re-polls the first slave station in the above order, and the final result of this method is that the data communication cycle of all slave stations is the same; when some ProfibusDP slave stations need to shorten the data communication cycle, new ProfibusDP master stations and Profibus buses will be set up separately for these special slave stations. However, the above method is not flexible enough when facing multiple slave stations with inconsistent communication cycle length requirements. In addition, the new master station and communication link also increase the hardware cost. Summary of the invention

[0003] The purpose of the present invention is to provide a communication method, device, ProfibusDP master station and storage medium, which can utilize a priority-based polling mechanism to meet the communication needs of slave stations with different communication cycles without adding new ProfibusDP master stations and Profibus buses, thereby reducing communication costs.

[0004] In order to solve the above technical problems, the present invention provides a communication method, which is applied to a ProfibusDP master station, and the method comprises:

[0005] Extracting the target slave station identifier with the highest preset priority from the preset ready list; the preset priority is set according to the preset polling period corresponding to each slave station identifier;

[0006] The ProfibusDP slave station corresponding to the target slave station identifier performs slave station communication, and when the slave station communication ends, writes the target slave station identifier into a preset waiting list;

[0007] According to the preset polling cycle corresponding to the target slave station identifier, recording the next polling time of the target polling task;

[0008] Extract the to-be-processed slave station identifier from the waiting list and write it into the ready list, and enter the step of extracting the target slave station identifier with the highest preset priority from the preset ready list; the interval between the next polling time of the to-be-processed slave station identifier and the current time is less than a preset threshold.

[0009] Optionally, before extracting the target slave station identifier with the highest preset priority from the preset ready list, the method further includes:

[0010] Obtaining the preset polling cycle and slave station identification corresponding to each of the ProfibusDP slave stations, and setting the preset priority for each of the slave station identifications according to the preset polling cycle in order from short to long;

[0011] The slave station identifiers that have completed the preset priority setting are written into the ready list, and when the writing is completed, the step of extracting the target slave station identifier with the highest preset priority from the preset ready list is entered.

[0012] Optionally, writing the identification of the slave station that has completed the preset priority setting into the ready list includes:

[0013] Sorting the slave station identifiers according to the preset priorities from high to low, and writing the sorted slave station identifiers into the ready list;

[0014] Correspondingly, extracting the identification of the slave station to be processed from the waiting list and writing it into the ready list includes:

[0015] The to-be-processed slave station identifiers are extracted from the waiting list, and the to-be-processed slave station identifiers are written into the ready list according to the preset priority order from high to low.

[0016] Optionally, extracting the target slave station identifier with the highest preset priority from the preset ready list includes:

[0017] The first slave station identifier in the ready list is extracted and set as the target slave station identifier.

[0018] The present invention also provides a communication device, comprising:

[0019] A first extraction module is used to extract the target slave station identifier with the highest preset priority from the preset ready list; the preset priority is set according to the preset polling period corresponding to each slave station identifier;

[0020] A communication module, used for performing slave station communication with the ProfibusDP slave station corresponding to the target slave station identifier, and when the slave station communication ends, writing the target slave station identifier into a preset waiting list;

[0021] A recording module, used for recording the next polling time of the target polling task according to the preset polling cycle corresponding to the target slave station identifier;

[0022] The second extraction module is used to extract the identification of the slave station to be processed in the waiting list and write it into the ready list, and enter the step of extracting the target slave station identification with the highest preset priority in the preset ready list; the interval between the next polling time of the identification of the slave station to be processed and the current time is less than a preset threshold.

[0023] Optionally, it also includes:

[0024] An acquisition module, used for acquiring the preset polling cycle and the slave station identification corresponding to each of the DP slave stations, and setting the preset priority for each of the slave station identification according to the preset polling cycle in order from short to long;

[0025] The writing module is used to write the slave station identification that has completed the preset priority setting into the ready list, and enter the step of extracting the target slave station identification with the highest preset priority from the preset ready list when the writing is completed.

[0026] Optionally, the writing module includes:

[0027] A first sorting submodule, used for sorting the slave station identifiers according to the preset priorities from high to low, and writing the sorted slave station identifiers into the ready list;

[0028] Accordingly, the second extraction module includes:

[0029] The second sorting submodule is used to extract the identification of the slave station to be processed from the waiting list, and write the identification of the slave station to be processed into the ready list according to the order of the preset priorities from high to low.

[0030] Optionally, the first extraction module includes:

[0031] The extraction submodule is used to extract the first slave station identifier in the ready list and set it as the target slave station identifier.

[0032] The present invention also provides a ProfibusDP master station, comprising:

[0033] Memory for storing computer programs;

[0034] A processor is used to implement the communication method as described above when executing the computer program.

[0035] The present invention also provides a storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the communication method as described above is implemented.

[0036] The present invention provides a communication method, which is applied to a Profibus DP master station. The method comprises: extracting a target slave station identifier with the highest preset priority from a preset ready list; the preset priority is set according to a preset polling cycle corresponding to each slave station identifier; the Profibus DP slave station corresponding to the target slave station identifier performs slave station communication, and when the slave station communication ends, writes the target slave station identifier into a preset waiting list; according to the preset polling cycle corresponding to the target slave station identifier, records the next polling time of the target polling task; extracting a to-be-processed slave station identifier from the waiting list and writing it into the ready list, and entering the step of extracting the target slave station identifier with the highest preset priority from the preset ready list; the interval between the next polling time of the to-be-processed slave station identifier and the current time is less than a preset threshold.

[0037] It can be seen that the present invention will first set the corresponding priority according to the preset polling cycle of each ProfibusDP slave station, and write the slave station identifier that has completed the priority setting into the preset ready list, so that when the ProfibusDP master station performs slave communication, it can extract the target slave station identifier with a higher priority from the ready list, and then perform slave communication with the ProfibusDP slave station corresponding to the target slave station identifier, that is, it can give priority to communicating with the slave station with a shorter preset polling cycle and which needs to be communicated frequently; in addition, after completing the communication, the ProfibusDP master station will write the target slave station identifier into the waiting list, and record the next polling time corresponding to the identifier according to the preset polling cycle corresponding to the target slave station identifier, and then ProfibusDP will re-extract a batch of to-be-processed slave station identifiers that are about to reach the next polling time from the waiting list to the ready queue for processing. Taking into account that the preset polling cycles of different slave station identifiers are different, the present invention can ensure that slaves with different preset polling cycles wait for different times in the waiting queue, and then each slave station can be processed differently. In short, the present invention can use a priority-based polling mechanism to meet the communication needs of slave stations with different communication cycles without adding an additional ProfibusDP master station and Profibus bus, thereby improving the flexibility of ProfibusDP slave station communication and reducing communication costs. The present invention also provides a communication device, a ProfibusDP master station and a storage medium, which have the above-mentioned beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0039] Figure 1 A flow chart of a communication method provided by an embodiment of the present invention;

[0040] Figure 2 A state transition diagram of a slave station polling provided by an embodiment of the present invention;

[0041] Figure 3 A schematic diagram of a polling mechanism provided by an embodiment of the present invention;

[0042] Figure 4 A structural block diagram of a communication device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0044] In the related art, the communication method between a ProfibusDP master station and multiple ProfibusDP slave stations is as follows: the master station communicates with each slave station in turn according to a preset order, and after completing the communication with the last slave station, it re-polls the first slave station in the above order. The final result of this method is that the data communication cycle of all slave stations is the same; when some ProfibusDP slave stations need to shorten the data communication cycle, new ProfibusDP master stations and Profibus buses will be set up separately for these special slave stations. However, the above method is not flexible enough when facing multiple slave stations with inconsistent communication cycle length requirements. In addition, the new master station and communication link also increase the hardware cost. In view of this, the present invention provides a communication method that can utilize a priority-based polling mechanism to meet the communication requirements of slave stations with different communication cycles. There is no need to add new ProfibusDP master stations and Profibus buses, which can reduce communication costs. Please refer to Figure 1 , Figure 1 A flow chart of a communication method provided by an embodiment of the present invention, which is applied to a Profibus DP master station, may include:

[0045] S101 , extracting a target slave station identifier with the highest preset priority from a preset ready list; the preset priority is set according to a preset polling period corresponding to each slave station identifier.

[0046] In an embodiment of the present invention, the ready list is used to store the slave identification of the ProfibusDP slave station that is about to be communicated by the ProfibusDP master station. It should be noted that the embodiment of the present invention does not limit the maximum number of slave identifications that can be stored in the ready list, and can be set according to actual application requirements. Further, these slave identifications are all marked with a preset priority, and the priority is set according to the preset polling cycle corresponding to each slave station. It can be understood that the shorter the preset polling cycle, the higher the corresponding priority. In addition, the embodiment of the present invention does not limit the specific priority setting method, for example, the corresponding threshold interval ladder can be set for the preset polling cycle, and the corresponding priority can be set for each ladder. Of course, the corresponding priority can also be set for a specific preset polling cycle value. In an embodiment of the present invention, for ease of management, a corresponding priority can be set for a specific preset polling cycle value. Specifically, the preset polling cycle of each slave station can be obtained, and the corresponding priority can be set for each slave station in the order of the cycle from short to long. Further, it should be noted that the embodiment of the present invention does not limit the specific preset polling cycle, and can be set according to actual application requirements. Further, it can be understood that when the Profibus DP master station performs slave station communication for the first time, it is necessary to place the slave station identifiers of all slave stations in the ready list.

[0047] In a possible case, before extracting the target slave station identifier with the highest preset priority from the preset ready list, the method further includes:

[0048] Step 11: Obtain the preset polling cycle and slave ID corresponding to each ProfibusDP slave station, and set a preset priority for each slave station ID in order from short to long according to the preset polling cycle;

[0049] Step 12: Write the slave station identifier that has completed the preset priority setting into the ready list, and when the writing is completed, enter the step of extracting the target slave station identifier with the highest preset priority from the preset ready list.

[0050] It should be noted that the embodiment of the present invention does not limit the storage method of the slave station identifier in the list, for example, it can be stored in random order or in order of priority. It is understandable that when storing in random order, the ProfibusDP master station needs to determine the target slave station identifier with the highest preset priority in the ready list each time; of course, for easy acquisition, in the embodiment of the present invention, the slave station identifier can be stored in the ready list in order of priority, so that the ProfibusDP master station can extract the slave station identifier according to the pre-stored order when performing slave station communication for the first time.

[0051] In one possible scenario, the identification of the slaves that have completed the preset priority setting is written into the ready list, including:

[0052] Step 21: Sort the slave station identifiers according to the preset priority from high to low, and write the sorted slave station identifiers into the ready list.

[0053] In one possible case, extracting the target slave station identifier with the highest preset priority from the preset ready list includes:

[0054] Step 31: Extract the first slave ID in the ready list and set it as the target slave ID.

[0055] S102, the ProfibusDP slave station corresponding to the target slave station identifier performs slave station communication, and when the slave station communication ends, writes the target slave station identifier into a preset waiting list.

[0056] It should be noted that the embodiment of the present invention does not limit the specific process of slave station communication, and reference may be made to the relevant technology of ProfibusDP. Further, in the embodiment of the present invention, the waiting list is used to store the slave station identifiers that have communicated and have not yet reached the next communication time. These slave stations need to wait in the waiting list until the next communication time arrives or is about to arrive before they are extracted to the ready list. It should be noted that the embodiment of the present invention does not limit the upper limit of the slave station identifiers that can be stored in the waiting list, and it can be set according to actual application requirements.

[0057] S103: Record the next polling time of the target polling task according to the preset polling cycle corresponding to the target slave station identifier.

[0058] It is understandable that the slave station identifiers in the waiting list should be set with corresponding waiting times. Therefore, in this step, after the slave station identifiers are written into the waiting list, the corresponding next polling time will be set according to the corresponding preset polling cycle.

[0059] S104, extracting the to-be-processed slave station identifier and the write-ready list from the waiting list, and entering step S101; the interval between the next polling time of the to-be-processed slave station identifier and the current time is less than a preset threshold.

[0060] After completing the writing to the waiting list, the embodiment of the present invention searches for the target slave station identifier in the waiting list that is about to reach the next polling time and extracts it to the ready list. The embodiment of the present invention determines whether the slave station identifier is about to be communicated based on whether the interval between the next polling time of the slave station identifier and the current time is less than a preset threshold. It should be noted that the embodiment of the present invention does not limit the specific value of the preset threshold, and it can be set according to actual application requirements.

[0061] Furthermore, if the slave station identifiers in the ready list are stored in a preset priority sequence, the to-be-processed slave station identifiers extracted from the waiting list should also be written into the ready list in this order.

[0062] In one possible case, extracting the pending slave station identifier and the write-ready list from the waiting list includes:

[0063] Step 41: extract the identification of the slave station to be processed from the waiting list, and write the identification of the slave station to be processed into the ready list according to the preset priority order from high to low.

[0064] Based on the above embodiments, the present invention will first set the corresponding priority according to the preset polling cycle of each ProfibusDP slave station, and write the slave station identifier that has completed the priority setting into the preset ready list, so that when the ProfibusDP master station performs slave communication, it can extract the target slave station identifier with a higher priority from the ready list, and then perform slave communication with the ProfibusDP slave station corresponding to the target slave station identifier, that is, it can give priority to communicating with the slave station with a shorter preset polling cycle and which needs to be communicated frequently; in addition, after completing the communication, the ProfibusDP master station will write the target slave station identifier into the waiting list, and record the next polling time corresponding to the identifier according to the preset polling cycle corresponding to the target slave station identifier, and then ProfibusDP will re-extract a batch of to-be-processed slave station identifiers that are about to reach the next polling time from the waiting list to the ready queue for processing. Considering that the preset polling cycles of different slave station identifiers are different, the present invention can ensure that slaves with different preset polling cycles wait for different times in the waiting queue, and thus each slave station can be processed differently. In short, the present invention can utilize a priority-based polling mechanism to meet the communication requirements of slave stations with different communication cycles without the need to add an additional ProfibusDP master station and Profibus bus, thereby improving the flexibility of ProfibusDP slave station communication and reducing communication costs.

[0065] The following describes the above communication method based on a specific state transition diagram. Figure 2 , Figure 2A state transition diagram of a slave station polling provided by an embodiment of the present invention. The specific meaning of the state transition diagram is as follows:

[0066] L1: Indicates that according to the controller's requirements, all DP slaves are configured according to the configured polling cycle and priority to form an initialized polling list.

[0067] L2: Add the initialized DP slave polling list to the ready queue and enqueue them in order of priority.

[0068] L3: The DP master protocol stack selects a DP slave with the highest priority in the ready queue for polling and puts the slave into the execution state.

[0069] L4: Add the DP slave station that has completed polling to the waiting queue and record the time when the next polling is required.

[0070] L5: Periodically check whether the next polling time of the DP slave in the waiting queue is about to arrive. If the next polling time is about to arrive, add the slave to the ready queue. And add the DP slave to the corresponding position of the queue according to the priority. The queue principle is that the highest priority is at the head of the queue.

[0071] Finally, it can be achieved that DP slaves with high priority and short polling period can be polled within the expected time, and DP slaves with low priority and long polling time can also be polled. Figure 3 , Figure 3 A schematic diagram of a polling mechanism provided by an embodiment of the present invention, wherein Min Cycle represents a small cycle. In one possible scenario, if the controller needs to communicate with 8 DP slave stations, the data exchange cycle of slave stations No. 1 and No. 2 is required to be 4ms. Polling a DP slave station takes 1ms. The polling cycle of DP slave stations No. 3 and No. 4 is no more than 8ms. The polling cycle of the remaining stations is no more than 20ms. According to the traditional solution, it is impossible to achieve this under one link, and it can only be achieved by increasing the controller link; this requirement can be met by adopting a priority-based polling mechanism.

[0072] The communication device, Profibus DP master station and storage medium provided in the embodiments of the present invention are introduced below. The communication device, Profibus DP master station and storage medium described below can be referenced to the communication method described above.

[0073] Please refer to Figure 4 , Figure 4 A structural block diagram of a communication device provided in an embodiment of the present invention, the device may include:

[0074] The first extraction module 401 is used to extract the target slave station identifier with the highest preset priority from the preset ready list; the preset priority is set according to the preset polling period corresponding to each slave station identifier;

[0075] The communication module 402 is used to perform slave communication with the ProfibusDP slave corresponding to the target slave ID, and write the target slave ID into a preset waiting list when the slave communication ends;

[0076] The recording module 403 is used to record the next polling time of the target polling task according to the preset polling cycle corresponding to the target slave station identifier;

[0077] The second extraction module 404 is used to extract the pending slave station identifier and write the ready list in the waiting list, and enter the step of extracting the target slave station identifier with the highest preset priority in the preset ready list; the interval between the next polling time of the pending slave station identifier and the current time is less than a preset threshold.

[0078] Optionally, the device may further include:

[0079] An acquisition module is used to acquire the preset polling cycle and slave station identification corresponding to each DP slave station, and set a preset priority for each slave station identification according to the preset polling cycle from short to long order;

[0080] The writing module is used to write the slave station identification that has completed the preset priority setting into the ready list, and enter the step of extracting the target slave station identification with the highest preset priority from the preset ready list when the writing is completed.

[0081] Optionally, the writing module may include:

[0082] The first sorting submodule is used to sort the slave station identifiers in a descending order according to preset priorities, and write the sorted slave station identifiers into a ready list.

[0083] Accordingly, the second extraction module 404 may include:

[0084] The second sorting submodule is used to extract the identification of the slave station to be processed from the waiting list, and write the identification of the slave station to be processed into the ready list according to the preset priority order from high to low.

[0085] Optionally, the first extraction module 401 includes:

[0086] The extraction submodule is used to extract the first slave station identifier in the ready list and set it as the target slave station identifier.

[0087] The embodiment of the present invention further provides a ProfibusDP master station, comprising:

[0088] Memory for storing computer programs;

[0089] A processor is used to implement the steps of the communication method as described above when executing a computer program.

[0090] Since the embodiments of the Profibus DP master station part correspond to the embodiments of the communication method part, the embodiments of the Profibus DP master station part refer to the description of the embodiments of the communication method part, which will not be repeated here.

[0091] An embodiment of the present invention further provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the communication method in any of the above embodiments are implemented.

[0092] Since the embodiments of the storage medium part correspond to the embodiments of the communication method, please refer to the description of the embodiments of the communication method part for the embodiments of the storage medium part, which will not be repeated here.

[0093] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0094] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0095] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0096] The above is a detailed introduction to a communication method, device, ProfibusDP master station and storage medium provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, the present invention can also be improved and modified, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.

Claims

1. A communication method, characterized in that: Applied to a ProfibusDP master station, the method comprises: Extracting the target slave station identifier with the highest preset priority from a preset ready list; the preset priority is set according to a preset polling period corresponding to each slave station identifier, the ready list is used to store the slave station identifiers of the ProfibusDP slave stations to be communicated by the ProfibusDP master station, and when the ProfibusDP master station performs slave station communication for the first time, the slave station identifiers of all ProfibusDP slave stations need to be placed in the ready list; The ProfibusDP slave station corresponding to the target slave station identifier performs slave station communication, and when the slave station communication ends, writes the target slave station identifier into a preset waiting list; the waiting list is used to store the slave station identifiers that have communicated and have not yet reached the next communication time; According to the preset polling cycle corresponding to the target slave station identifier, record the next polling time of the target polling task; Extracting the to-be-processed slave station identifier from the waiting list and writing it into the ready list, and entering the step of extracting the target slave station identifier with the highest preset priority from the preset ready list; the interval between the next polling time of the to-be-processed slave station identifier and the current time is less than a preset threshold; Before extracting the target slave station identifier with the highest preset priority from the preset ready list, it also includes: Obtaining the preset polling cycle and slave station identification corresponding to each of the ProfibusDP slave stations, and setting the preset priority for each of the slave station identifications according to the preset polling cycle in order from short to long; Writing the slave station identification that has completed the preset priority setting into the ready list, and entering the step of extracting the target slave station identification with the highest preset priority from the preset ready list when the writing is completed; The step of writing the slave station identifier that has completed the preset priority setting into the ready list comprises: Sorting the slave station identifiers according to the preset priorities from high to low, and writing the sorted slave station identifiers into the ready list; Correspondingly, extracting the identification of the slave station to be processed from the waiting list and writing it into the ready list includes: Extracting the to-be-processed slave station identifier from the waiting list, and writing the to-be-processed slave station identifier into the ready list according to the preset priority order from high to low; The step of extracting the target slave station identifier with the highest preset priority from the preset ready list includes: The first slave station identifier in the ready list is extracted and set as the target slave station identifier.

2. A communication device, characterized in that: include: A first extraction module, used for extracting a target slave station identifier with a preset highest priority from a preset ready list; The preset priority is set according to the preset polling cycle corresponding to each slave station identifier, and the ready list is used to store the slave station identifiers of the ProfibusDP slave stations that are about to be communicated by the ProfibusDP master station. When the ProfibusDP master station performs slave station communication for the first time, the slave station identifiers of all ProfibusDP slave stations need to be placed in the ready list; A communication module, used for performing slave station communication with the ProfibusDP slave station corresponding to the target slave station identifier, and when the slave station communication ends, writing the target slave station identifier into a preset waiting list; the waiting list is used for storing the slave station identifiers that have communicated and have not yet reached the next communication time; A recording module, used for recording the next polling time of the target polling task according to the preset polling cycle corresponding to the target slave station identifier; A second extraction module is used to extract the identification of the slave station to be processed from the waiting list and write it into the ready list, and enter the step of extracting the target slave station identification with the highest preset priority from the preset ready list; the interval between the next polling time of the identification of the slave station to be processed and the current time is less than a preset threshold; An acquisition module, used for acquiring the preset polling cycle and the slave station identification corresponding to each of the DP slave stations, and setting the preset priority for each of the slave station identification according to the preset polling cycle in order from short to long; A writing module, used for writing the identification of the slave station that has completed the preset priority setting into the ready list, and entering the step of extracting the identification of the target slave station with the highest preset priority from the preset ready list when the writing is completed; The writing module comprises: A first sorting submodule, used for sorting the slave station identifiers according to the preset priorities from high to low, and writing the sorted slave station identifiers into the ready list; Accordingly, the second extraction module includes: A second sorting submodule is used to extract the to-be-processed slave station identifiers from the waiting list, and write the to-be-processed slave station identifiers into the ready list according to the preset priority order from high to low; The first extraction module comprises: The extraction submodule is used to extract the first slave station identifier in the ready list and set it as the target slave station identifier.

3. A ProfibusDP master station, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the communication method as claimed in claim 1 when executing the computer program.

4. A storage medium, characterized in that: The storage medium stores computer executable instructions, and when the computer executable instructions are loaded and executed by the processor, the communication method according to claim 1 is implemented.