Search

CN-122019046-A - Parameter synchronization method and system

CN122019046ACN 122019046 ACN122019046 ACN 122019046ACN-122019046-A

Abstract

The application discloses a parameter synchronization method and system, wherein the method comprises the steps that a touch screen responds to parameter changing operation of current changing parameters to determine changing parameter values corresponding to the current changing parameters, the touch screen modifies notification zone bits corresponding to the current changing parameters in a preset cache address interval, the changing parameter values are stored in the preset cache address interval, notification zone bits of different parameters are stored in the preset cache address interval, a controller traverses the notification zone bits of each parameter from the preset cache address interval to determine the current changing parameters and obtain corresponding changing parameter values, and the controller updates display values corresponding to the current changing parameters on the touch screen based on the changing parameter values and restores the notification zone bits corresponding to the current changing parameters. According to the application, the modified parameter is directly indicated by the notification flag bit, so that the controller can accurately position the changed parameter without executing the comparison of the parameter values, and the processing delay caused by item-by-item value comparison is eliminated.

Inventors

  • YU XIANYAO
  • CHEN HAO

Assignees

  • 深圳市易优电气有限公司

Dates

Publication Date
20260512
Application Date
20260414

Claims (10)

  1. 1. The parameter synchronization method is characterized by being applied to a parameter synchronization system, wherein the parameter synchronization system comprises a controller and a touch screen, the touch screen is provided with a preset cache address interval, and the method comprises the following steps: The touch screen responds to parameter changing operation of current changing parameters, and changing parameter values corresponding to the current changing parameters are determined; The touch screen modifies notification flag bits corresponding to the current change parameters in the preset cache address interval, and stores the change parameter values into the preset cache address interval, wherein notification flag bits of different parameters are stored in the preset cache address interval; The controller traverses notification flag bits of each parameter from the preset cache address interval to determine the current change parameter and obtain the corresponding change parameter value; and the controller updates the display value corresponding to the current change parameter on the touch screen based on the change parameter value, and restores the notification zone bit corresponding to the current change parameter.
  2. 2. The method of claim 1, wherein the predetermined buffer address interval includes a first address interval and a second address interval, the first address interval includes notification flag bits corresponding to the parameters arranged according to a predetermined arrangement sequence, each notification flag bit occupies one bit address, and the second address interval includes parameter write addresses corresponding to the parameters arranged according to the predetermined arrangement sequence, each write address occupies a memory cell of a predetermined length.
  3. 3. The method as claimed in claim 2, wherein the step of modifying, by the touch screen, a notification flag bit corresponding to the current change parameter in the preset buffer address interval, and storing the change parameter value in the preset buffer address interval includes: the touch screen judges whether the current change parameter is a bit variable parameter or not; when the current change parameter is not a bit variable parameter, the touch screen modifies a notification flag bit corresponding to the current change parameter in the first address interval to set a binary code at the notification flag bit to be 1; and the touch screen determines a current parameter writing address corresponding to the current change parameter in the second address interval, and fills the change parameter value into the current parameter writing address.
  4. 4. The method of claim 2, wherein before the step of traversing notification flags for each of the parameters from the preset cache address interval to determine the current change parameter and obtaining the corresponding change parameter value, the controller comprises: The controller constructs a read request message based on a preset time interval, wherein a target address interval of the read request message covers the first address interval and the second address interval; The controller sends the reading request message to the touch screen and receives a response message returned by the touch screen, wherein the response message comprises all data in the first address interval and the second address interval; correspondingly, the step of traversing the notification flag bits of each parameter from the preset cache address interval by the controller to determine the current change parameter and obtain the corresponding change parameter value includes: and the controller traverses notification flag bits of each parameter from the preset cache address interval based on the response message to determine the current change parameter and acquire the corresponding change parameter value.
  5. 5. The method of claim 4, wherein the step of the controller traversing notification flag bits of each of the parameters from the preset cache address interval based on the response message to determine the current change parameter and obtain the corresponding change parameter value comprises: The controller traverses notification flag bits of the parameters from the first address interval, and determines parameters with binary codes of 1 at the corresponding notification flag bits as the current change parameters; And the controller determines a current parameter write address corresponding to the current change parameter from the second address interval so as to read the change parameter value in the current parameter write address.
  6. 6. The method of claim 2, wherein the step of the controller updating the display value corresponding to the current change parameter on the touch screen based on the change parameter value and restoring the notification flag corresponding to the current change parameter comprises: the controller determines a current parameter reading address corresponding to the current changing parameter in the touch screen, and fills the changing parameter value into the current parameter reading address so as to update a display value corresponding to the current changing parameter on the touch screen; And the controller restores the notification zone bit corresponding to the current change parameter in the first address interval to restore the binary code at the notification zone bit to 0.
  7. 7. The method of claim 3, wherein after the step of determining whether the current modification parameter is a bit variable parameter by the touch screen, further comprising: when the current changing parameter is a bit variable parameter, the touch screen determines a current parameter writing address corresponding to the current changing parameter in the preset cache address interval; The touch screen updates the parameter value at the current parameter writing address, and determines the updated parameter value as the changed parameter value; when the current change parameter is a bit variable parameter, the parameter value at the current parameter write address corresponding to the bit variable parameter is 0 or 1 set by binary coding.
  8. 8. The parameter synchronization system is characterized by comprising a controller and a touch screen, wherein the touch screen is provided with a preset cache address interval; The touch screen is used for responding to the parameter changing operation of the current changing parameter and determining a changing parameter value corresponding to the current changing parameter; The touch screen is further used for modifying notification flag bits corresponding to the current change parameters in the preset cache address interval, storing the change parameter values in the preset cache address interval, and storing notification flag bits with different parameters in the preset cache address interval; The controller is used for traversing notification flag bits of each parameter from the preset cache address interval to determine the current change parameter and obtaining the corresponding change parameter value; the controller is further configured to update a display value corresponding to the current change parameter on the touch screen based on the change parameter value, and restore a notification flag bit corresponding to the current change parameter.
  9. 9. The system of claim 8, wherein the predetermined buffer address interval includes a first address interval and a second address interval, the first address interval includes notification flag bits corresponding to the parameters arranged according to a predetermined arrangement sequence, each notification flag bit occupies one bit address, and the second address interval includes parameter write addresses corresponding to the parameters arranged according to the predetermined arrangement sequence, each write address occupies a memory cell of a predetermined length.
  10. 10. The system of claim 9, wherein the touch screen is further configured to determine whether the current modification parameter is a bit variant parameter; the touch screen is further configured to modify a notification flag bit corresponding to the current change parameter in the first address interval when the current change parameter is not a bit variable parameter, so as to set a binary code at the notification flag bit to 1; The touch screen is further configured to determine a current parameter write address corresponding to the current change parameter in the second address interval, and fill the change parameter value into the current parameter write address.

Description

Parameter synchronization method and system Technical Field The present application relates to the field of communications technologies, and in particular, to a parameter synchronization method and system. Background In the field of industrial automation control, an RS485 bus is often adopted between a controller and a human-computer interaction interface (such as a touch screen) for data communication. In a typical communication architecture, a touch screen is usually used as a communication host, a controller is used as a slave, and a control command or parameter setting data is actively issued to the controller by the touch screen. When the controller needs to mount and communicate with a plurality of external devices (such as sensors, actuators or other controllers) on the same RS485 bus, the limitation of the above architecture is revealed, if the touch screen is still used as a host, it can continuously occupy the bus master control right, so that other devices cannot effectively communicate with the controller. Therefore, in this application scenario, the touch screen needs to be set as a slave, and the controller is used as a host to uniformly manage bus communication. However, when the touch screen is used as a slave, if an operator modifies parameters on the touch screen, the controller needs to actively read the parameters on the touch screen and compare the parameters with the previously recorded parameters one by one to judge whether the parameters are modified, and then send display values of the parameters to the touch screen for display. The above process of judging whether the parameters are modified may generate additional processing delay, thereby resulting in poor timeliness of the touch screen parameter response and further affecting the user operation experience. Disclosure of Invention The application mainly aims to provide a parameter synchronization method and system, and aims to solve the technical problem that a controller is difficult to quickly discover that parameters are modified under the condition that a touch screen is used as a slave, so that the response of the parameters of the touch screen is not timely. In order to achieve the above object, the present application provides a parameter synchronization method, which is applied to a parameter synchronization system, wherein the parameter synchronization system includes a controller and a touch screen, the touch screen is provided with a preset cache address interval, and the method includes: The touch screen responds to parameter changing operation of current changing parameters, and changing parameter values corresponding to the current changing parameters are determined; The touch screen modifies notification flag bits corresponding to the current change parameters in the preset cache address interval, and stores the change parameter values into the preset cache address interval, wherein notification flag bits of different parameters are stored in the preset cache address interval; The controller traverses notification flag bits of each parameter from the preset cache address interval to determine the current change parameter and obtain the corresponding change parameter value; and the controller updates the display value corresponding to the current change parameter on the touch screen based on the change parameter value, and restores the notification zone bit corresponding to the current change parameter. In an embodiment, the preset buffer address interval includes a first address interval and a second address interval, the first address interval includes notification flag bits corresponding to the parameters arranged according to a preset arrangement sequence, each notification flag bit occupies one bit address, and the second address interval includes parameter write addresses corresponding to the parameters arranged according to the preset arrangement sequence, and each write address occupies a storage unit with a preset length. In an embodiment, the step of modifying, by the touch screen, a notification flag bit corresponding to the current change parameter in the preset cache address interval, and storing the change parameter value in the preset cache address interval includes: the touch screen judges whether the current change parameter is a bit variable parameter or not; when the current change parameter is not a bit variable parameter, the touch screen modifies a notification flag bit corresponding to the current change parameter in the first address interval to set a binary code at the notification flag bit to be 1; and the touch screen determines a current parameter writing address corresponding to the current change parameter in the second address interval, and fills the change parameter value into the current parameter writing address. In one embodiment, before the step of traversing the notification flag bits of each parameter from the preset buffer address interval to determine the current change parame