Ultrasonic water meter upgrade method, system and device supporting infrared function

The ultrasonic water meter upgrade method with infrared function uses the technology of splitting data packets and key verification to achieve upgrades without disassembly, solves the problems of equipment damage and accuracy impact during the upgrade process of existing ultrasonic water meters, and improves upgrade efficiency and success rate.

CN117573156BActive Publication Date: 2024-09-10BEIJING JOYO SMART WATER METER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311361352.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-19
Publication Date
2024-09-10
Estimated Expiration
2043-10-19

AI Technical Summary

Technical Problem

Existing ultrasonic water meters are easily damaged during the upgrade process, affecting measurement accuracy or causing the equipment to be unable to continue to be used, and it is difficult to upgrade, especially due to its IP68 protection level and the nature of precision equipment, which makes disassembly and upgrade difficult.

Method used

The ultrasonic water meter upgrade method using infrared function obtains the upgrade data package and secret key through the host computer, splits it into multiple program packages, and verifies the secret key and sends it gradually. The ultrasonic water meter terminal executes the corresponding strategy according to the instruction information type to achieve Upgrade operation without disassembly.

Benefits of technology

It improves the efficiency and convenience of ultrasonic water meter upgrades, reduces data loss and the impact of malicious operations, ensures the success rate of the upgrade process and the safety of the equipment, and avoids performance damage caused by the upgrade.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117573156B
    Figure CN117573156B
Patent Text Reader

Abstract

The present application relates to an ultrasonic water meter upgrade method, system and device supporting infrared function, which is applied to the water meter upgrade technology field. The method is applied to the host computer end, which includes: obtaining an upgrade data packet, an upgrade key and an unpacking byte length; splitting the upgrade data packet into multiple upgrade program packages according to the unpacking byte length; generating a key verification instruction based on the upgrade key, sending the key verification instruction to the ultrasonic water meter end for verification, and receiving the verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure; when the verification result is verification failure, determining that the upgrade failed; when the verification result is verification success, performing an upgrade operation based on the upgrade program package. The present application has the effect of efficiently and conveniently upgrading the ultrasonic water meter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of water meter upgrades, and in particular to a method, system and device for upgrading an ultrasonic water meter supporting infrared functions. Background Art

[0002] The ultrasonic water meters currently in use are electronic water meters that support infrared functions. Programs written into ultrasonic water meters are bound to have bugs. Therefore, it is necessary to perform software upgrades on the ultrasonic water meters.

[0003] The existing upgrade method is to open the case of the ultrasonic water meter and use a dedicated programmer to upgrade the ultrasonic water meter. Since the ultrasonic water meter is IP68 protection grade, the ultrasonic water meter has been sealed with glue and is difficult to disassemble and restore. In addition, since the ultrasonic water meter is a precision device and is installed in a special position, it is difficult to disassemble and any disassembly will affect the performance parameters of the ultrasonic water meter. During the upgrade, the ultrasonic water meter is easily damaged, affecting the measurement accuracy of the ultrasonic water meter or causing the ultrasonic water meter to be unable to continue to be used, thereby increasing the difficulty of upgrading the ultrasonic water meter. Summary of the invention

[0004] In order to upgrade an ultrasonic water meter efficiently and conveniently, the present application provides an ultrasonic water meter upgrade method, system and device supporting infrared function.

[0005] In the first aspect, the present application provides a method for upgrading an ultrasonic water meter supporting infrared function, which adopts the following technical solution:

[0006] A method for upgrading an ultrasonic water meter supporting infrared function, applied to a host computer, the method comprising:

[0007] Get the upgrade data packet, upgrade key and unpacking byte length;

[0008] Splitting the upgrade data packet into multiple upgrade program packages according to the unpacking byte length;

[0009] Generate a key verification instruction based on the upgrade key, send the key verification instruction to the ultrasonic water meter end for verification, and receive the verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure;

[0010] When the verification result is a verification failure, it is determined that the upgrade fails;

[0011] When the verification result is successful, an upgrade operation is performed based on the upgrade program package.

[0012] By adopting the above technical solution, when performing a program upgrade, the host computer performs an upgrade publishing operation, splits the upgrade data packet into multiple upgrade program packages according to the unpacking byte length, and verifies whether the upgrade key is accurate before sending the upgrade program package. If the ultrasonic water meter returns a successful verification message, the normal upgrade program package can be sent to reduce the possibility of malicious upgrade operations affecting the normal operation of the ultrasonic water meter. Splitting an upgrade data packet into multiple upgrade program packages can reduce the possibility of partial loss of data in the upgrade data packet during transmission and the inability to upgrade, thereby efficiently and conveniently upgrading the ultrasonic water meter.

[0013] Optionally, the performing an upgrade operation based on the upgrade program package includes:

[0014] Arrange the upgrade program packages in the order of splitting to generate upgrade program serial numbers;

[0015] Generate a program receiving instruction based on the upgrade program package, and send the program receiving instruction to the ultrasonic water meter terminal according to the upgrade program sequence number;

[0016] Obtaining a program receiving result returned by the ultrasonic water meter end, wherein the program receiving result includes a receiving success and a receiving failure;

[0017] When the program receiving result is a successful reception, repeating the step of sending the program receiving instruction to the ultrasonic water meter terminal according to the upgrade program sequence number until all the upgrade program packages are sent;

[0018] Sending a restart instruction to the ultrasonic water meter terminal;

[0019] When the program receiving result is a receiving failure, obtaining the number of retransmissions of the upgrade program package;

[0020] Determining whether the number of retransmissions is less than a preset number threshold;

[0021] If the retransmission quantity is less than a preset quantity threshold, resending the program receiving instruction;

[0022] If the retransmission quantity is not less than the preset quantity threshold, it is determined that the upgrade fails.

[0023] Optionally, after resending the upgrade program package, the method further includes:

[0024] The number of retransmissions corresponding to the upgrade program package is cleared to zero.

[0025] In the second aspect, the present application provides a method for upgrading an ultrasonic water meter that supports infrared function, which adopts the following technical solution:

[0026] A method for upgrading an ultrasonic water meter supporting infrared function, applied to an ultrasonic water meter end, the method comprising:

[0027] In response to the instruction information sent by the host computer, the instruction information is analyzed to determine the type of the instruction information, wherein the instruction information type includes a key verification instruction, a program receiving instruction, and a restart instruction;

[0028] Determine an execution strategy based on the instruction information type;

[0029] The instruction information is processed based on the execution strategy.

[0030] By adopting the above technical solution, the ultrasonic water meter verifies the command information sent by the upper computer during the upgrade, and executes the corresponding execution strategy after verifying the command information type. Different command information corresponds to different execution strategies. After determining the execution strategy, the corresponding verification and execution can be carried out according to the execution strategy, thereby efficiently and conveniently upgrading the ultrasonic water meter.

[0031] Optionally, the processing the instruction information based on the execution strategy includes:

[0032] When the instruction information type is a key verification instruction;

[0033] Receiving the upgrade key sent by the host computer, and comparing the upgrade key with the locally stored key;

[0034] Determine whether the upgrade key is consistent with the locally stored key;

[0035] If the upgrade key is consistent with the local storage key, the upgrade mode is entered and the host computer is replied with a successful verification;

[0036] If the upgrade key is inconsistent with the locally stored key, the upgrade mode is exited and a verification failure is reported to the host computer.

[0037] Optionally, the processing the instruction information based on the execution strategy includes:

[0038] When the instruction information type is a program receiving instruction;

[0039] Receiving the upgrade program package sent by the host computer;

[0040] Determine whether it is in upgrade mode;

[0041] If it is in upgrade mode, the upgrade program package is stored in the program backup area, and a reply is given to the host computer indicating successful reception;

[0042] If it is not in upgrade mode, the host computer is replied to receive failure.

[0043] Optionally, the processing the instruction information based on the execution strategy includes:

[0044] When the instruction information type is a restart instruction;

[0045] Entering the verification program backup area to determine whether the upgrade program package stored in the program backup area is correct;

[0046] If the upgrade program package stored in the program backup area is correct, copying the upgrade program package stored in the program backup area to the application area;

[0047] The application area performs an upgrade operation based on the upgrade program package and determines that the program upgrade is successful;

[0048] If the upgrade program package stored in the program backup area is incorrect, it is determined that the program upgrade has failed.

[0049] In a third aspect, the present application provides an ultrasonic water meter upgrade system supporting infrared function, which adopts the following technical solution:

[0050] An ultrasonic water meter upgrade system supporting infrared function, comprising:

[0051] The host computer is used to obtain an upgrade data packet, an upgrade key and an unpacking byte length; split the upgrade data packet into multiple upgrade program packages according to the unpacking byte length; generate a key verification instruction based on the upgrade key, send the key verification instruction to the ultrasonic water meter end for verification, and receive a verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure; when the verification result is verification failure, it is determined that the upgrade fails; when the verification result is verification success, an upgrade operation is performed based on the upgrade program package;

[0052] The ultrasonic water meter is used to respond to the instruction information sent by the host computer, analyze the instruction information, determine the type of the instruction information; determine the execution strategy based on the instruction information type; and process the instruction information based on the execution strategy;

[0053] The infrared tool is used to connect the host computer and the ultrasonic water meter to perform data transmission between the host computer and the ultrasonic water meter.

[0054] By adopting the above technical solution, the host computer is connected to the ultrasonic water meter using infrared tooling, and the infrared tooling is used to perform the upgrade operation. The program can be directly upgraded without disassembling the ultrasonic water meter, thereby upgrading the ultrasonic water meter efficiently and conveniently.

[0055] In a fourth aspect, the present application provides an ultrasonic water meter upgrade device supporting infrared function, which adopts the following technical solution:

[0056] An ultrasonic water meter upgrade device supporting infrared function, applied to a host computer, comprising:

[0057] The upgrade data acquisition module is used to obtain the upgrade data packet, upgrade key and unpacking byte length;

[0058] An upgrade program splitting module, used for splitting the upgrade data packet into multiple upgrade program packages according to the unpacking byte length;

[0059] An instruction sending and receiving module, used for generating a key verification instruction based on the upgrade key, sending the key verification instruction to the ultrasonic water meter end for verification, and receiving a verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure;

[0060] An upgrade failure determination module, used to determine upgrade failure;

[0061] An upgrade operation execution module is used to perform an upgrade operation based on the upgrade program package.

[0062] By adopting the above technical solution, when performing a program upgrade, the host computer performs an upgrade publishing operation, splits the upgrade data packet into multiple upgrade program packages according to the unpacking byte length, and verifies whether the upgrade key is accurate before sending the upgrade program package. If the ultrasonic water meter returns a successful verification message, the normal upgrade program package can be sent to reduce the possibility of malicious upgrade operations affecting the normal operation of the ultrasonic water meter. Splitting an upgrade data packet into multiple upgrade program packages can reduce the possibility of partial loss of data in the upgrade data packet during transmission and the inability to upgrade, thereby efficiently and conveniently upgrading the ultrasonic water meter.

[0063] In a fifth aspect, the present application provides an ultrasonic water meter upgrade device supporting infrared function, which adopts the following technical solution:

[0064] An ultrasonic water meter upgrade device supporting infrared function, applied to an ultrasonic water meter end, the device comprising:

[0065] An instruction information analysis module, for analyzing the instruction information in response to the instruction information sent by the host computer, and determining the type of the instruction information, wherein the instruction information type includes a key verification instruction, a program receiving instruction, and a restart instruction;

[0066] An execution strategy determination module, used to determine the execution strategy based on the instruction information type;

[0067] An instruction information processing module is used to process the instruction information based on the execution strategy.

[0068] By adopting the above technical solution, the ultrasonic water meter verifies the command information sent by the upper computer during the upgrade, and executes the corresponding execution strategy after verifying the command information type. Different command information corresponds to different execution strategies. After determining the execution strategy, the corresponding verification and execution can be carried out according to the execution strategy, thereby efficiently and conveniently upgrading the ultrasonic water meter. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 It is a flow chart of a method for upgrading an ultrasonic water meter supporting infrared function applied to a host computer provided in an embodiment of the present application.

[0070] Figure 2 It is a flow chart of an ultrasonic water meter upgrade method supporting infrared function applied to an ultrasonic water meter end provided in an embodiment of the present application.

[0071] Figure 3 It is a structural block diagram of an ultrasonic water meter upgrade system supporting infrared function provided in an embodiment of the present application.

[0072] Figure 4 This is a structural block diagram of an ultrasonic water meter upgrading device supporting infrared function applied to a host computer end provided in an embodiment of the present application.

[0073] Figure 5 This is a structural block diagram of an ultrasonic water meter upgrading device supporting infrared function applied to an ultrasonic water meter end provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] The present application is further described in detail below in conjunction with the accompanying drawings.

[0075] The embodiment of the present application provides an ultrasonic water meter upgrade method supporting infrared function, which can be executed by an electronic device, which can be a server or a terminal device, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device can be a smart phone, a tablet computer, a desktop computer, etc., but is not limited thereto.

[0076] Figure 1 A flowchart of a method for upgrading an ultrasonic water meter supporting infrared function applied to a host computer provided in an embodiment of the present application.

[0077] like Figure 1As shown, the main process of the method is described as follows (steps S101 to S105):

[0078] Step S101, obtaining the upgrade data packet, upgrade key and unpacking byte length.

[0079] In this embodiment, when upgrading, it is necessary to use an upgrade data packet for upgrading. However, the data size of the upgrade data packet may be large, and the time required for transmission is long and the transmission rate is low. Therefore, it is necessary to set the unpacking byte length and split the upgrade data packet for processing. The upgrade key is the key used to establish a connection with the ultrasonic water meter. The upgrade operation can only be performed after the input upgrade key is successfully verified on the ultrasonic water meter end. Different upgrade data packet versions have different corresponding upgrade keys. The upgrade key input during input is not the current key. The ultrasonic water meter has an initial key. When upgrading for the first time, the initial key needs to be used as the upgrade key for verification, and the key corresponding to the current upgrade version is also sent to the ultrasonic water meter end. When upgrading for the second time, the key corresponding to the current upgrade version needs to be used as the upgrade key for verification. When the unpacking byte length is unpacking, the upgrade data packet needs to be split into multiple upgrade program packages with the unpacking byte length. The unpacking byte length needs to be set according to actual needs. If not set, it defaults to 152 bytes. The specific byte length is not specifically limited here.

[0080] Step S102: split the upgrade data packet into multiple upgrade program packages according to the unpacked byte length.

[0081] In this embodiment, when splitting according to the unpacking byte length, if the final remaining byte length is less than the unpacking byte length, the remaining byte length will still be used as an upgrade package. For example, the upgrade data packet is 860 bytes and the unpacking byte length is 152 bytes. When unpacking according to the unpacking byte length, 5 upgrade packages that meet the unpacking byte length and one 100-byte upgrade package will be disassembled.

[0082] Step S103, generating a key verification instruction based on the upgrade key, sending the key verification instruction to the ultrasonic water meter end for verification, and receiving the verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure.

[0083] In this embodiment, it is necessary to establish a connection with the ultrasonic water meter end when upgrading. The upgrade operation can only be performed after the ultrasonic water meter end enters the upgrade mode. The ultrasonic water meter will enter the upgrade mode only after the upgrade key verification is successful. The upper computer end generates a key verification instruction based on the upgrade key entered by the technician. The key verification instruction contains the upgrade key. After receiving the upgrade key and verifying it, the ultrasonic water meter end will reply to the upper computer with the verification result based on the verification result.

[0084] Step S104: when the verification result is verification failure, it is determined that the upgrade fails.

[0085] In this embodiment, if the upgrade key is inconsistent with the upgrade key of the ultrasonic water meter, a verification failure response will be returned. After receiving the verification failure response value, the host computer directly determines that the upgrade has failed.

[0086] Step S105: When the verification result is successful, an upgrade operation is performed based on the upgrade program package.

[0087] For step S105, the upgrade program packages are arranged in the order of splitting, and the upgrade program serial number is generated; a program receiving instruction is generated based on the upgrade program package, and the program receiving instruction is sent to the ultrasonic water meter end according to the upgrade program serial number; the program receiving result returned by the ultrasonic water meter end is obtained, wherein the program receiving result includes successful reception and failed reception; when the program receiving result is successful reception, the step of sending the program receiving instruction to the ultrasonic water meter end according to the upgrade program serial number is repeated until all the upgrade program packages are sent; a restart instruction is sent to the ultrasonic water meter end; when the program receiving result is failed reception, the number of retransmissions of the upgrade program package is obtained; it is determined whether the number of retransmissions is less than a preset number threshold; if the number of retransmissions is less than the preset number threshold, the program receiving instruction is resent; if the number of retransmissions is not less than the preset number threshold, the upgrade is determined to have failed.

[0088] In this embodiment, when performing a program upgrade, the divided upgrade program packages are first numbered in the order of division, each upgrade program package has an upgrade program serial number, and each upgrade program package is used as a program receiving instruction. The upgrade program serial number is used to send the program receiving instruction, and the program receiving result returned by the ultrasonic water meter end is received. If the program reception result is a successful reception, the program receiving instruction will continue to be sent according to the upgrade program serial number, and it will be determined whether the upgrade program package corresponding to the program receiving instruction sent successfully this time is the last upgrade program package. If the upgrade program package corresponding to the program receiving instruction sent successfully this time is the last upgrade program package, a restart instruction is sent to the ultrasonic water meter end to cause the ultrasonic water meter end to restart; if the upgrade program package corresponding to the program receiving instruction sent successfully this time is not the last upgrade program package, the operation of continuing to send the program receiving instruction according to the upgrade program serial number is repeated until the last upgrade program package is sent successfully. If the program reception result is a reception failure, a retransmission operation will be performed, that is, the program reception instruction will be resent, and before resending, it will be determined whether the number of retransmissions is not less than the preset number threshold. If it is less than the preset number threshold, it will be resent. If it is less than the preset number threshold, it will be determined as an upgrade failure. When the program reception instruction is sent for the first time, the number of retransmissions is 0. Each time it is retransmitted, the number of retransmissions will increase by 1. When the number of retransmissions reaches the preset number threshold, the retransmission is unsuccessful and it will be determined as an upgrade failure. Before the number of retransmissions reaches the preset number threshold, any retransmission or the first successful transmission will reset the number of retransmissions to zero. It should be noted that the specific preset number threshold needs to be set according to actual needs. If it is not set, it defaults to 3. The actual preset number threshold is not specifically limited here.

[0089] Figure 2 A flow chart of an ultrasonic water meter upgrade method supporting infrared function applied to an ultrasonic water meter end provided in an embodiment of the present application.

[0090] like Figure 2 As shown, the main process of the method is described as follows (steps S201 to S204):

[0091] Step S201, in response to the instruction information sent by the host computer, analyze the instruction information and determine the type of instruction information, wherein the instruction information type includes a key verification instruction, a program receiving instruction and a restart instruction.

[0092] In this embodiment, after receiving the command information sent by the host computer, the ultrasonic water meter terminal needs to analyze the command information to determine the specific command information type, and then perform the next processing operation according to the command information type. It should be noted that the command information type includes but is not limited to key verification instructions, program receiving instructions and restart instructions, but in this application, only the processing of the above three instructions is involved, and other command information can be added and set according to actual needs.

[0093] Step S202: determining an execution strategy based on the instruction information type.

[0094] In this embodiment, the key verification instruction, program receiving instruction and restart instruction all have their own execution strategies. Therefore, after determining the appropriate information type,

[0095] Step S203: Process the instruction information based on the execution strategy.

[0096] In this embodiment, three different types of instruction information are processed using three different execution strategies.

[0097] When the instruction information type is a key verification instruction; receive the upgrade key sent by the host computer, compare the upgrade key with the local storage key; determine whether the upgrade key is consistent with the local storage key; if the upgrade key is consistent with the local storage key, enter the upgrade mode and reply to the host computer that the verification is successful; if the upgrade key is inconsistent with the local storage key, exit the upgrade mode and reply to the host computer that the verification failed.

[0098] The key verification instruction is sent before the other two instructions. After receiving the key verification instruction sent by the host computer, the upgrade key carried in it is compared with the local storage key for verification. Only when the upgrade key and the local storage key are consistent, the ultrasonic water meter will enter the upgrade mode, otherwise it will exit the upgrade mode. However, no matter entering or exiting the upgrade mode, a reply will be made to the host computer. When entering the upgrade mode, the reply is verification success, and when exiting the upgrade mode, the reply is verification failure.

[0099] When the instruction information type is a program receiving instruction; receive the upgrade package sent by the host computer; determine whether it is in upgrade mode; if it is in upgrade mode, store the upgrade package in the program backup area and reply to the host computer that the reception is successful; if it is not in upgrade mode, reply to the host computer that the reception failed.

[0100] After the secret key verification, the host computer will send the upgrade program receiving instruction. However, for the ultrasonic water meter, it still needs to verify its own mode every time it receives the upgrade package, so as to reduce the occurrence of malicious data reception affecting the normal program operation. Regardless of whether the upgrade package is successfully received, the host computer will also be replied. In the upgrade mode, in addition to replying to the host computer that the reception is successful, the upgrade package must also be stored in the program backup area. When it is not in upgrade mode, the host computer will be replied to that the reception failed.

[0101] When the instruction information type is a restart instruction; enter the verification program backup area to determine whether the upgrade package stored in the program backup area is correct; if the upgrade package stored in the program backup area is correct, copy the upgrade package stored in the program backup area to the application area; the application area performs the upgrade operation based on the upgrade package and determines that the program upgrade is successful; if the upgrade package stored in the program backup area is incorrect, determine that the program upgrade has failed.

[0102] After receiving the restart command, enter the verification program backup area in the bootload area of ​​the ultrasonic water meter and determine whether the upgrade program package stored in the program backup area is correct, that is, determine whether the version is correct, whether the data is available, whether the data is complete, etc. If correct, copy the upgrade program package stored in the program backup area to the application area; use the upgrade program package in the application area to perform the upgrade operation, and determine that the program upgrade is successful. If incorrect, directly determine that the program upgrade has failed.

[0103] Figure 3 A structural block diagram of an ultrasonic water meter upgrade system 300 supporting infrared function provided in an embodiment of the application.

[0104] like Figure 3 As shown, the ultrasonic water meter upgrade system 300 supporting infrared function mainly includes:

[0105] The host computer 301 is used to obtain an upgrade data packet, an upgrade key and an unpacking byte length; split the upgrade data packet into multiple upgrade program packages according to the unpacking byte length; generate a key verification instruction based on the upgrade key, send the key verification instruction to the ultrasonic water meter end for verification, and receive a verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure; when the verification result is verification failure, it is determined that the upgrade fails; when the verification result is verification success, an upgrade operation is performed based on the upgrade program package;

[0106] The ultrasonic water meter 302 is used to respond to the instruction information sent by the host computer, analyze the instruction information, determine the type of the instruction information; determine the execution strategy based on the instruction information type; and process the instruction information based on the execution strategy;

[0107] The infrared tooling 303 is used to connect the host computer and the ultrasonic water meter to perform data transmission between the host computer and the ultrasonic water meter.

[0108] In this embodiment, an infrared signal receiving device and a connecting line are provided in the infrared tooling. The connecting line here is a physical line that can be connected to the host computer and transmit data. The connecting line of the infrared tooling is plugged into the USB port of the host computer, and the part of the infrared tooling provided with the infrared signal receiving device is placed above the water meter, so that the infrared signal receiving device is connected to the infrared part of the ultrasonic water meter, thereby using infrared signals for data transmission.

[0109] Figure 4 A structural block diagram of an ultrasonic water meter upgrading device 400 supporting infrared function and applied to a host computer provided in an embodiment of the application.

[0110] like Figure 4 As shown, the ultrasonic water meter upgrade device 400 supporting infrared function applied to the host computer mainly includes:

[0111] The upgrade data acquisition module 401 is used to obtain the upgrade data packet, the upgrade key and the unpacking byte length;

[0112] The upgrade program splitting module 402 is used to split the upgrade data packet into multiple upgrade program packages according to the unpacking byte length;

[0113] The instruction sending and receiving module 403 is used to generate a key verification instruction based on the upgrade key, send the key verification instruction to the ultrasonic water meter end for verification, and receive the verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure;

[0114] An upgrade failure determination module 404 is used to determine an upgrade failure;

[0115] The upgrade operation execution module 405 is used to perform an upgrade operation based on the upgrade program package.

[0116] As an optional implementation of this embodiment, the upgrade operation execution module 405 is specifically used to arrange the upgrade program packages in the order of splitting and generate an upgrade program serial number; generate a program receiving instruction based on the upgrade program package, and send the program receiving instruction to the ultrasonic water meter end according to the upgrade program serial number; obtain the program reception result returned by the ultrasonic water meter end, wherein the program reception result includes successful reception and failed reception; when the program reception result is successful reception, repeat the step of sending the program reception instruction to the ultrasonic water meter end according to the upgrade program serial number until all the upgrade program packages are sent; send a restart instruction to the ultrasonic water meter end; when the program reception result is failed reception, obtain the number of retransmissions of the upgrade program package; determine whether the number of retransmissions is less than a preset number threshold; if the number of retransmissions is less than the preset number threshold, resend the program receiving instruction; if the number of retransmissions is not less than the preset number threshold, determine that the upgrade has failed.

[0117] As an optional implementation of this embodiment, the ultrasonic water meter upgrade device 400 supporting infrared function applied to the host computer side also includes:

[0118] The retransmission count clearing module is used to clear the retransmission count corresponding to the upgrade package.

[0119] Figure 5 A structural block diagram of an ultrasonic water meter upgrading device 500 supporting infrared function and applied to an ultrasonic water meter end provided in an embodiment of the application.

[0120] like Figure 5 As shown, the ultrasonic water meter upgrade device 500 supporting infrared function applied to the ultrasonic water meter end mainly includes:

[0121] The instruction information analysis module 501 is used to analyze the instruction information in response to the instruction information sent by the host computer, and determine the type of instruction information, wherein the instruction information type includes a key verification instruction, a program receiving instruction, and a restart instruction;

[0122] An execution strategy determination module 502, configured to determine an execution strategy based on the instruction information type;

[0123] The instruction information processing module 503 is used to process the instruction information based on the execution strategy.

[0124] As an optional implementation mode of this embodiment, the instruction information processing module 503 is specifically used for receiving the upgrade key sent by the upper computer when the instruction information type is a key verification instruction, and comparing the upgrade key with the local storage key; determining whether the upgrade key is consistent with the local storage key; if the upgrade key is consistent with the local storage key, entering the upgrade mode and replying to the upper computer that the verification is successful; if the upgrade key is inconsistent with the local storage key, exiting the upgrade mode and replying to the upper computer that the verification failed.

[0125] As an optional implementation mode of this embodiment, the instruction information processing module 503 is specifically used to receive the upgrade program package sent by the host computer when the instruction information type is a program receiving instruction; determine whether it is an upgrade mode; if it is an upgrade mode, store the upgrade program package in the program backup area, and reply to the host computer that the reception is successful; if it is not an upgrade mode, reply to the host computer that the reception failed.

[0126] As an optional implementation manner of this embodiment, the instruction information processing module 503 is specifically used for, when the instruction information type is a restart instruction; entering the verification program backup area to determine whether the upgrade program package stored in the program backup area is correct; if the upgrade program package stored in the program backup area is correct, then copying the upgrade program package stored in the program backup area to the application area; the application area performs an upgrade operation based on the upgrade program package, and determines that the program upgrade is successful; if the upgrade program package stored in the program backup area is incorrect, then determining that the program upgrade has failed.

[0127] In one example, the module in any of the above devices can be one or more integrated circuits configured to implement the above methods, such as: one or more application specific integrated circuits (ASICs), or, one or more digital signal processors (DSPs), or, one or more field programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.

[0128] For another example, when the modules in the device can be implemented in the form of a processing element scheduling program, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call a program. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0129] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0130] The terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus.

[0131] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.

Claims

1. A method for upgrading an ultrasonic water meter supporting infrared function, characterized in that: Applied to the host computer, the method includes: Obtain an upgrade data packet, an upgrade key, and the unpacking byte length, wherein the upgrade key is the key used to establish a connection with the ultrasonic water meter terminal; Splitting the upgrade data packet into multiple upgrade program packages according to the unpacking byte length; Generate a key verification instruction based on the upgrade key, send the key verification instruction to the ultrasonic water meter end for verification through the infrared tooling, receive the verification result sent by the ultrasonic water meter end, wherein the verification result includes verification success and verification failure, the infrared tooling is used to connect the host computer and the ultrasonic water meter, and perform data transmission between the host computer and the ultrasonic water meter, the infrared tooling includes an infrared signal receiving device and a connecting line, the connecting line is used to connect the host computer and perform data transmission with the host computer, the infrared signal receiving device is used to connect to the infrared part of the ultrasonic water meter, and use infrared signals to perform data transmission with the ultrasonic water meter; When the verification result is a verification failure, it is determined that the upgrade fails; When the verification result is successful, performing an upgrade operation based on the upgrade program package; The step of generating a key verification instruction based on the upgrade key and sending the key verification instruction to the ultrasonic water meter for verification includes: If the ultrasonic water meter is upgraded for the first time, the initial key of the ultrasonic water meter is determined as the upgrade key, and the key corresponding to the upgraded version is sent to the ultrasonic water meter end; If the ultrasonic water meter is not upgraded for the first time, the key corresponding to the upgraded version is determined as the upgrade key.

2. The method according to claim 1, characterized in that The upgrading operation based on the upgrading program package comprises: Arrange the upgrade program packages in the order of splitting to generate upgrade program serial numbers; Generate a program receiving instruction based on the upgrade program package, and send the program receiving instruction to the ultrasonic water meter terminal according to the upgrade program sequence number; Obtaining a program receiving result returned by the ultrasonic water meter end, wherein the program receiving result includes a receiving success and a receiving failure; When the program receiving result is a successful reception, repeating the step of sending the program receiving instruction to the ultrasonic water meter terminal according to the upgrade program sequence number until all the upgrade program packages are sent; Sending a restart instruction to the ultrasonic water meter terminal; When the program receiving result is a receiving failure, obtaining the number of retransmissions of the upgrade program package; Determining whether the number of retransmissions is less than a preset number threshold; If the retransmission quantity is less than a preset quantity threshold, resending the program receiving instruction; If the retransmission quantity is not less than the preset quantity threshold, it is determined that the upgrade fails.

3. The method according to claim 2, characterized in that After resending the upgrade program package, the method further includes: The number of retransmissions corresponding to the upgrade package is cleared to zero.

4. An ultrasonic water meter upgrade system supporting infrared function, characterized in that: include: The host computer is used to obtain the upgrade data packet, the upgrade key and the unpacking byte length. The upgrade key is the key used to establish a connection with the ultrasonic water meter terminal; The upgrade data packet is split into multiple upgrade program packages according to the unpacking byte length; a key verification instruction is generated based on the upgrade key, and the key verification instruction is sent to the ultrasonic water meter end for verification through an infrared tooling, and a verification result sent by the ultrasonic water meter end is received, wherein the verification result includes verification success and verification failure; when the verification result is verification failure, it is determined that the upgrade has failed; when the verification result is verification success, an upgrade operation is performed based on the upgrade program package; the key verification instruction is generated based on the upgrade key, and the key verification instruction is sent to the ultrasonic water meter end for verification, including: if the ultrasonic water meter is upgraded for the first time, the initial key of the ultrasonic water meter is determined as the upgrade key, and the key corresponding to the upgraded version is sent to the ultrasonic water meter end; if the ultrasonic water meter is not upgraded for the first time, the key corresponding to the upgraded version is determined as the upgrade key; The ultrasonic water meter is used to respond to the instruction information sent by the host computer, analyze the instruction information, determine the type of the instruction information; determine the execution strategy based on the instruction information type; and process the instruction information based on the execution strategy; The infrared tooling is used to connect the host computer and the ultrasonic water meter to perform data transmission between the host computer and the ultrasonic water meter. The infrared tooling includes an infrared signal receiving device and a connecting line. The connecting line is used to connect the host computer to perform data transmission with the host computer. The infrared signal receiving device is used to connect to the infrared part of the ultrasonic water meter to perform data transmission with the ultrasonic water meter using infrared signals.

5. An ultrasonic water meter upgrade device supporting infrared function, characterized in that: Applied to the host computer, the device includes: An upgrade data acquisition module is used to obtain an upgrade data packet, an upgrade key and an unpacking byte length, wherein the upgrade key is a key used to establish a connection with the ultrasonic water meter terminal; An upgrade program splitting module, used for splitting the upgrade data packet into multiple upgrade program packages according to the unpacking byte length; an instruction sending and receiving module, used for generating a key verification instruction based on the upgrade key, sending the key verification instruction to the ultrasonic water meter end for verification through an infrared tool, and receiving a verification result sent by the ultrasonic water meter end, wherein the verification result includes a successful verification and a failed verification, the infrared tool is used for connecting the host computer and the ultrasonic water meter to perform data transmission between the host computer and the ultrasonic water meter, the infrared tool comprises an infrared signal receiving device and a connecting line, the connecting line is used for connecting the host computer to perform data transmission with the host computer, the infrared signal receiving device is used for connecting to the infrared part of the ultrasonic water meter, and using infrared signals to perform data transmission with the ultrasonic water meter; An upgrade failure determination module, used to determine upgrade failure; An upgrade operation execution module, used to perform an upgrade operation based on the upgrade program package; The instruction sending and receiving module is further specifically used for generating a key verification instruction based on the upgrade key, and sending the key verification instruction to the ultrasonic water meter end for verification, including: If the ultrasonic water meter is upgraded for the first time, the initial key of the ultrasonic water meter is determined as the upgrade key, and the key corresponding to the upgraded version is sent to the ultrasonic water meter end; If the ultrasonic water meter is not upgraded for the first time, the key corresponding to the upgraded version is determined as the upgrade key.