Efficient data interaction method and system between IDE (integrated development environment) and PLC (programmable logic controller)

By dividing the data interaction methods between IDE and PLC into sections and prioritizing them, and combining them with the producer-consumer model, the problems of low communication efficiency, insufficient real-time performance, and high resource usage between IDE and PLC are solved, and efficient and reliable data transmission and synchronous updates are achieved.

CN120780472APending Publication Date: 2025-10-14THREE GORGES INTELLIGENT CONTROL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510880043.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-27
Publication Date
2025-10-14

AI Technical Summary

Technical Problem

The existing IDE has low communication efficiency with PLC, lacks real-time performance, and occupies a lot of resources, which leads to communication delays and reduced efficiency of control task execution.

Method used

By dividing communication data into multiple data segments, prioritizing and tagging data based on data attributes, and adopting a production-consumer model and cache space to optimize data transmission, decentralized data processing and optimized transmission can be achieved.

Benefits of technology

It improves data transmission efficiency and reliability, ensures timely data transmission and synchronous updates, saves bandwidth resources, and optimizes communication efficiency and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120780472A_ABST
    Figure CN120780472A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data communication, and particularly relates to an efficient data interaction method and system between an IDE and a PLC. The method aims to solve the technical problems that in the prior art, communication efficiency is low, high delay is caused by frequent handshake due to the fact that a traditional protocol is based on a request-response mode of instructions or data one by one, and particularly efficiency is remarkably reduced during batch data reading and writing. Comprising the following steps: acquiring a plurality of pieces of communication data to be sent, and performing data analysis on the communication data to obtain a plurality of data attributes of the communication data; dividing the plurality of pieces of communication data into a plurality of data paragraphs based on the data attributes, and writing all the data paragraphs into a cache space; performing priority ranking on all the data paragraphs, and adding a label to each data paragraph; acquiring a data request sent by the IDE, and detecting whether data needs to be sent or not based on label change: if so, writing a to-be-sent data paragraph into a sending area from a cache space according to a priority sequence; and if not, sending response data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of data communication, and particularly relates to a data efficient interaction method and system between an IDE and a PLC. BACKGROUND

[0002] A programmable logic controller (PLC) is an industrial control device that receives signals from sensors and input modules, processes them, and finally drives output modules to control actuators or devices. PLCs are widely used in industrial automation and play an important role in improving production efficiency and product quality.

[0003] In the prior art, in the use of a programmable controller (PLC), a user creates multiple tasks with different priorities in an integrated development environment (IDE), the properties of each task can be different, and the tasks can be cyclic or timed. The timing task can be between a few milliseconds and a few thousand milliseconds, and the priority of the timing task is higher than that of the cycle. The user writes business code in different tasks, creates different types of data and multiple lines of code, writes sequential execution code and complex logic code, and implements the functions required on site to meet the actual needs of the project. When debugging the PLC code using the integrated development environment (IDE), it is necessary to constantly read the required monitoring data from the PLC and write data to the PLC end. According to the obtained data, the code is constantly modified to meet the required functions and performance of the project.

[0004] The host computer (IDE) software needs to constantly read data from the PLC and also write data to the PLC. Fast data interaction between the host computer and the lower computer is the basis for debugging.

[0005] The prior art has the following technical problems: 1. Low communication efficiency between the existing IDE and the PLC: The traditional protocol is based on a request-response mode for each instruction or data, and frequent handshaking results in high latency, especially when reading and writing batch data, which significantly reduces efficiency.

[0006] 2. Lack of real-time performance: The IDE monitors the real-time state of the PLC (such as variable values and running status) relying on a polling mechanism, which cannot respond to dynamic changes in time.

[0007] 3. High resource occupation: Complex protocol stacks (such as TCP / IP) consume PLC CPU and memory resources, affecting the execution efficiency of control tasks. SUMMARY

[0008] The application provides a data efficient interaction method and system between an IDE and a PLC, aiming to solve the technical problems of low communication efficiency in the prior art, high resource occupation, and insufficient real-time performance.

[0009] The technical solution of the application to solve the above technical problems is as follows: a data efficient interaction method between an IDE and a PLC, the method comprising: obtaining a plurality of communication data to be sent, performing data analysis on the communication data to obtain a plurality of data attributes of the communication data; based on the data attributes, dividing the plurality of communication data into a plurality of data paragraphs, and writing all the data paragraphs into a cache space; performing priority sorting on all the data paragraphs, and adding a label to each data paragraph; obtaining a data request sent by the IDE, and detecting whether the data needs to be sent based on the label change; if yes, writing the data paragraph to be sent from the cache space into a sending area according to the priority sorting; if no, sending response data.

[0010] Further, the above further comprises: obtaining a change attribute written by the IDE; based on the change attribute, updating the data attribute of the corresponding data paragraph in the cache space; after the data attribute is updated, re-performing priority sorting on all the data paragraphs in the cache space.

[0011] Further, the attribute data comprises a main priority, a writing order, a change probability, and a frequency.

[0012] Further, the priority sorting on all the data paragraphs specifically comprises: obtaining the main priority of all the paragraph data, and sorting the data paragraphs from high to low according to the main priority; under the premise that the main priorities are the same, sorting the data paragraphs according to the writing order; under the premise that the main priorities and the writing orders are the same, sorting the data paragraphs according to the change probability; under the premise that the main priorities, the writing orders, and the change probabilities are the same, sorting the data paragraphs according to the frequency.

[0013] Further, the data request sent by the IDE is acquired, and whether the label is changed is detected based on the label to determine whether the data needs to be sent: The data request sent by the IDE is acquired, and whether the label of the data paragraph read by the IDE last time is changed is detected: If the label is changed, the data paragraph corresponding to the changed label is written from the cache space to the sending area; If the label is not changed, a response frame is generated.

[0014] In a second aspect, the present application also provides a data efficient interaction method between an IDE and a PLC to solve the above technical problems, comprising: Acquiring a data requirement of a user; Based on the data requirement, periodically sending a data request to the PLC; the data request is used to trigger the PLC to write the data paragraph to be transmitted from the cache space to the sending area; the data paragraph to be transmitted is determined according to the priority in the cache space; Receiving the data paragraph uploaded by the PLC.

[0015] Further, the above further comprises: Real-time acquisition of a change requirement of a user; Based on the change requirement, a change attribute of the data paragraph is generated, and the change attribute is sent to the PLC; the change attribute is used to trigger the PLC to update the data attribute of the corresponding data paragraph.

[0016] Further, the above further comprises: Acquiring a write request about write data; Judging whether the write data exists in the received data paragraph; If yes, stopping writing; If no, adding a label to the write data and sending it to the PLC.

[0017] In a third aspect, the present application also provides a data efficient interaction system between an IDE and a PLC to solve the above technical problems, comprising: A data analysis module is used to acquire a plurality of communication data to be sent, perform data analysis on the communication data, and obtain a plurality of data attributes of the communication data; A cache space module is used to divide the plurality of communication data into a plurality of data paragraphs based on the data attributes, and write all the data paragraphs into the cache space; A label module is used to perform priority sorting on all the data paragraphs, and add a label to each data paragraph; A data sending module is used to acquire a data request sent by the IDE, and detect whether the data needs to be sent based on the label change: If yes, the data segments to be sent are written from the cache space to the sending area according to the priority sorting; If no, the response data is sent.

[0018] In a fourth aspect, the present application provides a data efficient interaction system between an IDE and a PLC, comprising: a demand acquisition module, configured to acquire data demands of a user; a data request module, configured to periodically send data requests to the PLC based on the data demands, the data requests being configured to trigger the PLC to write data segments to be transmitted from a cache space to a sending area, the data segments to be transmitted being determined in the cache space according to priority sorting; a data receiving module, configured to receive the data segments uploaded by the PLC.

[0019] Compared with the prior art, the present application has the following advantages: 1. The present application divides the communication data into multiple segments according to the segment scheme, and transmits and processes the data in batches, thereby saving bandwidth resources. The segment scheme can dynamically adjust the order and frequency of data transmission according to the communication demands and data priority, optimize the utilization efficiency of communication resources, realize the dispersed processing and optimized transmission of data, thereby improving the transmission efficiency and reliability, avoiding the phenomenon of excessively long or short data frames, and improving the utilization rate of bandwidth.

[0020] 2. The present application realizes efficient communication arrangement and data exchange through the special cache space, data tags and the producer-consumer mode, solves the low efficiency problem of the direct request sending mode, ensures the timely transmission and synchronous update of data, balances the business data pressure, saves bandwidth resources, and optimizes the communication efficiency and resource utilization.

[0021] Other features and advantages of the present application will be described in the following description, and some will become apparent from the description, or will be understood from the practice of the present application. The purposes and other advantages of the present application can be achieved and obtained by the structures indicated in the specification, claims and drawings. BRIEF DESCRIPTION OF DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of these drawings.

[0023] Figure 1A flowchart of a data efficient interaction method between an IDE and a PLC according to an embodiment of the present application is shown. Figure 2 A flowchart of a data efficient interaction method between an IDE and a PLC according to an embodiment of the present application is shown. Figure 3 A structural diagram of a data efficient interaction system between an IDE and a PLC according to an embodiment of the present application is shown. Figure 4 A structural diagram of a data efficient interaction system between an IDE and a PLC according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0024] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0025] Figure 1 A flowchart of a data efficient interaction method between an IDE and a PLC according to an embodiment of the present application is shown. Figure 1 As shown in the figure, the data efficient interaction method between an IDE and a PLC according to an embodiment of the present application is used in a PLC and includes the following steps. Obtaining a plurality of communication data to be sent, performing data analysis on the communication data to obtain a plurality of data attributes of the communication data; Based on the data attributes, the plurality of communication data is divided into a plurality of data paragraphs, and all data paragraphs are written into a cache space; Performing priority sorting on all data paragraphs and adding a label to each data paragraph; Obtaining a data request sent by the IDE, and detecting whether the data needs to be sent based on the label change: If yes, the data paragraph to be sent is written from the cache space to a sending area according to the priority sorting; If no, a response data is sent.

[0026] In this embodiment, the IDE groups the communication data according to the data attributes, divides data attributes into the same category, and performs priority sorting on the data paragraphs according to the data attributes, so that the transmission and processing of the data paragraphs are performed in batches, and a specific arrangement task is formulated.

[0027] Optionally, the method further includes: acquire the change attribute written by the IDE; update the data attribute of the corresponding data paragraph in the cache space based on the change attribute; re-prioritize all data paragraphs in the cache space after the data attribute is updated.

[0028] Optionally, the attribute data includes: main priority, writing order, change probability, and frequency.

[0029] Optionally, the prioritization of all data paragraphs specifically includes: acquire the main priority of all paragraph data, and prioritize the data paragraphs from high to low according to the main priority; prioritize the data paragraphs according to the writing order on the premise that the main priority is the same; prioritize the data paragraphs according to the change probability on the premise that the main priority and the writing order are the same; prioritize the data paragraphs according to the frequency on the premise that the main priority, the writing order, and the change probability are the same.

[0030] In this embodiment, the communication data is divided into 11 paragraphs according to the main priority, the writing order, the change probability, and the frequency, and is prioritized as follows: Data paragraph 1: writing, highest priority; Data paragraph 2: reading, highest priority; Data paragraph 3: reading, second-highest priority, high change probability; Data paragraph 4: reading, second-highest priority, medium change probability; Data paragraph 5: reading, second-highest priority, low change probability; Data paragraph 6: reading, medium priority, high change probability, high frequency; Data paragraph 7: reading, medium priority, high change probability, medium frequency; Data paragraph 8: reading, medium priority, high change probability, low frequency; Data paragraph 9: reading, medium priority, general change probability, general frequency; Data paragraph 10: reading, low priority, general change probability, general frequency; Data paragraph 11: reading, low priority, low change probability, low frequency; Optionally, acquiring the data request sent by the IDE, and detecting whether the data needs to be sent based on the tag change specifically includes: acquiring the data request sent by the IDE, and detecting whether the tag of the data paragraph read by the IDE last time has changed: If the change occurs, the data paragraph corresponding to the changed label is written from the cache space to the sending area; If no change occurs, a response frame is generated.

[0031] In this embodiment, the data transmission communication is completed by using the producer-consumer true mode, wherein the PLC serves as a producer and is responsible for periodically writing data to the cache space. The IDE serves as a consumer and requests new data from the PLC according to the data analysis requirements of the interface and other system requirements. After detecting the change of the label, the PLC sends the changed data paragraph to the IDE. This producer-consumer true mode reduces the frequency of communication, and less communication is required when the data does not change, and timely communication is required when the data changes.

[0032] As shown in Figure 2 The embodiment of the present application also provides a data efficient interaction method between an IDE and a PLC, which is used in the IDE and includes the following steps: acquiring data requirements of a user; periodically sending a data request to the PLC based on the data requirements; the data request is used to trigger the PLC to write a data paragraph to be transmitted from the cache space to the sending area; the data paragraph to be transmitted is determined according to a priority in the cache space; receiving the data paragraph uploaded by the PLC.

[0033] Further, the above also includes the following steps: acquiring change requirements of the user in real time; generating a change attribute of the data paragraph based on the change requirements, and sending the change attribute to the PLC; the change attribute is used to trigger the PLC to update the data attribute of the corresponding data paragraph.

[0034] Further, the above also includes the following steps: acquiring a write request about write data; judging whether the write data exists in the received data paragraph or not; if yes, stopping writing; if no, adding a label to the write data and sending the write data to the PLC.

[0035] Based on the same principle as the method shown in Figure 1 The embodiment of the present application also provides a data efficient interaction system between an IDE and a PLC, which is used in the PLC and includes the following steps: a data analysis module, which is used to acquire a plurality of communication data to be sent, to perform data analysis on the communication data, and to obtain a plurality of data attributes of the communication data; a cache space module, which is used to divide the plurality of communication data into a plurality of data paragraphs based on the data attributes, and to write all the data paragraphs into the cache space; a tag module for prioritizing all data paragraphs and adding a tag to each data paragraph; a data sending module for obtaining a data request sent by the IDE, and detecting whether the data needs to be sent based on the tag change: if yes, writing the data paragraph to be sent from the cache space to the sending area according to the priority sorting; if no, sending a response data.

[0036] Based on the same principle as shown in the method in Figure 2 Based on the same principle as shown in the method in a demand obtaining module for obtaining a data demand of a user; a data request module for periodically sending a data request to the PLC based on the data demand; the data request is used to trigger the PLC to write a data paragraph to be transmitted from the cache space to the sending area; the data paragraph to be transmitted is determined according to the priority sorting in the cache space; a data receiving module for receiving the data paragraph uploaded by the PLC.

[0037] It should be understood that the flowcharts and block diagrams in the drawings illustrate the possible implementation architecture, function and operation of the method and computer program product according to various embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the involved functions. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.

[0038] The above description is merely preferred embodiments of the present application and a description of the principles of the technology used. Those skilled in the art should understand that the disclosed scope of the present application is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the disclosed concept. For example, the above features can be replaced with the technical features disclosed in the present application (but not limited to) having similar functions to form technical solutions.

Claims

1. A method for efficient data interaction between IDE and PLC, characterized in that: The method comprises: Acquire multiple communication data to be sent, perform data analysis on the communication data, and obtain multiple data attributes of the communication data; Based on the data attributes, the plurality of communication data are divided into a plurality of data segments, and all the data segments are written into a cache space; Prioritize all data segments and add labels to each data segment; Get the data request sent by the IDE and detect whether data needs to be sent based on the tag change: If so, write the data segments to be sent from the buffer space to the sending area according to the priority order; If not, send response data.

2. The method for efficient data interaction between an IDE and a PLC according to claim 1, characterized in that: Also includes: Get the changed properties written by the IDE; Based on the changed attributes, updating the data attributes of the corresponding data segment in the cache space; After the data attributes are updated, all data segments in the cache space are re-prioritized.

3. The method for efficient data interaction between IDE and PLC according to claim 1, characterized in that: The attribute data includes: main priority, write order, change probability and frequency.

4. The method for efficient data interaction between an IDE and a PLC according to claim 3, characterized in that: Prioritize all data segments including: Obtaining the primary priority of all paragraph data, and sorting the data paragraphs from high to low according to the primary priority; Under the premise of the same primary priority, sort the data segments according to the writing order; Under the premise that the main priority and writing order are the same, the data segments are sorted according to the probability of change; On the premise that the main priority, writing order and change probability are the same, the data segments are sorted by frequency.

5. The method for efficient data interaction between IDE and PLC according to claim 1, characterized in that: Get the data request sent by the IDE and detect whether data needs to be sent based on tag changes. Specifically include: Get the data request sent by the IDE and check whether the label of the data segment read by the IDE last time has changed: If a change occurs, the data segment corresponding to the changed tag is written from the cache space to the sending area; If no changes have occurred, a response frame is generated.

6. A method for efficient data interaction between IDE and PLC, characterized in that: include: Obtaining user data needs; Based on the data demand, periodically send data requests to the PLC; The data request is used to trigger the PLC to write the data segment to be transmitted from the buffer space to the sending area; The data segments to be transmitted are determined in the cache space according to the priority sorting; Receive data segments uploaded by PLC.

7. The method for efficient data interaction between IDE and PLC according to claim 6, characterized in that: Also includes: Obtain user change requirements in real time; Based on the change requirement, a change attribute of the data segment is generated and sent to the PLC. The change attribute is used to trigger the PLC to update the data attribute of the corresponding data segment.

8. The method for efficient data interaction between an IDE and a PLC according to claim 6, characterized in that: Also includes: Get a write request for writing data; Determining whether the write data exists in the received data segment; If so, stop writing; If not, a tag is added to the written data and sent to the PLC.

9. An efficient data interaction system between IDE and PLC, characterized in that: include: A data analysis module is used to obtain a plurality of communication data to be sent, perform data analysis on the communication data, and obtain a plurality of data attributes of the communication data; a cache space module, configured to divide the plurality of communication data into a plurality of data segments based on the data attributes, and write all the data segments into a cache space; The labeling module is used to prioritize all data segments and add labels to each data segment; The data sending module is used to obtain data requests sent by the IDE and detect whether data needs to be sent based on tag changes: If so, write the data segments to be sent from the buffer space to the sending area according to the priority order; If not, send response data.

10. An efficient data interaction system between IDE and PLC, characterized in that: include: Demand acquisition module, used to obtain user data requirements; A data request module is used to periodically send data requests to the PLC based on the data demand; the data request is used to trigger the PLC to write the data segment to be transmitted from the buffer space to the sending area; The data segments to be transmitted are determined in the cache space according to the priority sorting; The data receiving module is used to receive data segments uploaded by the PLC.