Automatic communication optimization method
By adding new data marking areas and optimizing reading strategies on automation equipment, the time-consuming reading of address data in large-scale projects is solved, fast data perception and resource conservation are achieved, and system performance is improved.
Patent Information
- Application Number
- CN202510141363.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-05-13
AI Technical Summary
In large-scale projects, there are tens of thousands of automation equipment addresses that need to be read and written. It is time-consuming to read the data of these addresses one by one, resulting in excessive use of software system resources or inability to sense changes in automation equipment data in time.
Added a new data marking area on the automation device to mark the status of data changes. The automation program modifies the flag value when updating the data. The software system checks the flag value at high frequency. When a change is detected, it accesses the corresponding address to obtain the changed data and resets the flag bit.
By only reading a small number of automation device addresses, data change perception in a level 10 milliseconds is achieved, which improves the timeliness of data perception, reduces system resource usage, and improves overall performance.
Smart Images

Figure CN119996178A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automated communication, and in particular to an automated communication optimization method. Background Art
[0002] Automated communication is a way to achieve automatic completion of the communication process with less human intervention using modern information technology. Its key technologies include sensors and data acquisition, such as temperature and humidity sensors to collect environmental data; communication networks, such as Wi-Fi and optical fiber to transmit data; and automated control and processing, relying on computer systems to process data and perform operations according to preset rules.
[0003] In the prior art, unlike the Internet communication protocol, the communication between the software system and the automation equipment is essentially the reading and writing of data, and the data changes within the automation equipment require the software system to actively read them.
[0004] However, when it is actually applied to large-scale projects, there are tens of thousands of automation equipment addresses that need to be read and written. It is very time-consuming to read the data of these addresses one by one. If the software system reads frequently, it will take up a lot of resources. If the reading time interval is too long, the software system cannot perceive the changes in the automation equipment data in time. In view of this, we propose an automation communication optimization method. Summary of the invention
[0005] In view of the deficiencies of the prior art, the present invention provides an automated communication optimization method, which solves the problem that in large projects, there are tens of thousands of automated device addresses that need to be read and written, and it is very time-consuming to read the data of these addresses one by one.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: an automated communication optimization method, comprising the following steps:
[0007] S1: Added data marking area
[0008] In automation equipment, in addition to the area used to exchange data, a new storage area is added to mark the status of data changes;
[0009] S2: Update tag value
[0010] The automation program modifies the value of the flag in the storage area when updating the data;
[0011] S3: Tag value detection
[0012] The software system checks the value of the flag at a high frequency;
[0013] S4: Data Update
[0014] When the software system reads that the value of the flag has changed, it accesses the corresponding address on the automation device to obtain the changed data;
[0015] S5: Mark bit reset
[0016] The software system resets the flag bit after reading the corresponding changed data.
[0017] Preferably, the flags in the S1 newly added data marking area are represented by bits, 1 indicates that the data has changed, and each byte represents 8 flags. In addition, for address areas that change frequently, the number of addresses sharing flags is reduced, and for areas that change infrequently, the number of shared addresses is increased.
[0018] Preferably, the number of addresses of automation equipment in the S1 newly added data marking area is set to n, and on average every k addresses share a flag, and the space occupied by the flag is m=n / k / 8 bytes. The software system reads these m bytes of data once in each cycle and parses out the flag bit with a value of 1 therefrom.
[0019] Preferably, when S2 updates the tag value, a priority calculation program is run synchronously, and priorities are set for address marks of automation equipment of different types or regions according to calculation results of the priority calculation program. When the software system detects changes in multiple marks, data corresponding to high-priority marks are read preferentially.
[0020] Preferably, for the relevant data in the S2 update tag value, multiple automation device addresses share the same flag, and the software system saves the previous value of each address in advance. When the automation program changes the data of one or more addresses sharing the same flag, the corresponding flag is updated.
[0021] Preferably, when the number of automation device addresses in the S2 update mark value is large and there are few data changes at the same time, a multi-dimensional flag is set. Taking two dimensions as an example, there are n=k*k addresses, and two groups of flags are configured on the automation device, each group has k flag bits. The software system and the automation program agree on a hash algorithm to map each address to a flag bit in the two groups of flags, and ensure that two different addresses will not have the same flag bits in the two groups.
[0022] Preferably, the S3 tag value detection is adaptively adjusted according to the activity of the automation equipment data. When the mark changes frequently within a period of time, it means that the data is active and the reading frequency is appropriately increased; if the mark does not change for a long time, the reading frequency is reduced to save resources.
[0023] Preferably, when a flag change is detected in the S3 tag value detection, the software system reads all data sharing the flag address, and compares them with previously saved values to determine which addresses have changed data.
[0024] Preferably, the S3 tag value detection adds a data verification mechanism during the data transmission process, including the use of a cyclic redundancy check algorithm. The automation equipment calculates and stores the verification value when updating the data. The software system recalculates the verification value after reading the data and compares it with the stored verification value. If there is inconsistency, the data is read again.
[0025] Preferably, in the S4 data update, the automation program updates the flag bits of the address in the two groups at the same time after updating the tag value in S2. After the software system reads the two groups of flags, it calculates the changed data address through the mapping relationship.
[0026] The present invention provides an automated communication optimization method, which has the following beneficial effects:
[0027] 1. The present invention establishes a data marking process, and can realize the perception of automation equipment data changes at the 10 millisecond level by reading only a small amount of automation equipment addresses. Compared with reading a large amount of address data one by one, the timeliness of data perception is greatly improved. In addition, the software system does not need to frequently read a large amount of address data, which reduces the occupation of system resources and improves the overall system performance.
[0028] 2. The present invention establishes a data priority algorithm that can effectively identify and prioritize key data, significantly improve data processing efficiency, and ensure rapid response to high-priority information. At the same time, this algorithm optimizes resource allocation, reduces the processing time of low-priority data, and further optimizes the overall response speed and data processing capabilities of the system.
[0029] 3. The present invention establishes an adaptive reading frequency adjustment algorithm, which can dynamically adjust the reading frequency according to real-time data changes, avoiding the waste of resources caused by fixed-frequency reading. In periods of high data changes, the reading frequency is increased to ensure the real-time and accuracy of the data; in periods of low data changes, the reading frequency is reduced, effectively saving system resources and further improving the operating efficiency and stability of the system.
[0030] 4. In the present invention, the S1 newly added data marking area flag is represented by a bit, 1 indicates that the data has changed, and each byte represents 8 flags. In addition, for address areas that change frequently, the number of addresses of shared flags is reduced, and for areas that change infrequently, the number of shared addresses is increased. This design not only improves the flexibility of data processing, but also further optimizes the utilization of storage space, making the entire communication process more efficient and energy-saving. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a flow chart of the automated communication optimization method;
[0032] Figure 2 It is a schematic diagram of the priority calculation program of the present invention;
[0033] Figure 3 Schematic diagram of the adaptive reading frequency adjustment algorithm of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.
[0035] Example:
[0036] Please see attached Figure 1 - Attachment Figure 3 The embodiment of the present invention provides an automated communication optimization method, comprising the following steps:
[0037] S1: Added data marking area
[0038] In automation equipment, in addition to the area used to exchange data, a new storage area is added to mark the status of data changes;
[0039] S2: Update tag value
[0040] The automation program modifies the value of the flag in the storage area when updating the data;
[0041] S3: Tag value detection
[0042] The software system checks the value of the flag at a high frequency;
[0043] S4: Data Update
[0044] When the software system reads that the value of the flag has changed, it accesses the corresponding address on the automation device to obtain the changed data;
[0045] S5: Mark bit reset
[0046] The software system resets the flag bit after reading the corresponding changed data.
[0047] The flags in the S1 newly added data marking area are represented by bits, 1 indicates that the data has changed, and each byte represents 8 flags. In addition, for address areas that change frequently, the number of addresses with shared flags is reduced, and for areas that change infrequently, the number of shared addresses is increased.
[0048] In the S1 newly added data marking area, the number of addresses of the automation equipment is set to n, and on average every k addresses share a mark. The space occupied by the mark is m = n / k / 8 bytes. The software system reads these m bytes of data once in each cycle and parses out the mark bit with a value of 1.
[0049] When S2 updates the tag value, it runs the priority calculation program synchronously, and sets priorities for the address marks of automation equipment of different types or regions according to the calculation results of the priority calculation program. When the software system detects changes in multiple marks, it reads the data corresponding to the high-priority mark first. In the process, the following algorithm is proposed for the priority data:
[0050] Assume that there are m factors that affect the priority of the address mark of the automation device, which are denoted as F1, F2, ..., F m , the weights of each factor are W1, W2, …, W m ,and For each automation device address, according to its performance in each factor, the corresponding score S1, S2, ..., S m . Calculate the priority score P of the address mark by weighted summation;
[0051] Algorithm formula:
[0052]
[0053] It is assumed that there are three main factors that affect the priority of the address mark of the automation device: data type, importance of device function, and frequency of data update;
[0054] 1. Data type: divided into key data (such as safety-related data), important data (such as production parameter data), and ordinary data, with corresponding scores of S1=10, S1=7, S1=4, and weight W1=0.4;
[0055] 2. Importance of equipment functions: divided into core function equipment, important auxiliary equipment, and general equipment, with corresponding scores of S2=10, S2=6, and S2=2, and weight W2=0.3;
[0056] 3. Data update frequency: divided into high-frequency update (updated multiple times a day), medium-frequency update (updated once a day), and low-frequency update (updated once a week). The corresponding scores are S3=8, S3=5, S3=2, and the weight is W3=0.3;
[0057] Assume that there is an automation device address, whose data type is important data (S1=7), device function is important auxiliary device (S2=6), and data update frequency is medium frequency update (S3=5).
[0058] According to the weighted calculation formula, we can get:
[0059] P=S1×W1+S2×W2+S3×W3
[0060] =7×0.4+6×0.3+5×0.3
[0061] =2.8+1.8+1.5
[0062] =6.1
[0063] Through this weighted calculation, the priority score of the address mark of the automation equipment is 6.1. In practical applications, different address marks can be sorted according to the priority scores. When the software system detects changes in multiple marks, the corresponding data is read in descending order of priority scores.
[0064] For the relevant data in the S2 update tag value, multiple automation device addresses share the same flag. The software system saves the previous value of each address in advance. When the automation program changes the data of one or more addresses sharing the same flag, the corresponding flag is updated.
[0065] When the number of automation device addresses in the S2 update tag value is large and there are few data changes at the same time, a multi-dimensional flag setting method is adopted. Taking two dimensions as an example, there are n=k*k addresses, and two groups of flags are configured on the automation device, each group has k flag bits. The software system and the automation program agree on a hash algorithm to map each address to a flag bit in the two groups of flags, and ensure that two different addresses will not have the same flag bits in the two groups.
[0066] The S3 tag value detection is adaptively adjusted according to the activity of the automation equipment data. When the tag changes frequently within a period of time, it means that the data is active and the reading frequency is appropriately increased; if the tag does not change for a long time, the reading frequency is reduced to save resources. Based on this, this technical solution proposes the following algorithm:
[0067] Time window T: The time period used to count the number of flag changes. During this time period, the software system will record the number of changes in the data flags of the automation equipment to measure the activity of the data. The length of the time window T can be adjusted according to the actual application scenario. For example, in an industrial production scenario, for devices with frequent data changes, the time window may be set to a shorter time, such as 10 seconds; and for devices with relatively slow data changes, the time window can be set to 1 minute or longer;
[0068] Flag change count n: The cumulative number of times the automation device data flag changes within the time window T. Each time the flag value changes from one state to another (for example, from 0 to 1), the flag change count increases by 1;
[0069] High threshold H: A preset empirical value used to determine whether the data activity is too high. When the number of flag changes n is greater than H, it indicates that the data changes frequently within the time window T and the data is active. The setting of the high threshold H needs to be combined with the specific application scenario and equipment characteristics. For example, in an automated production line with high real-time requirements, if the equipment data changes frequently, the high threshold H may be set to 50 times (within a 10-second time window);
[0070] Low threshold L: It is also a preset empirical value used to determine whether the data activity is too low. When the number of flag changes n is less than L, it means that the data changes very little within the time window T, and the data activity is low. The value of the low threshold L also depends on the actual situation. For example, in some scenarios where the data of some monitoring equipment is relatively stable, the low threshold L may be set to 5 times (within a 1-minute time window);
[0071] Current reading frequency f current :The time interval at which the software system currently checks the data flag of the automation equipment. It indicates how often the software system reads the value of the flag to determine whether the data has changed. For example, the current reading frequency is 20 milliseconds, which means that the software system checks the flag every 20 milliseconds;
[0072] Adjusted reading frequency f new :According to the comparison result of the number of flag changes n and the high threshold H and low threshold L, the current reading frequency f current The new reading frequency obtained after adjustment;
[0073] Frequency increase coefficient r1: When the number of flag changes n is greater than the high threshold H, the coefficient used to increase the current reading frequency, and r1>1. This coefficient determines the magnitude of the increase in the reading frequency, for example, r1=1.5 means that the current reading frequency is increased to 1.5 times the original;
[0074] Frequency reduction coefficient r2: when the number of flag changes n is less than the lower threshold L, the coefficient used to reduce the current reading frequency, and r2>1, for example, r2=2, which means reducing the current reading frequency to half of the original;
[0075] Algorithm steps:
[0076] 1. Initialization:
[0077] Set the initial value of the time window T, for example, T = 30 seconds;
[0078] Set the values of the high threshold H and the low threshold L, assuming H = 30 times and L = 5 times;
[0079] Determine the current reading frequency f current The initial value of f current= 40 milliseconds;
[0080] Set the frequency increase coefficient r1 = 1.5 and the frequency decrease coefficient r2 = 2;
[0081] 2. Count the number of flag changes:
[0082] At the start of the time window T, initialize the number of flag changes n to 0;
[0083] Whenever the software system detects a change in the automation device data flag, increment the value of n by 1;
[0084] 3. Judgment and adjustment:
[0085] When the time window T ends, compare the number of flag changes n with the high threshold H and the low threshold L;
[0086] If n > H, it indicates high data activity. Calculate the adjusted reading frequency according to the formula f new = f current × r1. For example, if f current = 40 milliseconds and r1 = 1.25, then f new = 40 × 1.25 = 50 milliseconds. This means that in the next time window, the software system will check the flag at intervals of 50 milliseconds;
[0087] If n < L, it indicates low data activity. Calculate the new reading frequency according to the formula f new = f current ÷ r2. For example, if f current = 40 milliseconds and r2 = 2, then f new = 40 ÷ 2 = 20 milliseconds. That is, in the next time window, the software system will check the flag at intervals of 20 milliseconds;
[0088] If L ≤ n ≤ H, it indicates that the data activity is within the normal range. Keep the current reading frequency unchanged, i.e., f new = f current ;
[0089] 4. Apply the new reading frequency:
[0090] Set the adjusted reading frequency f new as the frequency for the software system to check the flag in the next time window;
[0091] Enter the next time window and repeat steps 2 and 3, continuously adjusting the reading frequency dynamically according to the data activity;
[0092] Example
[0093] Suppose we have an automated monitoring system for monitoring the operating status of factory equipment, and the time window T is set to 1 minute.
[0094] 1. Initial state:
[0095] High threshold H = 20 times, low threshold L = 5 times;
[0096] Current reading frequency f current = 30 milliseconds;
[0097] Frequency increase coefficient r1 = 1.5, frequency decrease coefficient r2 = 1.5;
[0098] The first time window:
[0099] Within this 1 minute, the software system detected that the number of flag changes n = 30 times;
[0100] Because n > H (30 > 20), according to the formula f new = f current × r1, calculate to get f new = 30 × 1.5 = 45 milliseconds. So in the next 1 minute time window, the software system will check the flag at a frequency of 45 milliseconds;
[0101] The second time window:
[0102] Within this 1 minute, the number of flag changes n = 3 times;
[0103] Since n < L (3 < 5), according to the formula At this time f current = 45 milliseconds, calculate to get f new = 45 ÷ 1.5 = 30 milliseconds;
[0104] Then in the next 1 minute time window, the software system will resume the reading frequency of 30 milliseconds;
[0105] The third time window:
[0106] Within this 1 minute, the number of flag changes n = 10 times;
[0107] Because L ≤ n ≤ H (5 ≤ 10 ≤ 20), so the reading frequency remains unchanged, f new = f current = 30 milliseconds;
[0108] In the next 1 minute time window, the software system will still check the flag at a frequency of 30 milliseconds;
[0109] Through the adaptive adjustment mechanism established above, the software system can dynamically optimize the frequency of reading marks according to the actual activity of the automation equipment data, effectively saving system resources while ensuring timely acquisition of data changes.
[0110] When a flag change is detected in the S3 tag value detection, the software system reads all data sharing the flag address, and compares them with previously saved values to determine which addresses have changed data.
[0111] The S3 tag value detection adds a data verification mechanism during the data transmission process, including the use of a cyclic redundancy check algorithm. The automation equipment calculates and stores the verification value when updating the data. The software system recalculates the verification value after reading the data and compares it with the stored verification value. If there is inconsistency, the data is read again.
[0112] In the S4 data update, the automation program updates the flag bits of the address in the two groups at the same time after updating the tag value in S2. After the software system reads the two groups of flags, it calculates the changed data address through the mapping relationship.
[0113] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. An automated communication optimization method, characterized in that: The following steps are involved: S1: Added data marking area In automation equipment, in addition to the area used to exchange data, a new storage area is added to mark the status of data changes; S2: Update tag value The automation program modifies the value of the flag in the storage area when updating the data; S3: Tag value detection The software system checks the value of the flag at a high frequency; S4: Data Update When the software system reads that the value of the flag has changed, it accesses the corresponding address on the automation device to obtain the changed data; S5: Mark bit reset The software system resets the flag bit after reading the corresponding changed data.
2. The automated communication optimization method according to claim 1, characterized in that: The flags in the S1 newly added data marking area are represented by bits, 1 indicates that the data has changed, and each byte represents 8 flags. In addition, for address areas that change frequently, the number of addresses with shared flags is reduced, and for areas that change infrequently, the number of shared addresses is increased.
3. The automated communication optimization method according to claim 1, characterized in that: In the S1 newly added data marking area, the number of addresses of the automation equipment is set to n, and on average every k addresses share a mark. The space occupied by the mark is m = n / k / 8 bytes. The software system reads these m bytes of data once in each cycle and parses out the mark bit with a value of 1.
4. The automated communication optimization method according to claim 1, characterized in that: When S2 updates the tag value, it runs the priority calculation program synchronously, and sets priorities for the address marks of automation equipment of different types or regions according to the calculation results of the priority calculation program. When the software system detects changes in multiple marks, it reads the data corresponding to the high priority mark first.
5. The automated communication optimization method according to claim 1, characterized in that: For the relevant data in the S2 update tag value, multiple automation device addresses share the same flag. The software system saves the previous value of each address in advance. When the automation program changes the data of one or more addresses sharing the same flag, the corresponding flag is updated.
6. The method for automatic communication optimization according to claim 1, characterized in that: When the number of automation device addresses in the S2 update tag value is large and there are few data changes at the same time, a multi-dimensional flag setting method is adopted. Taking two dimensions as an example, there are n=k*k addresses, and two groups of flags are configured on the automation device, each group has k flag bits. The software system and the automation program agree on a hash algorithm to map each address to a flag bit in the two groups of flags, and ensure that two different addresses will not have the same flag bits in the two groups.
7. The automated communication optimization method according to claim 1, characterized in that: The S3 tag value detection is adaptively adjusted according to the activity of the automation equipment data. When the tag changes frequently within a period of time, it means that the data is active and the reading frequency is appropriately increased; if the tag does not change for a long time, the reading frequency is reduced to save resources.
8. The method for automatic communication optimization according to claim 1, characterized in that: When a flag change is detected in the S3 tag value detection, the software system reads all data sharing the flag address, and compares them with previously saved values to determine which addresses have changed data.
9. The method for automatic communication optimization according to claim 1, characterized in that: The S3 tag value detection adds a data verification mechanism during the data transmission process, including the use of a cyclic redundancy check algorithm. The automation equipment calculates and stores the verification value when updating the data. The software system recalculates the verification value after reading the data and compares it with the stored verification value. If there is inconsistency, the data is read again.
10. An automated communication optimization method according to claim 6, characterized in that: In the S4 data update, the automation program updates the flag bits of the address in the two groups at the same time after updating the tag value in S2. After the software system reads the two groups of flags, it calculates the changed data address through the mapping relationship.
Citation Information
Cited By
Parameter synchronization method and system
CN122019046A
Parameter synchronization method and system
CN122019046B