A software upgrading method and device for an LCD screen of a box transformer control device
Remote software upgrades are achieved through network connections between the measurement and control device and the target LCD screen and web page, solving the low efficiency problem of the traditional serial port upgrade mode, improving operation and maintenance efficiency and safety, and adapting to equipment management in complex environments.
Patent Information
- Application Number
- CN202510554312.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-04-29
AI Technical Summary
The traditional serial port upgrade mode has low efficiency in upgrading the LCD screen software of the box-type transformer measurement and control device in complex environments, resulting in increased manpower and time costs and inability to achieve effective remote management.
Remote software upgrades are achieved through network connections between the measurement and control device and the target LCD screen and target web page. Active mode switching, data packet segmentation, sequence number matching and verification mechanisms are adopted to ensure the accuracy and integrity of data transmission, and the baud rate is dynamically adjusted to adapt to different environments.
It significantly reduces manpower and time costs, improves the operation and maintenance efficiency of upgrade tasks, ensures the security and reliability of the upgrade process, and adapts to device management needs in complex environments.
Smart Images

Figure CN120276758B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of software upgrading of LCD screens of box transformer measurement and control devices in power systems, in particular to a software upgrading method and device for LCD screens of box transformer measurement and control devices. BACKGROUND
[0002] In the field of power system, especially wind farm operation and management, as one of the core devices, the function reliability and operation and maintenance efficiency of the box transformer measurement and control device directly relate to the safe and stable operation of the power system. As the core interface of human-computer interaction, the LCD display screen undertakes the key tasks of equipment operation state monitoring, parameter configuration and alarm information display, and is an important window for operation and maintenance personnel to master the health status of the equipment.
[0003] At present, the LCD software upgrading of the box transformer measurement and control device mainly depends on the traditional serial port upgrading mode. The mode is based on a physical layer serial communication protocol and needs to establish a point-to-point connection through a special host computer device and a customized cable. The specific operation process is as follows: the operation and maintenance personnel need to carry the host computer to the site, complete the device connection through the physical interface, and perform software package transmission, verification and burning operation based on the serial communication protocol. In the actual large-scale wind farm environment, the number of wind farm box transformer measurement and control devices is large, and they are widely distributed in complex environments such as remote mountainous areas, high-altitude areas or offshore platforms. The traditional serial port upgrading mode requires the operation and maintenance personnel to operate on site one by one, which significantly increases the labor cost and time cost, and leads to a low maintenance efficiency of the upgrading task.
[0004] Therefore, there is an urgent need for a software upgrading method and device for LCD screens of box transformer measurement and control devices which can solve the above technical problems. SUMMARY
[0005] The application provides a software upgrading method and device for LCD screens of box transformer measurement and control devices. The method can realize remote upgrading, significantly reduce the labor and time cost, and adapt to the equipment management needs in complex environments, effectively solving the problem of low efficiency of the traditional serial port upgrading mode in complex scenes.
[0006] The first aspect of the application provides a software upgrading method for an LCD screen of a box transformer control device, which is applied to the control device, the control device is connected with a target LCD screen through a serial port, and the control device is connected with a target webpage through a network. The method comprises the following steps: receiving target information sent by the target LCD screen, switching the control device to an active mode according to the target information, and sending upgrading approval information to the target webpage; receiving a target sub-packet, the target sub-packet being any one sub-packet, the target sub-packet being a sub-packet sent by the control device according to the upgrading approval information, the target sub-packet comprising an LCD device address, a function code, a register start address, a data byte number, a data packet serial number and a byte executable file text; analyzing the target sub-packet to obtain a target serial number; judging whether the target serial number is consistent with a preset comparison serial number, the preset comparison serial number being a serial number corresponding to a total number of times of analyzing the target sub-packet by the control device within a preset time; when the target serial number is consistent with the preset comparison serial number, sending the target sub-packet to the target LCD screen, so that the target LCD screen writes the target sub-packet into an internal memory; until an end packet sent by the target webpage is received, obtaining a first check value from the end packet; judging whether the first check value is equal to a second check value, the second check value being a byte check value obtained by the target LCD screen by calculating all the target sub-packets received; when the first check value is equal to the second check value, determining that the target LCD screen is in an upgrading success state, so as to display the upgrading success state to the target webpage.
[0007] By adopting the above technical scheme, the control device is automatically switched to the active mode by receiving the target information sent by the target LCD screen, and sends the upgrading approval information to the target webpage. The target sub-packet is determined according to the upgrading approval information, the upgrading file is split into multiple sub-packets, the risk of single transmission failure is reduced, the target serial number is matched with the preset comparison serial number, the sub-packet is ensured to be received in sequence, data loss or out-of-order caused by network fluctuation is avoided, the first check value is obtained from the end packet sent by the target webpage, the byte check value of all the sub-packets calculated by the target LCD screen, i.e. the second check value, is obtained, the first check value is compared with the second check value, the accuracy of the written data can be determined, when the first check value is consistent with the second check value, it is confirmed that the target LCD screen is in the upgrading success state, the upgrading completion is fed back to the target webpage according to the upgrading success state, the operation and maintenance personnel do not need to go to the site for upgrading operation, the labor and time cost is significantly reduced, and the operation and maintenance efficiency of the upgrading task can be improved in a distributed scene such as a wind farm.
[0008] Optionally, the target information sent by the target LCD screen is received, specifically including: receiving a start upgrade request sent by a target web page; obtaining a target password from the start upgrade request, judging whether the target password is consistent with a preset password, the preset password being a password input by a target user; when the target password is consistent with the preset password, obtaining a target file start address and a target byte number from the start upgrade request by the target LCD screen, the target byte number being a total byte number corresponding to a text of an executable file in an upgrade data packet, the upgrade data packet including a target sub-data packet; receiving an adaptation state sent by the target LCD screen, switching the target LCD screen to a passive mode according to the adaptation state, and outputting the adaptation state as the target information, the adaptation state being a state determined when the target file start address is consistent with a preset file start address and the target byte number is less than or equal to a preset byte threshold, the preset file start address and the preset byte threshold being parameters under which the target LCD screen can normally operate.
[0009] By adopting the above technical solution, the consistency of the target password and the preset password is verified first, so that only authorized users can click the upgrade request, unauthorized access and operation are prevented, and the security of the system is improved; in the upgrade process, the consistency of the target file start address and the preset file start address is verified, and whether the target byte number is less than or equal to the preset byte threshold is verified, so that the upgrade data packet is ensured to match the operating parameters of the target LCD screen, upgrade failure or device damage caused by parameter mismatch is avoided, after the target LCD screen is successfully adapted, the target LCD screen is switched to the passive mode, and the upgrade process is ensured to proceed smoothly, so that the measurement and control device is switched to the active mode according to the adaptation state.
[0010] Optionally, after receiving the adaptation state sent by the target LCD screen, the method further includes: determining an upgrade baud rate according to the adaptation state; and sending the upgrade baud rate to the target LCD screen, so that the target LCD screen adjusts according to the upgrade baud rate, so that the target LCD screen and the measurement and control device perform data transmission at the upgrade baud rate.
[0011] By adopting the above technical solution, the upgrade baud rate is dynamically adjusted according to the adaptation state, so that the data transmission rate between the target LCD screen and the measurement and control device is matched, transmission errors or delays caused by baud rate mismatch are avoided, the data transmission rate is maximized by selecting a suitable baud rate, the transmission time is reduced, the overall system efficiency is improved, the baud rate is optimized, the upgrade time is shortened, the user waiting time is reduced, and the user experience is improved.
[0012] Optionally, in order for the target LCD screen to write the target sub-packet into the internal memory, the method comprises: obtaining a target address from the target LCD screen, the target address being an address of a start address of the target file in the internal memory, the internal memory being a storage unit corresponding to the target LCD screen; obtaining a byte executable file body from the target sub-packet, and sending the executable file body to the target LCD screen, so that the target LCD screen writes the executable file body into the target address.
[0013] By using the above technical solution, the target address obtained from the target LCD screen is the actual address of the start address of the target file in the internal memory, ensuring that the upgrade data (the executable file body) is written into the correct storage location, avoiding data overwrite or system abnormality caused by address errors. By directly extracting the executable file body from the target sub-packet and accurately writing it into the target address, the integrity and consistency of the upgrade data are ensured, and the upgrade failure caused by data transmission or storage errors is reduced. Automatic acquisition of the target address and completion of data writing reduce the step of manual address configuration and reduce the upgrade risk caused by human errors.
[0014] Optionally, after obtaining the byte executable file body from the target sub-packet and sending the executable file body to the target LCD screen, so that the target LCD screen writes the executable file body into the target address, the method further comprises: reading a first character from the internal memory; converting the byte executable file body into a second character; determining whether the first character and the second character are consistent; when the first character and the second character are consistent, determining that the internal memory is in a normal writing state, and sending normal writing information of the target web page; when the first character and the second character are inconsistent, determining that the internal memory is in an abnormal writing state, and triggering a stop upgrade operation according to the abnormal writing state.
[0015] By using the above technical solution, after writing the executable file body into the internal memory, the first character is read immediately and compared with the converted second character, ensuring the accuracy of the data writing process. By character comparison, data damage caused by memory failure, electromagnetic interference or writing errors can be found in time, avoiding system crash caused by data errors. When the first character and the second character are detected to be inconsistent, a stop upgrade operation is triggered immediately to prevent abnormal data from continuing to be written, avoiding the system from entering an unrecoverable state due to error data. By real-time verification of the writing state, the user can avoid upgrade failure caused by writing errors, reducing repeated operations and waiting time.
[0016] Optionally, before receiving the target information sent by the target LCD screen, the method further comprises: receiving a first version number sent by the target webpage; determining whether the first version number is consistent with a second version number, the second version number being a version number corresponding to a current software program of the target LCD screen; and when the first version number is inconsistent with the second version number, determining that the target LCD screen is in a to-be-upgraded state, and determining a start-upgrading request sent by the target webpage according to the to-be-upgraded state.
[0017] By using the above technical solution, the first version number sent by the target webpage is received first, and is compared with the second version number corresponding to the current software program of the target LCD screen, so that it can be detected in real time whether the software versions are consistent. When the version numbers are consistent, the upgrading process can be skipped, unnecessary upgrading of the LCD screen with the latest version can be avoided, system resources are saved, and when the version numbers are inconsistent, it is determined that the target LCD screen is in the to-be-upgraded state, and the start-upgrading request is received, so that the upgrading operation is ensured to be only for the LCD screen device that needs to be updated.
[0018] Optionally, after determining whether the first check value and the second check value are equal, the method further comprises: when the first check value and the second check value are not equal, determining that the target LCD screen is in an upgrading-failed state, so as to re-perform the upgrading operation according to the upgrading-failed state.
[0019] By using the above technical solution, after the upgrading is completed, the first check value and the second check value are compared, it can be immediately determined whether the upgrading is successful, when the first check value and the second check value are inconsistent, the upgrading failure can be immediately identified, and the re-upgrading operation is triggered, so that the system is prevented from being in an abnormal state for a long time due to delayed discovery of errors, the check value comparison mechanism can detect tampering of the upgrading package caused by external attacks (such as data injection), and it is ensured that the upgrading data is not maliciously modified.
[0020] The second aspect of the application provides a software upgrading device for the LCD screen of a box transformer control device, which is used to execute the method described above. The device comprises a receiving unit, a processing unit and a display unit. The receiving unit receives target information sent by a target LCD screen, switches the control device to an active mode according to the target information, and sends upgrading approval information to a target webpage. The receiving unit also receives a target sub-packet, which is any one sub-packet. The target sub-packet is sent by the control device according to the upgrading approval information. The target sub-packet comprises an LCD device address, a function code, a register start address, a data byte number, a data packet serial number and a byte executable file text. The processing unit analyzes the target sub-packet and obtains a target serial number. The processing unit judges whether the target serial number is consistent with a preset comparison serial number. The preset comparison serial number is a serial number corresponding to the total number of times that the control device analyzes the target sub-packet within a preset time. When the target serial number is consistent with the preset comparison serial number, the processing unit sends the target sub-packet to the target LCD screen, so that the target LCD screen writes the target sub-packet into an internal memory. Until an end packet sent by the target webpage is received, a first check value is obtained from the end packet. The processing unit judges whether the first check value is equal to a second check value. The second check value is a byte check value obtained by the target LCD screen by calculating all the target sub-packets received. When the first check value is equal to the second check value, the display unit determines that the target LCD screen is in an upgrading success state, so as to display the upgrading success state to the target webpage.
[0021] Optionally, the receiving unit is configured to receive a start upgrading request sent by the target webpage. The receiving unit is configured to obtain a target password from the start upgrading request and judge whether the target password is consistent with a preset password. The preset password is a password input by a target user. When the target password is consistent with the preset password, the processing unit is configured to enable the target LCD screen to obtain a target file start address and a target byte number from the start upgrading request. The target byte number is a total byte number corresponding to the executable file text in the upgrading data packet. The upgrading data packet comprises the target sub-packet. The receiving unit is configured to receive an adaptation state sent by the target LCD screen, switch the target LCD screen to a passive mode according to the adaptation state, and output the adaptation state as the target information. The adaptation state refers to a state determined when the target file start address is consistent with a preset file start address and the target byte number is less than or equal to a preset byte threshold. The preset file start address and the preset byte threshold are parameters under which the target LCD screen can normally operate.
[0022] Optionally, the processing unit is configured to determine an upgrading baud rate according to the adaptation state. The processing unit is configured to send the upgrading baud rate to the target LCD screen, so that the target LCD screen adjusts according to the upgrading baud rate, so that the target LCD screen and the control device adopt the upgrading baud rate for data transmission.
[0023] Optionally, the receiving unit is configured to acquire a target address from the target LCD screen, the target address being an address of a target file start address in an internal memory, the internal memory being a storage unit corresponding to the target LCD screen; acquire the byte executable file body from the target sub-packet; and send the executable file body to the target LCD screen, so that the target LCD screen writes the executable file body into the target address.
[0024] Optionally, the receiving unit is configured to read a first character from the internal memory; the processing unit is configured to convert the byte executable file body into a second character; determine whether the first character is consistent with the second character; when the first character is consistent with the second character, determine that the internal memory is in a normal writing state, and send the target web page with normal writing information; and when the first character is not consistent with the second character, determine that the internal memory is in an abnormal writing state, and trigger a stop upgrading operation according to the abnormal writing state.
[0025] Optionally, the receiving unit is configured to receive a first version number sent by the target web page; the processing unit is configured to determine whether the first version number is consistent with a second version number, the second version number being a version number corresponding to a current software program of the target LCD screen; and when the first version number is not consistent with the second version number, determine that the target LCD screen is in a state of waiting for upgrading, and determine a start upgrading request sent by the target web page according to the state of waiting for upgrading.
[0026] Optionally, the processing unit is configured to, when the first check value is not equal to the second check value, determine that the target LCD screen is in a state of upgrading failure, so as to perform a re-upgrading operation according to the state of upgrading failure.
[0027] In a third aspect of the present application, an electronic device is provided, which includes a processor, a memory, a user interface and a network interface. The memory is configured to store instructions, the user interface and the network interface are configured to communicate with other devices, and the processor is configured to execute the instructions stored in the memory, so that the electronic device performs the method of any one of the above aspects of the present application.
[0028] In a fourth aspect of the present application, a computer readable storage medium is provided, which stores instructions. When the instructions are executed, the method of any one of the above aspects of the present application is performed.
[0029] In summary, the one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0030] 1、The control device automatically switches to active mode by receiving the target information sent by the target LCD screen, and sends upgrade approval information to the target webpage, determines the received target sub-packet according to the upgrade approval information, splits the upgrade file into multiple sub-packets to reduce the risk of single transmission failure, matches the target sequence number with the preset comparison sequence number to ensure that the sub-packets are received in order, avoids data loss or out-of-order caused by network fluctuations, and according to the first check value obtained from the end data packet sent by the target webpage, and the second check value obtained by the target LCD screen calculating the byte check value of all sub-packets, the first check value and the second check value are compared to determine the accuracy of the written data, when the first check value and the second check value are consistent, it is confirmed that the target LCD screen is in an upgrade success state, and according to the upgrade success state and feedback to the target webpage that the upgrade is complete, there is no need for maintenance personnel to go to the site for upgrade operation, which significantly reduces the labor and time cost, so as to improve the operation and maintenance efficiency of the upgrade task in the distributed scene such as wind power field.
[0031] 2、First verify the consistency of the target password and the preset password to ensure that only authorized users can click the upgrade request, prevent unauthorized access and operation, and improve the security of the system; during the upgrade process, verify the consistency of the target file starting address and the preset file starting address, and whether the target byte number is less than or equal to the preset byte threshold, to ensure that the upgrade data packet meets the operating parameters of the target LCD screen, avoid upgrade failure or equipment damage caused by parameter mismatch, and after the target LCD screen is successfully adapted, it is switched to passive mode to ensure the smooth progress of the upgrade process, so that the control device is switched to active mode according to the adaptation state. BRIEF DESCRIPTION OF DRAWINGS
[0032] Figure 1 is a first flowchart of a software upgrade method for a box transformer control device LCD screen provided by an embodiment of the present application;
[0033] Figure 2 is a second flowchart of a software upgrade method for a box transformer control device LCD screen provided by an embodiment of the present application;
[0034] Figure 3 is a structural diagram of a software upgrade device for a box transformer control device LCD screen provided by an embodiment of the present application;
[0035] Figure 4 is a structural diagram of an electronic device disclosed by an embodiment of the present application.
[0036] BRIEF DESCRIPTION OF DRAWINGS: 301, receiving unit; 302, processing unit; 303, display unit; 400, electronic device; 401, processor; 402, memory; 403, user interface; 404, network interface; 405, communication bus. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.
[0038] In the description of the embodiments of this application, words such as "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "for example" or "for instance" in the embodiments of this application should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "for example" or "for instance" is intended to present the relevant concepts in a concrete manner.
[0039] In the description of the embodiments of the present application, the term "multiple" means two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0040] In power systems, especially wind farm operations and management, box-type transformer measurement and control devices are core equipment. Their functional reliability and operational efficiency are directly related to the safe and stable operation of power systems. As the core interface for human-computer interaction, LCD displays are responsible for key tasks such as monitoring equipment operating status, parameter configuration, and displaying alarm information. They provide an important window for operators to understand the health of the equipment.
[0041] Currently, LCD software upgrades for box-type transformer measurement and control devices primarily rely on traditional serial port upgrades. This method, based on a physical layer serial communication protocol, requires a point-to-point connection via a dedicated host computer and customized cables. The specific operation process involves operators bringing a host computer to the site, connecting the devices via the physical interface, and then performing software package transfer, verification, and programming using the serial communication protocol. In the real world of large-scale wind farms, box-type transformer measurement and control devices are numerous and widely distributed in complex environments such as remote mountainous areas, high-altitude regions, and offshore platforms.
[0042] Furthermore, traditional serial port upgrades lack effective remote management. If a problem arises during the upgrade process, maintenance personnel are unable to obtain detailed fault information in a timely manner and are forced to conduct on-site inspections and debugging to troubleshoot the issue. This undoubtedly prolongs troubleshooting time, impacts the normal operation of the equipment, and poses potential risks to the stable operation of the power system. Because traditional serial port upgrades require on-site maintenance personnel to perform each device individually, this significantly increases labor and time costs, resulting in low maintenance efficiency for upgrade tasks.
[0043] Therefore, how to solve the problem of low efficiency of the traditional serial port upgrade mode in complex scenarios. The embodiment of the present application provides a software upgrade method for the LCD screen of the box-type transformer measurement and control device, which is applied to the measurement and control device, the measurement and control device and the target LCD screen are connected through a serial port, and the measurement and control device and the target web page are connected through a network. The target web page refers to the web page corresponding to the browser, and the browser is used to store the upgrade data packet of the current latest version of the LCD screen. The target web page uses an optical fiber network or a network cable to establish a data link with the measurement and control device. The target LCD screen refers to the interactive interface of the box-type transformer measurement and control device, and the target LCD screen is connected to the measurement and control device through a serial port. At this time, the measurement and control device refers to the main control device in the box-type transformer measurement and control device, so that the measurement and control device can be used to obtain the upgrade data packet from the target web page and forward the upgrade data packet to the target LCD screen, thereby realizing remote software upgrade of the LCD screen. Figure 1 This is a first flow chart of a method for upgrading the software of the LCD screen of a box-type transformer measurement and control device provided by the embodiment of the present application, with reference to Figure 1 The method includes the following steps S101-S108.
[0044] S101: receiving target information sent by a target LCD screen, switching the measurement and control device to an active mode according to the target information, and sending upgrade approval information to a target web page.
[0045] In S101, the measurement and control device needs to judge the current software program version information of the target LCD screen before receiving the target information sent by the target LCD screen. When the current software program version information of the target LCD screen is consistent with the software program version information stored in the target webpage, it is confirmed that the current software program of the target LCD screen is the latest version, and no upgrade operation is needed, so the subsequent monitoring of the version information of the target LCD screen continues. When the current software program version information of the target LCD screen is inconsistent with the software program version information stored in the target webpage, the upgrade operation is triggered, which specifically includes: receiving the first version number sent by the target webpage; judging whether the first version number is consistent with the second version number, the second version number being the version number corresponding to the current software program of the target LCD screen; when the first version number is inconsistent with the second version number, it is determined that the target LCD screen is in a to-be-upgraded state, and the start-upgrade request sent by the target webpage is received according to the to-be-upgraded state. Specifically, the target webpage obtains the latest upgrade data packet, analyzes the latest upgrade data packet to obtain the first version number, and then sends the first version number to the measurement and control device, so that the measurement and control device receives the first version number sent by the target webpage. Since the measurement and control device and the target webpage have established a communication connection in advance, the measurement and control device can receive the first version number sent by the target webpage. The version number is usually in string format. After receiving the first version number, the measurement and control device obtains the second version number from the target LCD screen, where the second version number refers to the version number of the currently running software of the target LCD screen, which is usually stored in the internal memory or EEPROM of the LCD screen. The target LCD screen can read the second version number from the version register and send the second version number to the measurement and control device. Then, the first version number and the second version number are compared in string format. According to the comparison result of the version number, it is judged whether the target LCD screen needs to be upgraded. If the first version number is inconsistent with the second version number, the target LCD screen is marked as to-be-upgraded, and in the to-be-upgraded state, the start-upgrade request sent by the target webpage is received, and the upgrade process is started. After determining that the target LCD screen is in the to-be-upgraded state, the user can initiate an upgrade request in the page of the general control room, and the user refers to the operator. According to the upgrade request sent by the user, the target webpage can send a start-upgrade request to the measurement and control device. As shown in FIG. Figure 2
[0046] Furthermore, the measurement and control device receives the starting upgrade request sent by the target webpage, obtains the target password from the starting upgrade request, judges whether the target password is consistent with the preset password, the preset password is the password input by the target user; when the target password is consistent with the preset password, the target LCD screen obtains the target file starting address and the target byte number from the starting upgrade request, the target byte number is the total byte number corresponding to the text of the executable file in the upgrade data packet, and the upgrade data packet includes the target sub-data packet; the adaptation state sent by the target LCD screen is received, the target LCD screen is switched to the passive mode according to the adaptation state, and the adaptation state is output as the target information, the adaptation state is a state determined when the target file starting address is consistent with the preset file starting address and the target byte number is less than or equal to the preset byte threshold, and the preset file starting address and the preset byte threshold are parameters for normal operation of the target LCD screen. Specifically, after the target webpage sends the starting upgrade request to the measurement and control device, the starting upgrade request includes the password byte number, the password, the executable file starting address and the executable file byte number. At this time, the password is used to verify the identity of the user, and at this time, the user refers to the operator who sends the upgrade request through the target webpage. Before the user issues the upgrade request through the target webpage, the identity of the user needs to be verified, and the user can verify whether the operator has the permission to send the upgrade request through the target webpage by inputting the verification password, and the verification password can be set as a fixed password. The executable file starting address is the starting address of the upgrade file in the latest upgrade data packet, indicating the writing position of the file in the LCD screen memory. The executable file byte number is the total byte number of the upgrade file, indicating the amount of data to be transmitted. After the measurement and control device receives the starting upgrade request sent by the target webpage through the network, the target password is extracted from the received starting upgrade request, at this time, the target password refers to the field corresponding to the password in the starting upgrade request. The verification password input by the target user, i.e. the preset password, is obtained in advance, and then the target password is compared with the preset password, the preset password is the verification password input by the user, which is used to verify whether the user has the permission to send the upgrade request. When the password is inconsistent with the preset password, it is determined that the user has no permission to send the upgrade request, i.e. the user has no permission to perform the upgrade operation, so the user verification error information is returned. When the target password is consistent with the preset password, it is determined that the user has the permission to perform the upgrade operation, so the starting upgrade request is further processed. For example, the target password extracted from the starting upgrade request is 123456, at this time, the preset password input by the user is obtained, when the preset password is 123456, the target password is compared with the preset password at this time, when the two are consistent, it is determined that the user identity verification is passed, and the starting upgrade request can be further verified. After the measurement and control device determines that the target password verification is passed, the target LCD screen can read the executable file information from the starting upgrade request through the serial port, at this time, the executable file information refers to the executable file starting address and the executable file byte number.The target LCD screen compares the target file start address with the preset file start address, and compares the target byte number with the preset byte threshold value. When the target file start address is inconsistent with the preset file start address, or the target byte number is greater than the preset byte threshold value, it is confirmed that the target LCD screen cannot run the data packet in the start upgrade request, that is, the upgrade data packet does not match the target LCD screen, and the target LCD screen needs to send the upgrade non-adaptation corresponding information to the measurement and control device, so as to continue to analyze the updated upgrade data packet in the target web page in the subsequent. The measurement and control device verifies the password in the start upgrade request sent by the target web page, and only when the password is the same, the subsequent operation can be performed, which enhances the security of software upgrade and prevents illegal upgrade operation.
[0047] Only when the target file start address is consistent with the preset file start address, and the target byte number is less than or equal to the preset byte threshold value, it is confirmed that the start upgrade request is in an adaptation state with the target LCD screen, and the adaptation state indicates that the current upgrade data packet is the update data packet required by the target LCD screen. After determining to perform software upgrade on the target LCD screen according to the adaptation state, the target LCD screen is switched to a passive mode according to the adaptation state, and the passive mode is a modbus server mode at this time. The server refers to the target LCD screen as a slave station, responding to the request of the master station and returning data. Before the software upgrade is performed on the target LCD screen, the target LCD screen corresponds to a modbus client mode. Since the software upgrade is to be performed on the target LCD screen, the target LCD screen is switched from the modbus client mode to the modbus server mode according to the adaptation state, so that the measurement and control device receives the subsequent upgrade data packet sent by the target web page, and the measurement and control device forwards the received upgrade data packet to the target LCD screen for subsequent processing. When the target web page directly transmits data with the target LCD screen, the normal operation of the target LCD screen is affected due to transmission errors. For example, Figure 2 As shown in the figure, the start upgrade request sent by the target web page is received, the password in the start upgrade request is verified first, and then the start address and the byte number in the start upgrade request are sent to the target LCD screen, so as to determine whether the target LCD screen and the upgrade data packet are adapted.
[0048] Further, after determining to perform software upgrade on the target LCD screen, the upgrade baud rate is determined according to the adaptation state, and the transmission rate between the measurement and control device and the target LCD screen is adjusted according to the upgrade baud rate, so that the communication rate between the measurement and control device and the target LCD screen must be consistent. If the measurement and control device sends data at a specific baud rate, the target LCD screen needs to receive at the same baud rate, otherwise data loss or garbled code will occur. Specifically, the upgrade baud rate is determined according to the adaptation state; the upgrade baud rate is sent to the target LCD screen, so that the target LCD screen adjusts according to the upgrade baud rate, so that the target LCD screen and the measurement and control device use the upgrade baud rate for data transmission. Specifically, the corresponding baud rate in different states can be set, and the transmission state can be divided into adaptation state and non-adaptation state in the application. The adaptation state refers to the state of upgrade transmission, and the non-adaptation state refers to other states without upgrade transmission. In the adaptation state, the high-speed baud rate can be used by default, and then it is suitable for file transmission. In the non-adaptation state, the medium-speed baud rate can be used, and the compatibility is better. If the target LCD screen and the upgrade data packet in the start upgrade request are in the adaptation state, the upgrade baud rate is selected for use, so that the target LCD screen adjusts the original baud rate in the baud rate register according to the upgrade baud rate. The measurement and control device subsequently sends data to the target LCD screen according to the adaptation state and selects the upgrade baud rate. Based on the above method, the dynamic configuration of the baud rate in the target LCD screen upgrade process can be realized, and the efficiency and stability of data transmission are ensured. After determining that the target LCD screen and the upgrade data packet in the start upgrade request are adapted, the target LCD screen sends the target information to the measurement and control device as the target information. After receiving the target information sent by the target LCD screen, the measurement and control device determines to perform software upgrade on the target LCD screen according to the target information, so the measurement and control device is switched to the active mode according to the target information, and the active mode refers to the modbus client mode at this time. The client refers to the measurement and control device as the master station, which initiates the request actively. For example, the measurement and control device sends a display instruction to the target LCD screen. Since the measurement and control device corresponds to the modbus server mode before the target LCD screen is upgraded, the measurement and control device is switched from the modbus server mode to the modbus client mode according to the target information, so that the measurement and control device starts to prepare to receive the upgrade data packet sent from the target web. The measurement and control device sends upgrade approval information to the target web through the network, that is, confirms the start upgrade information, for example, the measurement and control device returns "status: true" to the target web. At the same time, the target LCD screen returns the upgrade baud rate according to the adaptability of the executable file and switches to the modbus server mode, and the measurement and control device is correspondingly switched to the modbus client mode. This device mode switching mechanism is closely combined with the upgrade process, which is an important guarantee for reliable data transmission and orderly upgrade operation.
[0049] S102: receiving a target sub-data packet, the target sub-data packet being any one of the sub-data packets sent by the target webpage to the control device according to the upgrade approval information.
[0050] In the above S102, after receiving the upgrade approval information sent by the control device, the target webpage first divides the upgrade file packet into a plurality of sub-data packets, each of which contains the following information: LCD device address, function code, register start address, data byte number, data packet serial number, and byte executable file text. The function code indicates the data packet type, the data byte number refers to the number of valid data bytes contained in the current data packet, the data packet serial number refers to the serial number of the current data packet, which is used to ensure that the data packets are received in order. The byte executable file text refers to the actual upgrade data. The control device receives the target sub-data packet through the network and stores it in the buffer. The target sub-data packet is any one of the plurality of sub-data packets.
[0051] S103: analyzing the target sub-data packet to obtain a target serial number.
[0052] In the above S103, after receiving the target sub-data packet, the control device extracts the field corresponding to the data packet serial number from the received target sub-data packet. The target sub-data packet can be analyzed first, then the field corresponding to the data packet serial number is found in the analysis, and then the field is output as the target serial number. For example, the target serial number is 0x01, which means the first sub-data packet.
[0053] S104: determining whether the target serial number is consistent with a preset comparison serial number.
[0054] In the above S104, a counter is maintained in the control device to record the total number of sub-data packets received within a preset time. The preset time refers to the time from the first time point to the current time point. The first time point refers to the time point when the control device sends the upgrade approval information to the target webpage, and the current time point refers to the time point when the target serial number is obtained by analyzing the target sub-data packet. The preset comparison serial number is obtained from the counter, which is a dynamic value. The initial value of the dynamic value is 0. Within the preset time, when the control device receives a sub-data packet, the current value is obtained by adding 1 to the initial value. Subsequently, when the control device receives another sub-data packet, the serial number corresponding to the total number of sub-data packets received within the preset time is obtained by adding 1 to the current value. For example, the preset time is 5 seconds, and the control device receives 1 target sub-data packet within 5 seconds. The number displayed on the counter is 1, and the preset comparison serial number is determined to be 0x01 according to the displayed number.
[0055] S105: When the target sequence number is consistent with the preset comparison sequence number, the target sub-data packet is sent to the target LCD screen, so that the target LCD screen writes the target sub-data packet into the internal memory.
[0056] In the above S105, the target sequence number currently received by the control device is compared with the preset comparison sequence number. When the target sequence number is inconsistent with the preset comparison sequence number, it is determined that the target sub-data packet is sent in error, and the target sub-data packet is discarded, so that the control device sends an instruction to the target webpage to resend the upgraded data packet. When the target sequence number is consistent with the preset comparison sequence number, it is determined that the target sub-data packet is sent without error, and the target sub-data packet is sent to the target LCD screen through the serial port. After receiving the target sub-data packet, the target LCD screen writes the target sub-data packet into the internal memory, such as the internal Flash. For example, when the target sequence number is 0x01, and the preset comparison sequence number is 0x01, it is determined that the target sequence number is consistent with the preset comparison sequence number, and the target sub-data packet is sent to the target LCD screen.
[0057] In addition, in order for the target LCD screen to write the target sub-data packet into the internal memory, the target address is obtained from the target LCD screen, the target address is the address of the target file starting address in the internal memory, and the internal memory is the storage unit corresponding to the target LCD screen; the byte executable file text is obtained from the target sub-data packet, and the executable file text is sent to the target LCD screen, so that the target LCD screen writes the executable file text into the target address. Specifically, the target file starting address is obtained from the start upgrade request, and the target file starting address refers to the address corresponding to the target sub-data packet written in the internal memory of the target LCD screen. The target address of the internal memory is queried in the target LCD screen according to the target file starting address, and the address value is returned. The address value is parsed by the control device to extract the target address. The byte executable file text is obtained from the target sub-data packet, that is, the "executable file text" field is extracted by the control device. The extracted executable file text is transmitted to the target LCD screen. The target LCD screen receives the data write command through the serial port, parses the address, length and data text. According to the address and length, the data is written into the internal memory. If the executable file is large, it can be sent in blocks to avoid too large data transmission at a time. If sent in blocks, the executable file can be written into the target address of the internal memory of the target LCD screen in order.
[0058] Further, when the executable file text corresponding to the target sub data packet is written into the internal memory, the writing state of the internal memory of the target LCD screen is verified in real time to ensure the reliability of data transmission, which specifically includes: reading a first character from the internal memory; converting the byte executable file text into a second character; judging whether the first character and the second character are consistent; when the first character and the second character are consistent, it is determined that the internal memory is in a normal writing state, and normal writing information is sent to the target web page; when the first character and the second character are inconsistent, it is determined that the internal memory is in an abnormal writing state, and the stop upgrading operation is triggered according to the abnormal writing state. Specifically, the target address when the executable file text is written before is obtained, and the measurement and control device sends a reading command to the target LCD screen through the serial port. The target LCD screen reads data from the internal memory and returns the reading value. The measurement and control device analyzes the returned reading value to obtain the data value, and takes the data value as the first character. The measurement and control device extracts the executable file text from the target sub data packet, and converts the executable file text into the second character. Then, the first character and the second character are compared for consistency. When the first character value and the second character value are consistent, it is determined that the internal memory is in a normal writing state, and the measurement and control device sends normal writing information to the target web page, so that the target web page continues to send other sub data packets to the measurement and control device according to the normal writing information. When the first character and the second character are inconsistent, it is determined that the internal memory is in an abnormal writing state, and the abnormal writing state means that the internal memory cannot normally write the target sub data, so the stop upgrading operation is triggered, that is, the subsequent data is stopped from being sent, and the stop subsequent data information is sent to the target web page. By verifying the data written in the internal memory, the upgrading operation can be stopped in time to prevent error propagation and cause the upgrading to fail.
[0059] S106: Until the end data packet sent by the target web page is received, a first check value is obtained from the end data packet.
[0060] In the above S106, the other sub data packets are processed according to the processing method of the target sub data packet, and after all the sub data packets are sent, the executable file text corresponding to all the sub data packets is written into the internal memory. The target web page sends an end data packet, and the end data packet includes the LCD device address, the function code, the register start address, the data byte number and the byte check value. The first check value is obtained from the end data packet, and at this time the first check value is the check value calculated by the byte of the executable file of all the sent sub data packets, and the check value is the checksum. As shown in Figure 2
[0061] S107: judging whether the first check value and the second check value are equal.
[0062] In the above S107, the target LCD screen calculates the checksum (such as CRC32) of all executable files after receiving all sub-packets, obtaining a second check value. The measurement and control device obtains the second check value from the target LCD screen after receiving the first check value, and compares the second check value with the first check value.
[0063] S108: When the first check value is equal to the second check value, it is determined that the target LCD screen is in an upgrade success state, so as to display the upgrade success state to the target webpage.
[0064] In the above S108, when the first check value is equal to the second check value, it is determined that the target LCD screen is in an upgrade success state, which means that the target LCD screen has correctly written all executable files into the internal memory. The measurement and control device sends upgrade success information to the target webpage through the network, and the target webpage updates the user interface and displays "upgrade success" after receiving the upgrade success information. Thus, the target LCD screen program upgrade process is completed. After determining that the software upgrade process of the target LCD screen is completed, the measurement and control device needs to be switched from the active mode to the passive mode, and the target LCD screen needs to be switched from the passive mode to the active mode. The firmware upgrade of the LCD screen is realized through serial port and network communication, ensuring the integrity and correctness of data transmission. Figure 2 As shown in FIG. 8, when the first check value is consistent with the second check value, it is determined that the target LCD screen is upgraded successfully, and the upgrade success is forwarded to the target webpage, so as to display the upgrade success information on the target webpage, so that the user can understand the upgrade progress of the target LCD screen.
[0065] In addition, when the first check value is not equal to the second check value, it is determined that the target LCD screen is in an upgrade failure state, so as to re-perform the upgrade operation according to the upgrade failure state. Specifically, the first check value and the second check value are compared by string, and when the first check value is not consistent with the second check value, the target LCD screen is marked as an upgrade failure state, and the upgrade operation is re-performed according to the actual failure state. That is, the upgrade file is re-obtained from the target webpage, and the subsequent processing is sequentially performed according to the above upgrade steps. After all executable files are written, the check value of the target LCD screen is re-calculated and compared with the first check value. Through the above method, the detection and automatic re-upgrade of the target LCD screen in the upgrade failure state can be realized, ensuring the reliability of the device upgrade. In the upgrade completion stage, the executable file data received by the target LCD screen is calculated to obtain a second check value, and then compared with the first check value sent by the target webpage to determine whether the executable file is transmitted completely and correctly. This data integrity checking mechanism can ensure the accuracy of the upgrade software and avoid upgrade failure caused by data transmission error.
[0066] The application connects the target webpage and the measurement and control device through an optical fiber network or a network cable, and connects the measurement and control device and the target LCD screen through a serial port, thereby constructing a communication path from the target webpage to the measurement and control device and from the measurement and control device to the target LCD screen. An operator only needs to send an upgrade request on a webpage page of a browser, and can remotely upgrade the LCD screen of the box transformer measurement and control device distributed in different positions. This greatly reduces the workload of manual field operation, especially in large wind farms and other application scenarios, avoids the frequent back-and-forth of maintenance personnel for upgrade operation, and significantly improves the convenience of upgrade.
[0067] The application also provides a software upgrade device for a box transformer measurement and control device LCD screen, Figure 3 is a structural schematic diagram of a software upgrade device for a box transformer measurement and control device LCD screen provided by the application, referring to Figure 3 for executing any one of the above methods, the device comprises a receiving unit 301, a processing unit 302 and a display unit 303.
[0068] The receiving unit 301 receives target information sent by the target LCD screen, switches the measurement and control device to an active mode according to the target information, and sends upgrade approval information to the target webpage; receives a target sub-packet, the target sub-packet is any one sub-packet, the target sub-packet is a sub-packet sent by the measurement and control device according to the upgrade approval information, and the target sub-packet comprises an LCD device address, a function code, a register start address, a data byte number, a data packet serial number and a byte executable file text.
[0069] The processing unit 302 analyzes the target sub-packet to obtain a target serial number; judges whether the target serial number is consistent with a preset comparison serial number, the preset comparison serial number is a serial number corresponding to a total number of times of analyzing the target sub-packet by the measurement and control device within a preset time; when the target serial number is consistent with the preset comparison serial number, the target sub-packet is sent to the target LCD screen, so that the target LCD screen writes the target sub-packet into an internal storage; until an end data packet sent by the target webpage is received, a first check value is obtained from the end data packet; judges whether the first check value is equal to a second check value, the second check value is a byte check value obtained by the target LCD screen by calculating all the target sub-packets received.
[0070] The display unit 303 determines that the target LCD screen is in an upgrade success state when the first check value is equal to the second check value, so as to display the upgrade success state to the target webpage.
[0071] In a possible implementation, the receiving unit 301 is configured to receive a start-upgrading request sent by the target webpage; obtain a target password from the start-upgrading request, and determine whether the target password is consistent with a preset password, the preset password being a password input by a target user; the processing unit 302 is configured to, when the target password is consistent with the preset password, cause the target LCD screen to obtain a target file start address and a target byte number from the start-upgrading request, the target byte number being a total byte number corresponding to an executable file body in an upgrading data packet, and the upgrading data packet including a target sub-data packet; the receiving unit 301 is configured to receive an adaptation state sent by the target LCD screen, switch the target LCD screen to a passive mode according to the adaptation state, and output the adaptation state as target information, the adaptation state being a state determined when the target file start address is consistent with a preset file start address and the target byte number is less than or equal to a preset byte threshold, the preset file start address and the preset byte threshold being parameters under which the target LCD screen can normally operate.
[0072] In a possible implementation, the processing unit 302 is configured to determine an upgrading baud rate according to the adaptation state; and send the upgrading baud rate to the target LCD screen, so that the target LCD screen adjusts according to the upgrading baud rate, to enable the target LCD screen and the measurement and control device to perform data transmission at the upgrading baud rate.
[0073] In a possible implementation, the receiving unit 301 is configured to obtain a target address from the target LCD screen, the target address being an address of the target file start address in an internal storage, and the internal storage being a storage unit corresponding to the target LCD screen; obtain a byte executable file body from the target sub-data packet, and send the executable file body to the target LCD screen, so that the target LCD screen writes the executable file body into the target address.
[0074] In a possible implementation, the receiving unit 301 is configured to read a first character from the internal storage; the processing unit 302 is configured to convert the byte executable file body into a second character; determine whether the first character is consistent with the second character; when the first character is consistent with the second character, determine that the internal storage is in a normal writing state, and send normal writing information by the target webpage; and when the first character is not consistent with the second character, determine that the internal storage is in an abnormal writing state, and trigger a stop-upgrading operation according to the abnormal writing state.
[0075] In a possible implementation, the receiving unit 301 is configured to read the first character from the internal memory; the processing unit 302 is configured to convert the byte executable file text into a second character; determine whether the first character is consistent with the second character; when the first character is consistent with the second character, determine that the internal memory is in a normal writing state, and send the target web page to normal writing information; when the first character is inconsistent with the second character, determine that the internal memory is in an abnormal writing state, and trigger a stop upgrade operation according to the abnormal writing state.
[0076] In a possible implementation, the processing unit 302 is configured to determine that the target LCD screen is in a failed upgrade state when the first check value is not equal to the second check value, so as to re-perform an upgrade operation according to the failed upgrade state.
[0077] It should be noted that, when the apparatuses provided in the above examples implement their functions, only the division of the above functional modules is exemplified, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the apparatus and method embodiments provided in the above examples belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.
[0078] The present application also discloses an electronic device. Referring to Figure 4 , Figure 4 A structural schematic diagram of an electronic device is provided for the embodiments of the present application. The electronic device 400 can include at least one processor 401, at least one network interface 404, a user interface 403, a memory 402, and at least one communication bus 405.
[0079] The communication bus 405 is configured to realize the connection and communication between the components.
[0080] The user interface 403 can include a display screen (Display) and a camera (Camera), and the optional user interface 403 can further include a standard wired interface and a wireless interface.
[0081] The network interface 404 can optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
[0082] The processor 401 can include one or more processing cores. The processor 401 connects various parts within the server through various interfaces and lines, executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 402, and calling data stored in the memory 402. Alternatively, the processor 401 can be implemented in at least one of a hardware form of a digital signal processing (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 401 can integrate a combination of one or more of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes operating systems, user interfaces, and application requests; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used for processing wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 401, but can be realized by a separate chip.
[0083] The memory 402 can include a random access memory (RAM) and a read-only memory (ROM). Alternatively, the memory 402 includes a non-transitory computer-readable storage medium. The memory 402 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 402 can include a program storage area and a data storage area. The program storage area can store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the above-mentioned various method embodiments, etc. The data storage area can store data related to the above-mentioned various method embodiments, etc. The memory 402 can alternatively be at least one storage device located away from the aforementioned processor 401.
[0084] As shown in Figure 4 The memory 402 as a computer storage medium can include an operating system, a network communication module, a user interface module, and an application program for software upgrading of the LCD screen of the box transformer control device.
[0085] In Figure 4The electronic device 400 shown, the user interface 403 is mainly used for providing the interface for the user to input, obtaining the data input by the user; and the processor 401 can be used for calling the application program stored in the memory 402 for the software upgrade of the LCD screen of the box transformer control device, and the application program is executed by one or more processors, so that the electronic device executes the method described in one or more of the above embodiments.
[0086] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, some steps can be performed in other order or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0087] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0088] In several embodiments provided by the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the units is only a logical function division. There can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some services interfaces, devices or units, and can be electrical or other forms.
[0089] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0090] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware, or in the form of software functional unit.
[0091] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable memory. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a memory and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in various embodiments of the present application. The aforementioned memory includes: a U disk, a mobile hard disk, a magnetic disk or an optical disk, and various media that can store program codes.
[0092] The above is only exemplary embodiments of the present disclosure, which cannot limit the scope of the present disclosure. That is, any equivalent changes and modifications made in accordance with the teachings of the present disclosure are still within the scope of the present disclosure. Other embodiments of the present disclosure will be readily apparent to those skilled in the art upon considering the specification and practicing the true principles of the present disclosure. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure that follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not described in the present disclosure.
Claims
1. A software upgrade method for the LCD screen of a box-type transformer measurement and control device, characterized in that: Applied to a measurement and control device, the measurement and control device is connected to a target LCD screen via a serial port, and the measurement and control device is connected to a target web page via a network. The method includes: Receive the target information sent by the target LCD screen, switch the measurement and control device to the active mode according to the target information, and send upgrade approval information to the target webpage; the receiving of the target information sent by the target LCD screen specifically includes: receiving the start upgrade request sent by the target webpage; obtaining the target password from the start upgrade request, and judging whether the target password is consistent with the preset password, the preset password is the password entered by the target user; when the target password is consistent with the preset password, the target LCD screen obtains the target file starting address and target byte number from the start upgrade request, the target byte number is the executable file body in the upgrade data packet. The upgrade data packet includes a target sub-data packet; receiving an adaptation status sent by the target LCD screen, switching the target LCD screen to a passive mode according to the adaptation status, and outputting the adaptation status as the target information, wherein the adaptation status refers to a state determined when the target file starting address is consistent with the preset file starting address and the target number of bytes is less than or equal to a preset byte threshold, and the preset file starting address and the preset byte threshold are parameters for the normal operation of the target LCD screen; after receiving the adaptation status sent by the target LCD screen, the method further includes: determining an upgrade baud rate according to the adaptation status; Sending the upgraded baud rate to the target LCD screen so that the target LCD screen adjusts according to the upgraded baud rate, so that the upgraded baud rate is used for data transmission between the target LCD screen and the measurement and control device; receiving a target sub-data packet, wherein the target sub-data packet is any sub-data packet, the target sub-data packet being a sub-data packet sent to the measurement and control device according to the upgrade approval information, the target sub-data packet including an LCD device address, a function code, a register start address, a number of data bytes, a data packet sequence number, and a byte executable file body; Parsing the target sub-data packet to obtain a target sequence number; Determining whether the target sequence number is consistent with a preset comparison sequence number, where the preset comparison sequence number is a sequence number corresponding to the total number of times the measurement and control device parses the target sub-data packet within a preset time; When the target sequence number is consistent with the preset comparison sequence number, the target sub-data packet is sent to the target LCD screen so that the target LCD screen writes the target sub-data packet into an internal memory; until an end data packet sent by the target webpage is received, a first check value is obtained from the end data packet; and whether the first check value is equal to a second check value, where the second check value is a byte check value calculated by the target LCD screen for all received target sub-data packets; When the first check value is equal to the second check value, it is determined that the target LCD screen is in an upgrade success state, so that the upgrade success state is displayed to the target webpage.
2. The method according to claim 1, characterized in that The step of writing the target sub-data packet into the internal memory so that the target LCD screen can write the target sub-data packet into the internal memory specifically includes: Obtain a target address from the target LCD screen, where the target address is the address of the target file start address in the internal memory, and the internal memory is a storage unit corresponding to the target LCD screen; obtain the byte executable file text from the target sub-data packet, and send the executable file text to the target LCD screen so that the target LCD screen writes the executable file text into the target address.
3. The method according to claim 2, characterized in that After obtaining the byte executable file text from the target sub-data packet and sending the executable file text to the target LCD screen so that the target LCD screen writes the executable file text into the target address, the method further includes: Reading a first character from the internal memory; Converting the byte executable file text into a second character; Determining whether the first character is consistent with the second character; When the first character is consistent with the second character, determining that the internal memory is in a normal writing state, and sending normal writing information to the target webpage; When the first character is inconsistent with the second character, it is determined that the internal memory is in an abnormal writing state, and the upgrading operation is stopped according to the abnormal writing state.
4. The method according to claim 1, wherein Before receiving the target information sent by the target LCD screen, the method further includes: Receiving a first version number sent by the target webpage; Determining whether the first version number is consistent with a second version number, where the second version number is a version number corresponding to a current software program on the target LCD screen; When the first version number is inconsistent with the second version number, it is determined that the target LCD screen is in a waiting-for-upgrade state, and the start upgrade request sent by the target webpage is received according to the waiting-for-upgrade state.
5. The method according to claim 1, wherein After determining whether the first check value is equal to the second check value, the method further includes: When the first check value is not equal to the second check value, it is determined that the target LCD screen is in an upgrade failure state, so that the upgrade operation is re-performed according to the upgrade failure state.
6. A software upgrade device for an LCD screen of a box-type transformer measurement and control device, used to execute the method according to any one of claims 1 to 5, characterized in that: The device comprises a receiving unit (301), a processing unit (302) and a display unit (303); The receiving unit (301) receives target information sent by the target LCD screen, switches the measurement and control device to an active mode according to the target information, and sends upgrade approval information to the target webpage; The receiving of the target information sent by the target LCD screen specifically includes: receiving a start upgrade request sent by the target web page; obtaining a target password from the start upgrade request, and determining whether the target password is consistent with a preset password, wherein the preset password is a password entered by the target user; when the target password is consistent with the preset password, the target LCD screen obtains a target file starting address and a target number of bytes from the start upgrade request, wherein the target number of bytes is the total number of bytes corresponding to the executable file body in the upgrade data packet, and the upgrade data packet includes a target sub-data packet; receiving an adaptation status sent by the target LCD screen, switching the target LCD screen to a passive mode according to the adaptation status, and outputting the adaptation status as the target information, wherein the adaptation status refers to when the target file starting address is consistent with the preset file starting address, and the target The state determined when the number of bytes is less than or equal to a preset byte threshold, the preset file starting address and the preset byte threshold are parameters for the normal operation of the target LCD screen; after receiving the adaptation state sent by the target LCD screen, it also includes: determining an upgrade baud rate according to the adaptation state; sending the upgrade baud rate to the target LCD screen so that the target LCD screen adjusts according to the upgrade baud rate, so that the target LCD screen and the measurement and control device use the upgrade baud rate for data transmission; receiving a target sub-data packet, the target sub-data packet is any sub-data packet, the target sub-data packet is sent to the measurement and control device according to the upgrade approval information, the target sub-data packet includes an LCD device address, a function code, a register starting address, a number of data bytes, a data packet sequence number and a byte executable file body; The processing unit (302) parses the target sub-data packet to obtain a target sequence number; determines whether the target sequence number is consistent with a preset comparison sequence number, the preset comparison sequence number being the sequence number corresponding to the total number of times the measurement and control device parses the target sub-data packet within a preset time; when the target sequence number is consistent with the preset comparison sequence number, sending the target sub-data packet to the target LCD screen so that the target LCD screen writes the target sub-data packet into an internal memory; receiving an end data packet sent by the target webpage, obtaining a first check value from the end data packet; and determining whether the first check value is equal to a second check value, where the second check value is a byte check value calculated by the target LCD screen for all received target sub-data packets; The display unit (303) determines that the target LCD screen is in an upgrade success state when the first check value is equal to the second check value, so as to display the upgrade success state to the target webpage.
7. An electronic device, characterized in that: The electronic device (400) comprises a processor (401), a memory (402), a user interface (403) and a network interface (404), wherein the memory (402) is used to store instructions, the user interface (403) and the network interface (404) are used to communicate with other devices, and the processor (401) is used to execute the instructions stored in the memory (402) so that the electronic device (400) executes the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 5 is executed.
Citation Information
Patent Citations
Display apparatus, upgrading apparatus, control method thereof and display system
CN103227960A
Sensor terminal node upgrading method and system in Modbus TCP network scene
CN115766444A
Remote upgrading method and device of end equipment, equipment and storage medium
CN117519753A