Key device on-line upgrading supervision system and method based on Internet of Things

By the Internet upgrade supervision system based on the Internet of Things, the problem that the existing keys cannot be upgraded online can be solved, and the online upgrade and functional dynamic update of the keys are realized, and the efficiency of equipment work is improved.

CN119336379APending Publication Date: 2025-01-21NANJING MENGBAI INFORMATION IND CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411399223.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing key press cannot be upgraded online, resulting in the need to replace the key press when the equipment needs change, which increases the impact of manual detection and reduces the equipment's working efficiency.

Method used

Using an online upgrade supervision system based on the Internet of Things, the key press number and firmware version information are obtained and uploaded to the server. The server issues online upgrade instructions and firmware upgrade information. The embedded device downloads and authenticates the firmware upgrade information, generates a pre-upgrade list and Monitor the upgrade time and optimize the upgrade list to achieve online upgrade of key presses.

Benefits of technology

The online upgrade of the keys is achieved, the impact of manual detection is avoided, the efficiency of the equipment work is improved, and the dynamic update of the function of the keys is supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336379A_ABST
    Figure CN119336379A_ABST
Patent Text Reader

Abstract

The invention relates to a key device online upgrade supervision system and method based on the Internet of Things, and belongs to the technical field of the Internet of Things. The method specifically comprises the steps that current firmware version information is uploaded to a server according to a preset time interval, the server downloads the firmware upgrading information to a cache region according to the current firmware version information, an online upgrading instruction and the firmware upgrading information, the firmware upgrading information is authenticated, an authentication result is obtained, and when the authentication result is passed, the current firmware version information is uploaded to the server. Obtaining a sub-upgrade package according to the firmware upgrade information, obtaining a pre-upgrade list according to the sub-upgrade package, upgrading the key device according to the pre-upgrade list, monitoring real-time upgrade duration, optimizing the pre-upgrade list to obtain an optimized upgrade list when the real-time upgrade duration is greater than a threshold value, and updating the key device by the embedded device according to the optimized upgrade list. The key device is upgraded, so that the online upgrading of the key device is realized, and the working efficiency of equipment is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Internet of Things, and in particular relates to an online upgrade monitoring system and method for a keypad based on Internet of Things. Background Art

[0002] A key device generally refers to an input device that includes keys, which are widely used in various electronic devices. These keys can send signals or instructions by pressing or releasing them.

[0003] The existing button switches on the market all have simple functions. They rotate for a certain period of time after being powered on and then automatically return to their original position. The functions of each button are fixed by R&D personnel before leaving the factory. It is impossible to realize online upgrades to meet new demands for the button switches, and the only option is to replace the button switches with new ones. This increases the impact of manual inspection and affects the working efficiency of the equipment. Summary of the invention

[0004] In order to solve the above-mentioned problems existing in the prior art, the present invention provides an online upgrade supervision system and method for a key device based on the Internet of Things. By obtaining the key device number information and the current firmware version information of the key device, the current firmware version information is uploaded to the server according to a preset time interval. The server issues an online upgrade instruction and firmware upgrade information according to the current firmware version information. The embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result. When the authentication result is passed, a sub-upgrade package is obtained according to the firmware upgrade information, a pre-upgrade list is obtained according to the sub-upgrade package, the key device is upgraded according to the pre-upgrade list, and the real-time upgrade duration is monitored. When the real-time upgrade duration is greater than a threshold, the pre-upgrade list is optimized to obtain an optimized upgrade list. The embedded device upgrades the key device according to the optimized upgrade list, thereby realizing the online upgrade of the key device, avoiding the influence of manual detection, and improving the working efficiency of the equipment.

[0005] The purpose of the present invention can be achieved through the following technical solutions:

[0006] A method for online upgrade supervision of a keypad based on the Internet of Things comprises the following steps:

[0007] S1: Acquire the number information of the keypad and the current firmware version information of the keypad, wherein the current firmware version information includes the current firmware version level and the current firmware file package;

[0008] S2: uploading the current firmware version information to the server according to a preset time interval, and the server issues an online upgrade instruction and firmware upgrade information according to the current firmware version information, wherein the firmware upgrade information includes the version level of the firmware to be upgraded and the firmware file package to be upgraded;

[0009] S3: the embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result;

[0010] S4: when the authentication result is passed, obtaining a sub-upgrade package according to the firmware upgrade information, and obtaining a pre-upgrade list according to the sub-upgrade package;

[0011] S5: Upgrade the button device according to the pre-upgrade list, monitor the real-time upgrade duration, and when the real-time upgrade duration is greater than a threshold, optimize the pre-upgrade list to obtain an optimized upgrade list. The embedded device upgrades the button device according to the optimized upgrade list.

[0012] Preferably, the button device is connected to the embedded device via a USB bus, and the button device number information is obtained by numbering the button device.

[0013] Preferably, the step S2 specifically includes: the server sends a version level query instruction, and according to the version level query instruction, compares the current firmware version level with the firmware version level to be upgraded; when the current firmware version level is less than the firmware version level to be upgraded, the server encrypts the firmware upgrade information; after encryption, sends the online upgrade instruction and the encrypted firmware upgrade information to the embedded device; when the current firmware version level is greater than or equal to the firmware version level to be upgraded, the current firmware version is not upgraded.

[0014] Preferably, the step S3 specifically includes the following steps:

[0015] S301: The embedded device creates a new file flag in the cache area through the download thread function according to the download request, calls the shell script to download the firmware upgrade information, and notifies the file to start downloading. When the shell script is finished running, the script running return value is obtained. When the script running return value is 0, the file download is notified to be successful. When the script running return value is not 0, the file download is interrupted, and the embedded device generates a download request;

[0016] S302: When the file is downloaded successfully, the encrypted firmware upgrade information is decrypted according to the signature and key contained in the download request, and the hash data of the firmware file package to be upgraded is read, and the signature and the hash data are used as verification data to initiate authentication to the server. When the authentication passes, the firmware upgrade information is retained. When the authentication fails, the firmware upgrade information is deleted and the download request is resubmitted.

[0017] Preferably, the step S4 specifically includes the following steps:

[0018] S401: obtaining a differential upgrade firmware file package through differential processing according to the current firmware file package and the firmware file package to be upgraded, extracting characteristic information from a first information header of the differential upgrade firmware file package, extracting a sub-upgrade package from the differential upgrade firmware file package according to the characteristic information, parsing a second information header of the sub-upgrade package to obtain the button number information to be upgraded and sub-upgrade package information, wherein the sub-upgrade package information includes an upgrade type and an upgrade package size;

[0019] S402: Classify the sub-upgrade packages according to the upgrade type, divide the sub-upgrade packages with the same upgrade type into the same upgrade batch, and obtain the upgrade duration and the pre-upgrade list according to the upgrade batch.

[0020] Preferably, the specific steps of obtaining the upgrade duration according to the upgrade batch are as follows:

[0021] Acquire the test upgrade duration and the number of test firmware according to the upgrade batch, and acquire historical keypad upgrade data according to the upgrade package size, wherein the historical keypad upgrade data includes the historical upgrade duration of the keypad;

[0022] According to the test upgrade duration and the historical keypad upgrade data, the formula The upgrade duration is calculated, where n=p, T c represents the upgrade duration, A1 represents the test upgrade weight, p represents the number of test firmware, t o represents the test upgrade duration of the oth firmware, A2 represents the historical upgrade weight, n represents the number of historical upgraded firmware, t i Indicates the historical upgrade duration of the i-th button device.

[0023] Preferably, the specific calculation method of the test upgrade weight and the historical upgrade weight is as follows:

[0024] Sample data is constructed according to the test upgrade duration and the historical upgrade duration, and the sample data is constructed according to the formula The sample standard deviation and sample standard error are calculated, where S represents the sample standard deviation, W represents the sample standard error, n1 represents the number of sample data, and t j represents the jth sample, represents the sample mean;

[0025] A first confidence interval is set according to the sample standard error, and the first confidence interval is expressed as: Wherein, Z represents a preset variable, and a second confidence interval is set according to the sample mean and the preset error, and the second confidence interval is expressed as: Wherein, t1 represents the preset error. According to the first confidence interval and the second confidence interval, the formula The preset variables are obtained by calculation, and the confidence is obtained through the normal distribution Z value table according to the preset variables. The test upgrade weight and the historical upgrade weight are obtained according to the confidence, and the formula is expressed as follows: Among them, Y represents the confidence level.

[0026] Preferably, the step S5 specifically includes the following steps:

[0027] S501: the embedded device upgrades the button device according to the pre-upgrade list, monitors the real-time upgrade duration of the upgrade batch, and when the real-time upgrade duration is less than or equal to the upgrade duration, the embedded device continues to upgrade the button device according to the pre-upgrade list, and when the real-time upgrade duration is greater than the upgrade duration, obtains the sub-upgrade package that has not started to be upgraded;

[0028] S502: Obtain the historical failure probability of the button device, and generate a random optimization list according to the sub-upgrade package that has not started to be upgraded through random optimization constraints. The random optimization constraints are expressed as: Among them, F x (i) represents the i-th sub-upgrade package of the x-th upgrade batch, i max Indicates the maximum number of sub-upgrade packages in an upgrade batch, G m represents the historical failure probability of the mth button, G min It represents the minimum value of the sum of historical failure probabilities in the same upgrade batch;

[0029] S503: Calculate the success upgrade probability of the random optimization list according to the historical failure probability of the button device. When the success upgrade probability is less than the preset threshold, return to S502, perform random optimization again, calculate the success upgrade probability of the random optimization list, repeat steps S502-S503 until the success upgrade probability is greater than or equal to the preset threshold, and obtain the optimized upgrade list according to the random optimization list;

[0030] S504: The embedded device transparently transmits the sub-upgrade package to the key device through the USB bus according to the optimized upgrade list. After the transmission is completed, the embedded device restarts and uploads the upgrade completion information to the server.

[0031] Preferably, the specific calculation method of the successful upgrade probability is:

[0032] The random optimization list is expressed as: YT = [UT1, UT2, ..., UTn], wherein ST represents the random optimization list, UT1, UT2, ..., UTn represent the 1st, 2nd, 3rd, ..., nth upgrade batches respectively, and the upgrade batch is expressed as: UT = [U1, U2, U3, ..., Uk], wherein UT represents the upgrade batch, U1, U2, U3, ..., Uk represent the 1st, 2nd, 3rd, ..., kth sub-upgrade packages respectively;

[0033] By formula The batch success upgrade probability of the upgrade batch is calculated, where P(UTn) represents the batch success upgrade probability of the nth upgrade batch, and p(Uk) represents the historical failure probability of the button corresponding to the kth sub-upgrade package;

[0034] According to the probability of successful batch upgrade, the formula The success upgrade probability is calculated, where P represents the success upgrade probability, n represents the number of upgrade batches, and P L It represents the probability of successful upgrade of the Lth upgraded batch.

[0035] An online upgrade monitoring system for a keypad based on the Internet of Things, comprising:

[0036] An information acquisition module is used to obtain the number information of the keypad and the current firmware version information of the keypad;

[0037] An information download module, used to upload the current firmware version information to a server according to a preset time interval, the server sends an online upgrade instruction and firmware upgrade information according to the current firmware version information, the embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result;

[0038] The firmware upgrade module obtains a sub-upgrade package according to the firmware upgrade information when the authentication result is passed, obtains a pre-upgrade list according to the sub-upgrade package, upgrades the button according to the pre-upgrade list, monitors the real-time upgrade duration, and optimizes the pre-upgrade list when the real-time upgrade duration is greater than a threshold to obtain an optimized upgrade list. The embedded device upgrades the button according to the optimized upgrade list.

[0039] The beneficial effects of the present invention are:

[0040] 1. By setting an information download module, the current firmware version information is uploaded to the server according to a preset time interval. The server issues an online upgrade instruction and firmware upgrade information according to the current firmware version information. The embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result. By first downloading the firmware upgrade information to the cache area, then authenticating the firmware upgrade information, and upgrading the keypad after authentication, the security of the upgrade process is improved;

[0041] 2. By setting up a firmware upgrade module, a sub-upgrade package is obtained according to the firmware upgrade information, a pre-upgrade list is obtained according to the sub-upgrade package, the button sensor is upgraded according to the pre-upgrade list, and the real-time upgrade duration is monitored. When the real-time upgrade duration is greater than a threshold, the pre-upgrade list is optimized to obtain an optimized upgrade list. The embedded device upgrades the button sensor according to the optimized upgrade list, monitors the button sensor upgrade progress in the pre-upgrade list, optimizes the upgrade list in a timely manner, improves the upgrade efficiency, realizes the online upgrade of the button sensor, avoids the influence of manual detection, and improves the working efficiency of the equipment. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to facilitate understanding by those skilled in the art, the present invention is further described below with reference to the accompanying drawings.

[0043] Figure 1 It is a flow chart of the online upgrade supervision method of the keypad based on the Internet of Things of the present invention;

[0044] Figure 2 It is a flowchart of a specific implementation method in the information download module of the present invention;

[0045] Figure 3 The figure is a flowchart of a specific implementation method in the firmware upgrade module of the present invention. DETAILED DESCRIPTION

[0046] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention are described in detail below in conjunction with the accompanying drawings and preferred embodiments.

[0047] See also Figure 1 , a method for online upgrade supervision of a keypad based on the Internet of Things, comprising the following steps:

[0048] S1: Acquire the number information of the keypad and the current firmware version information of the keypad, wherein the current firmware version information includes the current firmware version level and the current firmware file package;

[0049] S2: uploading the current firmware version information to the server according to a preset time interval, and the server issues an online upgrade instruction and firmware upgrade information according to the current firmware version information, wherein the firmware upgrade information includes the version level of the firmware to be upgraded and the firmware file package to be upgraded;

[0050] S3: the embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result;

[0051] S4: when the authentication result is passed, obtaining a sub-upgrade package according to the firmware upgrade information, and obtaining a pre-upgrade list according to the sub-upgrade package;

[0052] S5: Upgrade the button device according to the pre-upgrade list, monitor the real-time upgrade duration, and when the real-time upgrade duration is greater than a threshold, optimize the pre-upgrade list to obtain an optimized upgrade list. The embedded device upgrades the button device according to the optimized upgrade list.

[0053] It needs to be further explained that since the online upgrade of the button device is to update the specific execution function of the button according to the needs, this is a firmware upgrade. During the firmware upgrade process, the system can no longer perform normal operations, so the operator is required to set the online upgrade time according to the actual working time. The online upgrade of the button device will be carried out at the set online upgrade time. The purpose of setting the cache area is to not overwrite the current firmware version when downloading new firmware upgrade information, and the firmware upgrade will not be affected by network fluctuations during the online upgrade process.

[0054] Specifically, the button device is connected to the embedded device via a USB bus, and the button device number information is obtained by numbering the button device.

[0055] Specifically, the step S2 specifically includes: the server sends a version level query instruction, and according to the version level query instruction, compares the current firmware version level with the firmware version level to be upgraded; when the current firmware version level is less than the firmware version level to be upgraded, the server encrypts the firmware upgrade information; after encryption, sends the online upgrade instruction and the encrypted firmware upgrade information to the embedded device; when the current firmware version level is greater than or equal to the firmware version level to be upgraded, the current firmware version is not upgraded.

[0056] Specifically, step S3 includes the following steps:

[0057] S301: The embedded device creates a new file flag in the cache area through the download thread function according to the download request, calls the shell script to download the firmware upgrade information, and notifies the file to start downloading. When the shell script is finished running, the script running return value is obtained. When the script running return value is 0, the file download is notified to be successful. When the script running return value is not 0, the file download is interrupted, and the embedded device generates a download request;

[0058] S302: When the file is downloaded successfully, the encrypted firmware upgrade information is decrypted according to the signature and key contained in the download request, and the hash data of the firmware file package to be upgraded is read, and the signature and the hash data are used as verification data to initiate authentication to the server. When the authentication passes, the firmware upgrade information is retained. When the authentication fails, the firmware upgrade information is deleted and the download request is resubmitted.

[0059] It should be further explained that when the return value of the script is not 0, the download failed due to network reasons. At this time, the file download is interrupted. After the network is repaired, the download request is regenerated. According to the download request, the file flag of the incomplete download is queried, the file flag is read, and the firmware upgrade information is continued to be downloaded.

[0060] Specifically, the step S4 comprises the following steps:

[0061] S401: obtaining a differential upgrade firmware file package through differential processing according to the current firmware file package and the firmware file package to be upgraded, extracting characteristic information from a first information header of the differential upgrade firmware file package, extracting a sub-upgrade package from the differential upgrade firmware file package according to the characteristic information, parsing a second information header of the sub-upgrade package to obtain the button number information to be upgraded and sub-upgrade package information, wherein the sub-upgrade package information includes an upgrade type and an upgrade package size;

[0062] S402: Classify the sub-upgrade packages according to the upgrade type, divide the sub-upgrade packages with the same upgrade type into the same upgrade batch, and obtain the upgrade duration and the pre-upgrade list according to the upgrade batch.

[0063] It should be further explained that the purpose of obtaining a differential firmware upgrade package by differential processing the current firmware file package and the firmware file package to be upgraded is to delete the parts of the firmware upgrade package that have not been updated, and only retain the parts with updated functions, thereby improving the efficiency of firmware upgrades. The content of the first information header of the differential firmware upgrade package includes information such as the firmware version level, the information header length, and the reserved field, wherein the content of the reserved field includes characteristic information of the upgrade package of the button press, and the characteristic information may be the button press number information, which refers to the sub-upgrade package corresponding to the button press, so as to extract the sub-upgrade package that uniquely corresponds to the characteristic information when decoding the differential firmware upgrade package. The content of the second information header includes the button press number information, the upgrade type, and the upgrade package size.

[0064] Specifically, the specific steps of obtaining the upgrade duration according to the upgrade batch are as follows:

[0065] Acquire the test upgrade duration and the number of test firmware according to the upgrade batch, and acquire historical keypad upgrade data according to the upgrade package size, wherein the historical keypad upgrade data includes the historical upgrade duration of the keypad;

[0066] According to the test upgrade duration and the historical keypad upgrade data, the formula The upgrade duration is calculated, where n=p, T c represents the upgrade duration, A1 represents the test upgrade weight, p represents the number of test firmware, t o represents the test upgrade duration of the oth firmware, A2 represents the historical upgrade weight, n represents the number of historical upgraded firmware, t i Indicates the historical upgrade duration of the i-th button device.

[0067] Specifically, the specific calculation method of the test upgrade weight and the historical upgrade weight is as follows:

[0068] Sample data is constructed according to the test upgrade duration and the historical upgrade duration, and the sample data is constructed according to the formula The sample standard deviation and sample standard error are calculated, where S represents the sample standard deviation, W represents the sample standard error, n1 represents the number of sample data, and t j represents the jth sample, represents the sample mean;

[0069] A first confidence interval is set according to the sample standard error, and the first confidence interval is expressed as: Wherein, Z represents a preset variable, and a second confidence interval is set according to the sample mean and the preset error, and the second confidence interval is expressed as: Wherein, t1 represents the preset error. According to the first confidence interval and the second confidence interval, the formula The preset variables are obtained by calculation, and the confidence is obtained through the normal distribution Z value table according to the preset variables. The test upgrade weight and the historical upgrade weight are obtained according to the confidence, and the formula is expressed as follows: Among them, Y represents the confidence level.

[0070] It should be further explained that the test upgrade time refers to the test upgrade time obtained by the test engineer after the test before the firmware upgrade information is released, and the historical upgrade time refers to the historical upgrade time of the same upgrade package size, which is obtained by retrieving the historical keypad upgrade data from the database based on the upgrade package size.

[0071] Specifically, the step S5 comprises the following steps:

[0072] S501: the embedded device upgrades the button device according to the pre-upgrade list, monitors the real-time upgrade duration of the upgrade batch, and when the real-time upgrade duration is less than or equal to the upgrade duration, the embedded device continues to upgrade the button device according to the pre-upgrade list, and when the real-time upgrade duration is greater than the upgrade duration, obtains the sub-upgrade package that has not started to be upgraded;

[0073] S502: Obtain the historical failure probability of the button device, and generate a random optimization list according to the sub-upgrade package that has not started to be upgraded through random optimization constraints. The random optimization constraints are expressed as: Among them, F x (i) represents the i-th sub-upgrade package of the x-th upgrade batch, i max Indicates the maximum number of sub-upgrade packages in an upgrade batch, G m represents the historical failure probability of the mth button, G min It represents the minimum value of the sum of historical failure probabilities in the same upgrade batch;

[0074] S503: Calculate the success upgrade probability of the random optimization list according to the historical failure probability of the button device. When the success upgrade probability is less than the preset threshold, return to S502, perform random optimization again, calculate the success upgrade probability of the random optimization list, repeat steps S502-S503 until the success upgrade probability is greater than or equal to the preset threshold, and obtain the optimized upgrade list according to the random optimization list;

[0075] S504: The embedded device transparently transmits the sub-upgrade package to the key device through the USB bus according to the optimized upgrade list. After the transmission is completed, the embedded device restarts and uploads the upgrade completion information to the server.

[0076] It should be further explained that the maximum number of sub-upgrade packages and the minimum value of the sum of historical failure probabilities are preset in advance. The purpose is to divide the upgrade batches and sub-upgrade packages of the upgrade batches. When the embedded device upgrades the button device according to the optimized upgrade list, the button device number information is parsed from the sub-upgrade package in the optimized upgrade list, and the corresponding sub-upgrade package is transparently transmitted to the button device through the USB bus for upgrading.

[0077] Specifically, the specific calculation method of the successful upgrade probability is:

[0078] The random optimization list is expressed as: YT = [UT1, UT2, ..., UTn], wherein ST represents the random optimization list, UT1, UT2, ..., UTn represent the 1st, 2nd, 3rd, ..., nth upgrade batches respectively, and the upgrade batch is expressed as: UT = [U1, U2, U3, ..., Uk], wherein UT represents the upgrade batch, U1, U2, U3, ..., Uk represent the 1st, 2nd, 3rd, ..., kth sub-upgrade packages respectively;

[0079] By formula The batch success upgrade probability of the upgrade batch is calculated, where P(UTn) represents the batch success upgrade probability of the nth upgrade batch, and p(Uk) represents the historical failure probability of the button corresponding to the kth sub-upgrade package;

[0080] According to the probability of successful batch upgrade, the formula The success upgrade probability is calculated, where P represents the success upgrade probability, n represents the number of upgrade batches, and P L It represents the probability of successful upgrade of the Lth upgraded batch.

[0081] Furthermore, the present invention also provides an online upgrade monitoring system for a keypad based on the Internet of Things, comprising:

[0082] An information acquisition module is used to obtain the number information of the keypad and the current firmware version information of the keypad;

[0083] An information download module, used to upload the current firmware version information to a server according to a preset time interval, the server sends an online upgrade instruction and firmware upgrade information according to the current firmware version information, the embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result;

[0084] The firmware upgrade module obtains a sub-upgrade package according to the firmware upgrade information when the authentication result is passed, obtains a pre-upgrade list according to the sub-upgrade package, upgrades the button according to the pre-upgrade list, monitors the real-time upgrade duration, and optimizes the pre-upgrade list when the real-time upgrade duration is greater than a threshold to obtain an optimized upgrade list. The embedded device upgrades the button according to the optimized upgrade list.

[0085] The working principle and use process of the present invention:

[0086] The information acquisition module obtains the button device number information and the current firmware version information of the button device, and uploads the current firmware version information to the server according to the preset time interval. The server issues online upgrade instructions and firmware upgrade information according to the current firmware version information. The embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to the cache area according to the download request, and authenticates the firmware upgrade information to obtain the authentication result. When the authentication result is passed, a sub-upgrade package is obtained according to the firmware upgrade information, a pre-upgrade list is obtained according to the sub-upgrade package, and the button device is upgraded according to the pre-upgrade list. The real-time upgrade duration is monitored. When the real-time upgrade duration is greater than the threshold, the pre-upgrade list is optimized to obtain an optimized upgrade list. The embedded device upgrades the button device according to the optimized upgrade list.

[0087] The program code included in the method in the embodiment of the present invention can be transmitted with any appropriate medium, including but not limited to wireless, electric wire, optical cable, etc., or any suitable combination mentioned above. The computer program code for performing the operation of the present invention can be written with one or more programming languages ​​or their combination, and the programming language includes object-oriented programming languages--such as Java, Smalltalk, C++, and also includes conventional procedural programming languages--such as "C" language or similar programming languages. The program code can be executed completely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on the remote computer, or executed completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0088] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technical personnel in this field can make some changes or modify the technical contents disclosed above into equivalent embodiments without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.

Claims

1. A method for online upgrade supervision of a keypad based on the Internet of Things, characterized in that: The following steps are involved: S1: Acquire the number information of the keypad and the current firmware version information of the keypad, wherein the current firmware version information includes the current firmware version level and the current firmware file package; S2: uploading the current firmware version information to the server according to a preset time interval, and the server issues an online upgrade instruction and firmware upgrade information according to the current firmware version information, wherein the firmware upgrade information includes the version level of the firmware to be upgraded and the firmware file package to be upgraded; S3: the embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result; S4: when the authentication result is passed, obtaining a sub-upgrade package according to the firmware upgrade information, and obtaining a pre-upgrade list according to the sub-upgrade package; S5: Upgrade the button device according to the pre-upgrade list, monitor the real-time upgrade duration, and when the real-time upgrade duration is greater than a threshold, optimize the pre-upgrade list to obtain an optimized upgrade list. The embedded device upgrades the button device according to the optimized upgrade list.

2. According to the method for online upgrade supervision of a keypad based on the Internet of Things according to claim 1, it is characterized in that: The key device is connected to the embedded device via a USB bus, and the key device number information is obtained by numbering the key device.

3. According to the method for online upgrade supervision of a keypad based on the Internet of Things in claim 1, it is characterized in that: The step S2 specifically includes: the server sends a version level query instruction, and according to the version level query instruction, compares the current firmware version level with the firmware version level to be upgraded; when the current firmware version level is lower than the firmware version level to be upgraded, the server encrypts the firmware upgrade information; after encryption, sends the online upgrade instruction and the encrypted firmware upgrade information to the embedded device; when the current firmware version level is greater than or equal to the firmware version level to be upgraded, the current firmware version is not upgraded.

4. According to the method for online upgrade supervision of a keypad based on the Internet of Things as described in claim 1, it is characterized in that: The step S3 specifically comprises the following steps: S301: The embedded device creates a new file flag in the cache area through the download thread function according to the download request, calls the shell script to download the firmware upgrade information, and notifies the file to start downloading. When the shell script is finished running, the script running return value is obtained. When the script running return value is 0, the file download is notified to be successful. When the script running return value is not 0, the file download is interrupted and the embedded device resubmits the download request. S302: When the file is downloaded successfully, the encrypted firmware upgrade information is decrypted according to the signature and key contained in the download request, and the hash data of the firmware file package to be upgraded is read, and the signature and the hash data are used as verification data to initiate authentication to the server. When the authentication passes, the firmware upgrade information is retained. When the authentication fails, the firmware upgrade information is deleted and the download request is resubmitted.

5. The method for online upgrade supervision of a keypad based on the Internet of Things according to claim 1 is characterized in that: The step S4 specifically comprises the following steps: S401: obtaining a differential upgrade firmware file package through differential processing according to the current firmware file package and the firmware file package to be upgraded, extracting characteristic information from a first information header of the differential upgrade firmware file package, extracting a sub-upgrade package from the differential upgrade firmware file package according to the characteristic information, parsing a second information header of the sub-upgrade package to obtain the button number information to be upgraded and sub-upgrade package information, wherein the sub-upgrade package information includes an upgrade type and an upgrade package size; S402: Classify the sub-upgrade packages according to the upgrade type, divide the sub-upgrade packages with the same upgrade type into the same upgrade batch, and obtain the upgrade duration and the pre-upgrade list according to the upgrade batch.

6. The method for online upgrade supervision of a keypad based on the Internet of Things according to claim 5 is characterized in that: The specific steps of obtaining the upgrade duration according to the upgrade batch are as follows: Acquire the test upgrade duration and the number of test firmware according to the upgrade batch, and acquire historical keypad upgrade data according to the upgrade package size, wherein the historical keypad upgrade data includes the historical upgrade duration of the keypad; According to the test upgrade duration and the historical keypad upgrade data, the formula The upgrade duration is calculated, where n=p, T c represents the upgrade duration, A1 represents the test upgrade weight, p represents the number of test firmware, t o represents the test upgrade duration of the o-th firmware, A2 represents the historical upgrade weight, n represents the number of historical upgraded firmware, t i represents the historical upgrade duration of the i-th key controller.

7. The method for online upgrade and supervision of a keypad based on the Internet of Things according to claim 6 is characterized in that: The specific calculation method of the test upgrade weight and the historical upgrade weight is as follows: Sample data is constructed according to the test upgrade duration and the historical upgrade duration, and the sample data is constructed according to the formula The sample standard deviation and sample standard error are calculated, where S represents the sample standard deviation, W represents the sample standard error, n1 represents the number of sample data, and t j represents the jth sample, represents the sample mean; A first confidence interval is set according to the sample standard error, and the first confidence interval is expressed as: Wherein, Z represents a preset variable, and a second confidence interval is set according to the sample mean and the preset error, and the second confidence interval is expressed as: Wherein, t1 represents the preset error. According to the first confidence interval and the second confidence interval, the formula The preset variables are obtained by calculation, and the confidence is obtained through the normal distribution Z value table according to the preset variables. The test upgrade weight and the historical upgrade weight are obtained according to the confidence, and the formula is expressed as follows: Among them, Y represents the confidence level.

8. The method for online upgrade supervision of a keypad based on the Internet of Things according to claim 1 is characterized in that: The step S5 specifically comprises the following steps: S501: the embedded device upgrades the button device according to the pre-upgrade list, monitors the real-time upgrade duration of the upgrade batch, and when the real-time upgrade duration is less than or equal to the upgrade duration, the embedded device continues to upgrade the button device according to the pre-upgrade list, and when the real-time upgrade duration is greater than the upgrade duration, obtains the sub-upgrade package that has not started to be upgraded; S502: Obtain the historical failure probability of the button device, and generate a random optimization list according to the sub-upgrade package that has not started to be upgraded through random optimization constraints. The random optimization constraints are expressed as: Among them, F x (i) represents the i-th sub-upgrade package of the x-th upgrade batch, i max Indicates the maximum number of sub-upgrade packages in an upgrade batch, G m represents the historical failure probability of the mth button, G min It represents the minimum value of the sum of historical failure probabilities in the same upgrade batch; S503: Calculate the success upgrade probability of the random optimization list according to the historical failure probability of the button device. When the success upgrade probability is less than the preset threshold, return to S502, perform random optimization again, calculate the success upgrade probability of the random optimization list, repeat steps S502-S503 until the success upgrade probability is greater than or equal to the preset threshold, and obtain the optimized upgrade list according to the random optimization list; S504: The embedded device transparently transmits the sub-upgrade package to the key device through the USB bus according to the optimized upgrade list. After the transmission is completed, the embedded device restarts and uploads the upgrade completion information to the server.

9. The method for online upgrade supervision of a keypad based on the Internet of Things according to claim 8 is characterized in that: The specific calculation method of the successful upgrade probability is: The random optimization list is expressed as: YT = [UT1, UT2, ..., UTn], wherein ST represents the random optimization list, UT1, UT2, ..., UTn represent the 1st, 2nd, 3rd, ..., nth upgrade batches respectively, and the upgrade batch is expressed as: UT = [U1, U2, U3, ..., Uk], wherein UT represents the upgrade batch, and U1, U2, U3, ..., Uk represent the 1st, 2nd, 3rd, ..., kth sub-upgrade packages respectively; By formula The success rate of the upgrade batch is calculated, where: P ( UT n) represents the probability of successful upgrade of the nth upgrade batch, p( Uk ) represents the historical failure probability of the keypad corresponding to the kth sub-upgrade package; According to the probability of successful batch upgrade, the formula The success upgrade probability is calculated, where P represents the success upgrade probability, n represents the number of upgrade batches, P L represents the probability of successful upgrading of the Lth upgraded batch.

10. A system for online upgrade and supervision of a keypad based on the Internet of Things, the system adopts the method for online upgrade and supervision of a keypad based on the Internet of Things as claimed in claim 1, characterized in that: include: An information acquisition module is used to obtain the number information of the keypad and the current firmware version information of the keypad; An information download module, used to upload the current firmware version information to a server according to a preset time interval, the server sends an online upgrade instruction and firmware upgrade information according to the current firmware version information, the embedded device generates a download request according to the online upgrade instruction, downloads the firmware upgrade information to a cache area according to the download request, and authenticates the firmware upgrade information to obtain an authentication result; The firmware upgrade module obtains a sub-upgrade package according to the firmware upgrade information when the authentication result is passed, obtains a pre-upgrade list according to the sub-upgrade package, upgrades the button according to the pre-upgrade list, monitors the real-time upgrade duration, and optimizes the pre-upgrade list when the real-time upgrade duration is greater than a threshold to obtain an optimized upgrade list. The embedded device upgrades the button according to the optimized upgrade list.

Citation Information

Cited By

  • Multi-mode software upgrade method and system for embedded system

    CN119759394A