Rollable program upgrading method for programming in application

By setting up a marking area and a detection area in the device storage area, and using valid marker bits for program transmission and verification, the problem of interruption during device program upgrades is solved, thereby improving device availability and program upgrade efficiency.

CN121387322APending Publication Date: 2026-01-23HANGZHOU KANGBEI MOTOR
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511441707.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-01-23

AI Technical Summary

Technical Problem

During the equipment program upgrade process, equipment operation was interrupted, resulting in reduced equipment availability.

Method used

By splitting the storage area into a marking area and a detection area, and setting valid and invalid flag bits, the control module only analyzes the valid flag bits for program transmission and verification, ensuring that the device remains available during program upgrades.

Benefits of technology

It improves the operational availability of the device during program upgrades, reduces device restarts and interruptions, and improves the efficiency of transferring and writing new programs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121387322A_ABST
    Figure CN121387322A_ABST
Patent Text Reader

Abstract

The invention relates to a rollback program upgrading method for programming in an application, which relates to the technical field of program upgrading, and comprises the following steps: splitting a preset storage area into a mark area and a detection area, setting an invalid mark bit for the mark area, and setting an effective mark bit for the detection area; a preset operation module is controlled to select and operate according to the effective mark bit, and trigger information is collected; when the trigger information is consistent with the preset reference information, erasing the partition corresponding to the invalid flag bit; transmission information is obtained through the triggering information and the marking area; and performing program input verification based on the transmission information and the invalid flag bit, and setting an effective flag bit for the flag area and an invalid flag bit for the detection area after the program is input and trial operation is passed. The method and the device have the effect of improving the usability of equipment operation during program upgrading.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of program upgrading, in particular to a rollbackable program upgrading method programmed in application. BACKGROUND

[0002] Program upgrading is a means of updating the version, optimizing the function or repairing the problem of the software deployed in the device.

[0003] In the process of upgrading the program of the device, the FLASH (flash memory) of the ECU (electronic control unit) of the device is divided into a Boot area (boot loader area), an APP0 area (application program 0 area) and an APP1 area (application program 1 area), the application program effective flag bits of the APP0 area and the APP1 area are set, and the data contents of the two address intervals of the APP0 area and the App1 area are configured as the to-be-upgraded file, the boot loader determines the to-be-upgraded address interval according to the current application program effective flag bit, writes the data contents of the to-be-upgraded address interval in the to-be-upgraded file into the to-be-upgraded address interval, and finally checks the written data, if the checking is successful, the application program effective flag bit is set as valid.

[0004] In the process of upgrading the program of the device, the device first jumps to the Boot area and then updates in the application program area, needs to restart the device to enter the integrated communication protocol stack of the Bootloader in the Boot area for upgrading, which causes the interruption of the running of the device. SUMMARY

[0005] In order to improve the availability of the device running during program upgrading, the present application provides a rollbackable program upgrading method programmed in application.

[0006] The present application provides a rollbackable program upgrading method programmed in application, which adopts the following technical scheme: A rollbackable program upgrading method programmed in application, comprising: S10: splitting a preset storage area into a marking area and a detection area, setting an invalid marking bit for the marking area, and setting a valid marking bit for the detection area; S11: controlling a preset running module to select and run with the valid marking bit, and collecting trigger information; S12: erasing the partition corresponding to the invalid marking bit when the trigger information is consistent with preset reference information; S13: obtaining transmission information by the trigger information and the marking area; S14: performing program input checking based on the transmission information and the invalid marking bit, and setting the valid marking bit for the marking area and the invalid marking bit for the detection area after the program is completed and passed the trial running.

[0007] By adopting the technical scheme, the running module is controlled to analyze only the effective mark bit and the invalid mark bit to call the partition corresponding to the mark bit to run the program, so that the transmission and writing of the new program can be performed in the process of program running, and the availability of the device running during program upgrading is improved.

[0008] Optionally, the method for performing program input verification based on the transmission information and the invalid mark bit comprises: S20: collecting detection verification information of the invalid mark bit based on a CRC verification mode; S21: obtaining reference verification information through the transmission information; S22: when the detection verification information is consistent with the reference verification information, continuing to set the effective mark bit for the mark area; S23: when the detection verification information is inconsistent with the reference verification information, continuing to set the invalid mark bit for the mark area.

[0009] Optionally, the method further comprises: S30: splitting the buffer area based on the storage area, and calling transmission text from the transmission information; S31: calling historical detection information from the detection area; S32: obtaining historical running text through the historical detection information; S33: comparing the transmission text with the historical running text to obtain difference text; S34: calling difference program positions from the transmission information based on the difference text; S35: obtaining difference transmission information according to the difference program positions and the transmission information; S36: obtaining historical combination information according to the difference program positions and the historical detection information; S37: inputting the difference transmission information and the historical combination information into the buffer area and combining them to update the transmission information.

[0010] Optionally, the method for performing program input verification based on the transmission information and the invalid mark bit further comprises: S40: collecting a hardware type and surrounding environment parameters; S41: calling reference environment parameters from the hardware type; S42: comparing consistency of the surrounding environment parameters and the reference environment parameters to terminate transmission when a preset reference deviation time length is reached; S43: obtaining a mark transmission section based on the surrounding environment parameters, the reference environment parameters, and the reference deviation time length; S44: obtaining a mark transmission position through the hardware type, the surrounding environment parameters, and the mark transmission section; S45: transmitting the write based on the transmission information and starting the transmission at the marked transmission position of the transmission information.

[0011] Optionally, the method for obtaining the marked transmission position comprises: S50: collecting running information of the hardware type; S51: obtaining a transmission time interval based on the hardware type and the surrounding environment parameter; S52: comparing the running information with preset reference running information to obtain an interval correction coefficient; S53: updating the transmission time interval based on the interval correction coefficient; S54: obtaining an estimated transmission duration based on the running information and the transmission information; S55: obtaining a transmission time point based on the estimated transmission duration and the transmission time interval; S56: obtaining a marked time point at which the surrounding environment parameter is inconsistent with the reference environment parameter from the marked transmission segment; S57: obtaining the marked transmission position based on the marked time point and the transmission time point.

[0012] Optionally, the method for obtaining the transmission time interval comprises: S60: obtaining a hardware parameter from the hardware type; S61: obtaining a marked time interval based on the hardware parameter and the running information; S62: obtaining a deviation environment parameter by comparing the surrounding environment parameter with the reference environment parameter; S63: obtaining a correction coefficient based on the deviation environment parameter and the hardware type; S64: obtaining the transmission time interval based on the correction coefficient and the marked time interval.

[0013] Optionally, the method for obtaining the marked transmission position further comprises: S70: selecting a transmission time point closest to the marked time point from the transmission time points as a neighboring time point; S71: obtaining a deviation running information by comparing the running information with preset reference running information; S72: obtaining a deviation transmission segment of the marked time point based on the deviation running information and the transmission information; S73: obtaining a target time point based on the deviation transmission segment and the marked time point; S74: updating the neighboring time point based on the target time point; S75: taking the neighboring time point not exceeding the target time point as a selected time point, and taking a position in the transmission information corresponding to the selected time point as the marked transmission position.

[0014] Optionally, the check method of the transmission time interval comprises: S80: collecting a detection load rate of the hardware; S81: calling a reference load rate from the hardware type; S82: calculating a difference between the detection load rate and the reference load rate as a load deviation value; S83: updating the running information based on the load deviation value; S84: obtaining load transmission information by the load deviation value and the hardware type; S85: combining the running information and the load transmission information to update the transmission time interval.

[0015] By using the above technical solution, when the surrounding environment parameter is inconsistent with the reference environment parameter, the transmission is terminated for the reference deviation time length, the marked transmission position is obtained by analyzing the hardware type, the surrounding environment parameter and the marked transmission section, and the data is retransmitted and written from the marked transmission position, so that the data is retransmitted and written from the marked transmission position, and the efficiency of the new data transmission and writing is improved when the data needs to be retransmitted and written.

[0016] Optionally, the method further comprises: S90: calling the deviation transmission information from the deviation transmission section; S91: obtaining data integrity and data interval positions based on the deviation transmission information; S92: obtaining a data interval time length based on the data interval positions; S93: calling a vibration interval time length from the surrounding environment parameter; S94: comparing the vibration interval time length and the data interval time length to obtain a vibration abnormal type, and reporting and prompting.

[0017] Optionally, the method further comprises: S100: obtaining interval information by the deviation transmission information and the data interval positions; S101: updating the surrounding environment parameter based on the continuity of the interval information; S102: obtaining change environment information according to the surrounding environment parameters before and after the update; S103: obtaining a marked change time length according to the change environment information, the hardware type and the running information; S104: comparing the marked change time length and the data interval time length to obtain an environment abnormal type, and reporting and prompting.

[0018] By adopting the technical scheme, the consistency of the data interval duration, the label change duration and the vibration interval duration is analyzed to obtain the environment abnormal type or the vibration abnormal type, and a report is given to prompt the operator to handle, so that the cause of the data transmission abnormality can be obtained and the operator is prompted to handle.

[0019] In summary, the present application has at least one of the following beneficial technical effects: 1. By controlling the running module to analyze only the valid mark bit and the invalid mark bit to call the partition corresponding to the mark bit to run the program, the transmission and writing of the new program during the program running process can be realized, and the availability of the device running during the program upgrade can be improved. 2. After the surrounding environment parameter is inconsistent with the reference environment parameter and the transmission is terminated after the reference deviation duration, the mark transmission position is obtained by analyzing the hardware type, the surrounding environment parameter and the mark transmission segment, and the transmission and writing is restarted from the mark transmission position, so that the transmission and writing can be restarted directly from the mark transmission position, and the efficiency of the new data transmission and writing can be improved when the data needs to be transmitted and written again. 3. By analyzing the consistency of the data interval duration, the label change duration and the vibration interval duration, the environment abnormal type or the vibration abnormal type is obtained, and a report is given to prompt the operator to handle, so that the cause of the data transmission abnormality can be obtained and the operator is prompted to handle. BRIEF DESCRIPTION OF DRAWINGS

[0020] Figure 1 is a method flow chart of a rollbackable in-application programming program upgrade method of an embodiment of the present application; Figure 2 is a method flow chart of a program input check based on transmission information and invalid mark bits of an embodiment of the present application. DETAILED DESCRIPTION

[0021] The present application will be further described in detail below with reference to the accompanying drawings and embodiments.

[0022] Referring to Figure 1 The present application discloses a rollbackable in-application programming program upgrade method, comprising the following steps: S10: split a preset storage area into a mark area and a detection area, set an invalid mark bit for the mark area, and set a valid mark bit for the detection area.

[0023] The storage area is a flash memory area of a device preset by a technician. Two sub-areas are split from the storage area, and are defined as a detection area and a marking area. The detection area refers to an application program area currently used for storing and running an old program, and the marking area refers to an application program area used in advance for receiving a new program to be upgraded. In this embodiment, the detection area is an APP0 area, and the marking area is an APP1 area.

[0024] The invalid marking bit refers to a partition number used for receiving a new program, and the valid marking bit refers to a partition used for storing a program required to be run by a current device. In this embodiment, the invalid marking bit can be set as 0x00, and the valid marking bit can be set as 0x01.

[0025] S11: The preset running module is controlled to be selected and run with the valid marking bit, and trigger information is collected.

[0026] The running module is a boot loader area set by a technician. The detection area (APP0 area) corresponding to the valid marking bit is located by controlling the running module, and the device is guided to load the old program in the detection area, so as to ensure normal operation of the device.

[0027] The trigger information refers to a signal triggering program upgrade. Specifically, the trigger information is an upgrade instruction (such as “0xAA55-0x01”, in which “0x01” indicates upgrade triggering) sent by an external sending end (such as a computer) and received by the device through a preset communication interface (such as a serial port, a network, or Bluetooth). The trigger information needs to carry an explicit instruction feature of “starting upgrade”, and is used to trigger a subsequent upgrade process.

[0028] S12: When the trigger information is consistent with preset reference information, a partition corresponding to the invalid marking bit is erased.

[0029] The reference information is a reference instruction set by a technician for verifying program upgrade, such as “0xAA55-0x01”. When the trigger information is consistent with the reference information, it is indicated that the device needs to receive a new program for program upgrade. Therefore, the old program in the currently running detection area (APP0 area) calls a FLASH erase interface (such as HAL_FLASH_Erase), performs a “full partition erasing” operation on the marking area (APP1 area) corresponding to the invalid marking bit (0x00), and clears residual data in the partition, so as to vacate clean storage space for subsequent reception of a new program.

[0030] S13: Transmission information is obtained by the trigger information and the marking area.

[0031] The transmission information refers to new program data to be written into the mark area. When the trigger information is consistent with the reference information, the external sending end (such as a computer) sends new program data to the device based on the "upgrade instruction" in the trigger information through a preset communication interface (such as a serial port, a network or Bluetooth). The data includes a code segment, a data segment, a reference CRC value for subsequent verification and a function description text caused by program upgrade.

[0032] S14: Based on the transmission information and the invalid mark bit, program input verification is performed, and after the program is completed and the trial run is passed, the valid mark bit is set for the mark area and the invalid mark bit is set for the detection area.

[0033] The old program in the currently running detection area (APP0 area) receives the transmission information, first reads the invalid mark bit (0x00) to confirm that the storage partition is the mark area (APP1 area), and then according to the frame serial number and address information in the transmission information, calls the FLASH write interface (such as HAL_FLASH_Program), and writes the transmission information into the corresponding address of the mark area (APP1 area) frame by frame. When the program is completed and the trial run is passed, it is indicated that the new program can run, and the valid mark bit is set for the mark area and the invalid mark bit is set for the detection area, so that the device is guided to load the new program in the mark area by the boot loader area.

[0034] In the embodiment, when the device cannot run after loading the new program for trial run, the detection area is not replaced, the detection area still has the valid mark bit, and the boot loader area continues to guide the device to load the old program in the detection area for continuous running.

[0035] Reference Figure 2 , the method for performing program input verification based on the transmission information and the invalid mark bit comprises: S20: Based on the CRC verification mode, detection verification information of the invalid mark bit is collected.

[0036] The CRC verification mode refers to a cyclic redundancy check algorithm for verifying data integrity, which is not described herein. The CRC verification mode is a standard CRC32 verification algorithm. The detection verification information is a verification value generated by the CRC verification mode. The transmission information is verified by the CRC verification mode to obtain the detection verification information. The method for obtaining the detection verification information of the transmission information based on the CRC verification mode is known to those skilled in the art, and is not described herein.

[0037] S21: Reference verification information is obtained through the transmission information.

[0038] The reference check information is a check value of the transmission information obtained by the external sending end in advance in a CRC check manner. The reference check information is sent to the device together with the transmission information, and then the reference check information is retrieved from the transmission information.

[0039] S22: When the detection check information is consistent with the reference check information, continue to set the valid mark bit for the mark area.

[0040] When the detection check information is consistent with the reference check information, it indicates that the new program data is not damaged in the transmission and writing process, has normal operation conditions and performs a trial run. When the trial run is passed, the valid mark bit is continued to be set for the mark area, and the invalid mark bit is set for the detection area.

[0041] S23: When the detection check information is inconsistent with the reference check information, continue to set the invalid mark bit for the mark area.

[0042] When the detection check information is inconsistent with the reference check information, or the trial run is not passed, it is determined that the new program data is damaged (such as transmission packet loss, writing error), and does not have operation conditions. Then, the invalid mark bit is continued to be set for the mark area, and the valid mark bit of the detection area is not adjusted.

[0043] Further comprising: S30: Retrieving the transmission text from the transmission information based on the storage area to split the buffer area.

[0044] The buffer area is a temporary space for data processing, and a new split area is split from the storage area as a buffer area.

[0045] The transmission text is a description text of the program upgrade corresponding to the transmission information, such as "add communication function, optimize data sampling frequency to 10Hz". The transmission text is retrieved from the transmission information.

[0046] S31: Retrieve the historical detection information from the detection area.

[0047] The historical detection information is the transmission information stored in the detection area, and the transmission information is retrieved from the detection area as the historical detection information.

[0048] S32: Obtain the historical operation text by the historical detection information.

[0049] The historical operation text is a function text of the program corresponding to the historical detection information, and the function text of the program is retrieved from the historical detection information as the historical operation text.

[0050] S33: Compare the transmission text with the historical operation text to obtain the difference text.

[0051] The difference text refers to the part of the transmission text that is inconsistent with the function description in the historical running text. By comparing the transmission text with the historical running text sentence by sentence, the difference part (such as the transmission text has "4G communication" while the historical text does not, or the difference between "sampling frequency 10Hz" and "5Hz") is extracted, combined into a difference text, and stored in the difference area of the buffer area.

[0052] S34: Based on the difference text, the difference program location is retrieved from the transmission information.

[0053] The difference program location refers to the storage address range (such as 0x08082000-0x08083000, corresponding to the "4G communication module driver" code) of the code segment in the mark area (APP1 area) that implements the function described in the difference text in the transmission information. The difference text is matched from the preset difference comparison table to obtain the difference program location.

[0054] The difference comparison table stores the code segment of the transmission information corresponding to different function texts. The parameters of the difference comparison table are set by the person skilled in the art in advance based on the code and function text matching experiments, which will not be described here.

[0055] S35: According to the difference program location and the transmission information, the difference transmission information is obtained.

[0056] The difference transmission information refers to the code segment and data segment in the transmission information corresponding to the difference program location. By the difference program location (such as 0x08082000-0x08083000), the data corresponding to the difference program location is extracted from the transmission information that has been written into the mark area (APP1 area), and stored as difference transmission information in the buffer area.

[0057] S36: According to the difference program location and the historical detection information, the historical combination information is obtained.

[0058] The historical combination information refers to the code segment in the historical detection information that is related to the function of the difference program location, such as the "data sampling basic framework" code in the old program (the new program only modifies the sampling frequency parameter). By the historical detection information, the corresponding program location is matched from the difference comparison table, and the program location related to the difference program location is retrieved as the historical combination information.

[0059] The difference comparison table stores the program location corresponding to different historical detection information, which will not be described here.

[0060] S37: The difference transmission information and the historical combination information are input into the buffer area and combined to update the transmission information.

[0061] By taking the historical combination information as a basis framework, replacing the modified part in the difference transmission information (such as reserving the old program "data sampling framework", and only replacing the "frequency parameter" code), a new program segment compatible with the old framework is formed, and the combined new program segment is combined with other segments of the historical detection information to rewrite the mark area (APP1 area). In this embodiment, under the condition of ensuring that the new program is compatible with the core framework of the old program, the mark area stops data transmission after completing the write verification of the difference transmission information, which can reduce the writing time of the mark area and improve the efficiency of program upgrading.

[0062] The method for program input verification based on transmission information and invalid mark bits further comprises: S40: Collecting hardware type and surrounding environment parameters.

[0063] The hardware type refers to the model and core hardware configuration of the device, which can be obtained by pre-inputting by the operator.

[0064] The surrounding environment parameters refer to the environmental physical quantities around the position of the hardware type, such as temperature and humidity, vibration, etc., which are obtained by detecting various sensors pre-set around the position of the hardware type.

[0065] S41: Retrieving the reference environment parameters from the hardware type.

[0066] The reference environment parameters refer to the environmental range for normal operation of the hardware type, which are obtained by retrieving the reference environment parameters from the hardware type.

[0067] S42: Comparing the consistency of the surrounding environment parameters and the reference environment parameters to terminate transmission by a pre-set reference deviation time length.

[0068] The reference deviation time length is a time length set by the technician to facilitate subsequent knowledge of abnormal extension of data reception.

[0069] When comparing the consistency of the surrounding environment parameters and the reference environment parameters, if the surrounding environment parameters and the reference environment parameters are consistent, it means that the environment of the hardware is a normal operating environment, and no adjustment is made.

[0070] When the surrounding environment parameters and the reference environment parameters are inconsistent, it means that the environment of the hardware is not a normal operating environment, and the hardware continues to operate for a reference deviation time length. After the reference deviation time length, if the surrounding environment parameters and the reference environment parameters are still inconsistent, the transmission is terminated.

[0071] S43: Obtaining the mark transmission segment based on the surrounding environment parameters, the reference environment parameters, and the reference deviation time length.

[0072] The marked transmission segment refers to a program segment transmitted within a reference deviation time length when the surrounding environment parameter is inconsistent with the reference environment parameter. When the surrounding environment parameter is inconsistent with the reference environment parameter, the time point is recorded, the time is extended by the reference deviation time length to obtain a new time point, and the transmission information between the two time points is transmitted as a marked transmission segment.

[0073] S44: obtaining a marked transmission position by the hardware type, the surrounding environment parameter and the marked transmission segment.

[0074] The marked transmission position refers to a program address in the transmission information where the transmission starts. The marked transmission position is obtained by analyzing the hardware type, the surrounding environment parameter and the marked transmission segment.

[0075] S45: retransmitting based on the transmission information and starting transmission and writing from the marked transmission position of the transmission information.

[0076] When the surrounding environment parameter is consistent with the reference environment parameter, it indicates that the hardware is in a normal operating environment, and the transmission information can be retransmitted. Then, the value mark area is written from the marked transmission position of the transmission information.

[0077] The method for obtaining the marked transmission position comprises: S50: collecting operating information of the hardware type.

[0078] The operating information refers to parameter information of the hardware type when it is operating, including: communication interface transmission rate (such as serial port 115200 bps), FLASH writing speed (such as 10 KB / s), network transmission rate and Bluetooth transmission rate, etc. It is obtained by a performance monitoring register built in the MCU or software statistics (such as periodically calculating CPU idle time).

[0079] S51: obtaining a transmission time interval by the hardware type and the surrounding environment parameter.

[0080] The transmission time interval refers to a time interval for positioning the marked transmission position of the hardware type in the surrounding environment parameter. The transmission time interval is obtained by analyzing the hardware type and the surrounding environment parameter.

[0081] S52: obtaining an interval correction coefficient by comparing the operating information with the preset reference operating information.

[0082] The reference operating information is a performance parameter range of the hardware when it is normally operating, which is set by a technician.

[0083] The interval correction coefficient refers to a coefficient value for correcting the time interval. When the running information is consistent with the reference running information, it indicates that the hardware type is normally running, and the interval correction coefficient is 1. When the running information is inconsistent with the reference running information, it indicates that the running information of the hardware type is abnormal, and then the difference between the running information and the reference running information is calculated to obtain the deviation running information, and the interval correction coefficient is matched from the difference comparison table based on the deviation running information.

[0084] The difference comparison table stores interval correction coefficients corresponding to different deviation running information. The larger the deviation running information is, the larger the interval correction coefficient is, which will not be described here.

[0085] S53: Update the transmission time interval based on the interval correction coefficient.

[0086] The product of the interval correction coefficient and the transmission time interval is calculated to obtain a new transmission time interval.

[0087] S54: Obtain the estimated transmission time length by running information and transmission information.

[0088] The estimated transmission time length refers to the estimated time length value for completing all transmission information writing. According to the total frame number (such as 1000 frames) of the transmission information and the current transmission time interval (such as 10 ms), the total time length is calculated by the formula total time length = total frame number x interval (1000 x 10 ms = 10 s), and then combined with the "FLASH writing speed" (such as 10 KB / s) in the running information to correct (such as the writing time consumption ratio is 20%, then total time length = 10 s x 1.2 = 12 s).

[0089] S55: Obtain the transmission time point by combining the estimated transmission time length and the transmission time interval.

[0090] The transmission time point refers to the time interval point in the transmission process of the transmission information. The transmission time point is obtained by taking the estimated transmission time length as the basis, taking the transmission time interval as the time interval, and taking each interval time point in the estimated transmission time length as the transmission time point.

[0091] S56: Retrieve the marked time point where the surrounding environment parameter is inconsistent with the reference environment parameter from the marked transmission segment.

[0092] The marked time point refers to the marked time point where the surrounding environment parameter is inconsistent with the reference environment parameter in the marked transmission segment. The initial time point where the surrounding environment parameter is inconsistent with the reference environment parameter is retrieved from the marked transmission segment as the marked time point.

[0093] S57: Obtain the marked transmission position by the marked time point and the transmission time point.

[0094] The marking transmission position is obtained by analyzing the marking time point and the transmission time point.

[0095] The method for obtaining the transmission time interval comprises: S60: retrieving hardware parameters from the hardware type.

[0096] The hardware parameters refer to inherent performance indexes of the hardware, including: CPU main frequency (such as 168 MHz), FLASH erasing speed (such as 20 KB / s), maximum baud rate of the communication interface (such as 1 Mbps), and sensor sampling rate (such as 100 Hz), which are retrieved from the hardware type.

[0097] S61: combining the hardware parameters and the running information to obtain the marking time interval.

[0098] The marking time interval refers to a time interval initially used for positioning the marking transmission position, which is matched from a preset rollback reference table by the hardware parameters and the running information.

[0099] The rollback reference table stores marking time intervals corresponding to different hardware parameters and running information. The smaller the hardware parameters and the running information are, the longer the length of the incomplete data segment is when the hardware fluctuates, and the larger the marking time interval is. The parameters of the rollback reference table are set by the skilled person in the art according to actual conditions in advance, and are not described here.

[0100] S62: comparing the surrounding environment parameters and the reference environment parameters to obtain the deviation environment parameters.

[0101] The deviation environment parameters refer to environmental physical quantities in which the surrounding environment parameters and the reference environment parameters deviate from each other. The deviation environment parameters are obtained by comparing the surrounding environment parameters and the reference environment parameters, calculating the difference between the corresponding environmental physical quantities, and combining them.

[0102] S63: obtaining the correction coefficient based on the deviation environment parameters and the hardware type.

[0103] The correction coefficient refers to an environmental influence coefficient used for adjusting the marking time interval, which is matched from the rollback reference table by the deviation environment parameters and the hardware type.

[0104] The rollback reference table stores correction coefficients corresponding to different deviation environment parameters and hardware types. The larger the deviation environment parameters are, the larger the correction coefficients are, and this is not described here.

[0105] S64: obtaining the transmission time interval according to the correction coefficient and the marking time interval.

[0106] The product of the correction coefficient and the marking time interval is calculated as the transmission time interval.

[0107] The method for obtaining the marked transmission position further comprises: S70: selecting a transmission time point closest to the marked time point from the transmission time points as the adjacent time point.

[0108] The adjacent time point refers to a transmission time point closest to the marked time point, which is selected from the transmission time points.

[0109] S71: comparing the running information with the preset reference running information to obtain the deviation running information.

[0110] The reference running information refers to the performance parameters of the hardware in the normal running state set by the technician.

[0111] The deviation running information refers to the performance parameters with deviation between the running information and the reference running information, which is obtained by calculating the difference between the actual value and the reference value for each running parameter.

[0112] S72: obtaining the deviation transmission section of the marked time point by using the deviation running information and the transmission information.

[0113] The deviation transmission section refers to the data section transmitted by the deviation running information at the marked time point, which is obtained by recording the start / stop time of the deviation running information as a time section and taking the data section corresponding to the time section containing the marked time point as the deviation transmission section. If there is no deviation transmission section containing the marked time point, the data section corresponding to the time section with the smallest time interval smaller than the marked time point is taken as the deviation transmission section.

[0114] S73: obtaining the target time point based on the deviation transmission section and the marked time point.

[0115] The target time point refers to the time point farthest from the marked time point in the deviation transmission section as the target time point, for example, the time points corresponding to the deviation transmission section are (A, B), the marked time point is C, and according to S72, C is greater than B which is greater than A, so the target time point is A.

[0116] S74: updating the adjacent time point by using the target time point.

[0117] The transmission time points on both sides of the target time point are taken as the new adjacent time points.

[0118] S75: taking the adjacent time point not exceeding the target time point as the selected time point, and taking the position in the transmission information corresponding to the selected time point as the marked transmission position.

[0119] The selected time point is a time point adjacent to the target time point that does not exceed the target time point. The selected time point is a time point adjacent to the target time point that does not exceed the target time point, and the data address in the transmission information corresponding to the selected time point is taken as the marked transmission position.

[0120] The method for checking the transmission time interval comprises the following steps: S80: Collect the detection load rate of the hardware.

[0121] The detection load rate refers to the real-time load percentage of the hardware in the transmission process, which is calculated by real-time statistics of the amount of data written and the communication interface traffic.

[0122] S81: Retrieve the reference load rate from the hardware type.

[0123] The reference load rate refers to the hardware safety load threshold, which is retrieved from the hardware type.

[0124] S82: Calculate the difference between the detection load rate and the reference load rate as the load deviation value.

[0125] The load deviation value refers to the deviation value between the detection load rate and the reference load rate, which is calculated by calculating the difference between the detection load rate and the reference load rate as the load deviation value. If the load deviation value is positive, it indicates overload, and if it is negative, it indicates sufficient load.

[0126] S83: Update the running information based on the load deviation value.

[0127] When the load deviation value is positive, the load deviation value and the running information are matched from the rollback reference table to obtain a coefficient value, the product of the coefficient value and the corresponding type of running information is calculated, and the various product values are combined as new running information.

[0128] The rollback reference table stores different coefficient values corresponding to the load deviation value and the running information. The larger the load deviation value is in the positive case, the larger the coefficient value is. Details are not described here.

[0129] S84: Obtain the load transmission information by the load deviation value and the hardware type.

[0130] The load transmission information refers to the transmission adjustment instruction based on the load deviation, which is matched from the rollback reference table by the load deviation value and the hardware type. For example, "overload 5%=transmission interval extended by 10%". The rollback reference table stores different load transmission information corresponding to the load deviation value and the hardware type. Details are not described here.

[0131] S85: Update the transmission time interval by combining the running information and the load transmission information.

[0132] The new running information is used to re-obtain the transmission time interval of the time point corresponding to the load deviation value, and the coefficient value (such as 10% longer = +10%) in the load transmission information is called again. The product of the transmission time interval and the coefficient value of the load transmission information is calculated as a new transmission time interval.

[0133] In this embodiment, the transmission time intervals of the segments can be different.

[0134] Further comprising: S90: calling the deviation transmission information from the deviation transmission segment.

[0135] The deviation transmission information refers to the program data corresponding to the deviation transmission segment, which is obtained by calling the program data from the deviation transmission segment as the deviation transmission information.

[0136] S91: obtaining the data integrity and data interval position based on the deviation transmission information.

[0137] The data integrity refers to the proportion of the number of frames that pass the single-frame CRC check in the deviation transmission information (such as 40 frames valid out of 50 frames = 80%), and the data interval position refers to the position of the adjacent data corresponding to the data that fails the check. The data integrity and data interval position are obtained by performing CRC check analysis on the deviation transmission information. The analysis method of the data integrity and data interval position is known to those skilled in the art, and will not be described here.

[0138] S92: obtaining the data interval duration based on the data interval position.

[0139] The data interval duration refers to the time length value of the interval between the data interval positions. The time points of the data interval positions are called to calculate the duration between the time points as the data interval duration.

[0140] S93: calling the vibration interval duration from the surrounding environment parameters.

[0141] The vibration interval duration refers to the interval duration of the vibration frequency in the surrounding environment parameters. The time points of the start and end of the vibration frequency are recorded to calculate the duration between the time points as the vibration interval duration.

[0142] S94: comparing the consistency of the vibration interval duration and the data interval duration to obtain the vibration abnormal type, and reporting and prompting.

[0143] The vibration abnormal type refers to the abnormal type of the data transmission abnormality of the deviation transmission segment caused by vibration. When the vibration interval duration and the data interval duration are consistent, the abnormality is regarded as the vibration abnormal type, and reporting and prompting are performed.

[0144] Further comprising: S100: Obtain interval information by transmitting information with data interval position.

[0145] Interval information refers to program data corresponding to data interval position, and the program data of data interval position is called as interval information by calling from deviation transmission information.

[0146] S101: Update surrounding environment parameters based on continuity of interval information.

[0147] By analyzing the continuity of interval information, if two interval information are continuous program data, it indicates that the transmission rate of hardware is affected, if two interval information are not continuous program data, it indicates that the transmission of hardware exists packet loss, and there exists the situation that the connection of hardware is dropped due to vibration, then the surrounding environment parameters of the time point of interval information are re-collected.

[0148] S102: Obtain change environment information according to the surrounding environment parameters before and after updating.

[0149] Change environment information refers to the change of physical quantity of environment at the time point corresponding to interval information, and the difference between the physical quantity of environment corresponding to the surrounding environment parameters before and after updating is calculated, and the difference is combined to obtain change environment information.

[0150] S103: Obtain marked change duration according to change environment information, hardware type and running information.

[0151] Marked change duration refers to the interval duration of interval information between the reference due to change environment under the condition of hardware type and running information, and the marked change duration is matched from rollback comparison table according to change environment information, hardware type and running information.

[0152] The rollback comparison table stores the marked change duration corresponding to different change environment information, hardware type and running information, and the greater the change of change environment information, the greater the marked change duration, which is not described here.

[0153] S104: Obtain environment abnormal type by comparing the consistency of marked change duration and data interval duration, and report and prompt.

[0154] Environment abnormal type refers to the abnormal type of data transmission abnormality of deviation transmission section caused by environment, and when the marked change duration is consistent with the data interval duration, it indicates that the data transmission abnormality of deviation transmission section is caused by environment, and the abnormality is taken as environment abnormal type, otherwise, it is interface loose abnormal type.

[0155] The above merely describes the preferred embodiments of the present application, and the protection scope of the present application is not limited to the above-described embodiments. Any technical solution falling within the concept of the present application shall fall within the protection scope of the present application. It should be noted that, for ordinary skilled persons in the art, some improvements and refinements without departing from the principles of the present application shall also be considered as falling within the protection scope of the present application.

Claims

1. A rollback-enabled, in-application programmable upgrade method, characterized in that, include: S10: Divide the preset storage area into a marking area and a detection area, and set an invalid flag bit for the marking area and a valid flag bit for the detection area; S11: Control the preset running modules to select and run based on valid flag bits, and collect trigger information; S12: When the trigger information matches the preset reference information, erase the partition corresponding to the invalid flag bit; S13: Obtain the transmitted information by triggering the information and marking the area; S14: Perform program input verification based on transmission information and invalid flag bits, and after the program has completed input and passed trial operation, set valid flag bits for the flag area and invalid flag bits for the detection area.

2. The rollbackable, in-application programmable upgrade method according to claim 1, characterized in that, Methods for program input validation based on transmitted information and invalidation flag bits include: S20: Detection and verification information of invalid flag bits is collected based on CRC check method; S21: Obtain reference verification information by transmitting information; S22: When the detection verification information is consistent with the baseline verification information, continue to set valid flag bits for the marking area; S23: When the detection verification information is inconsistent with the benchmark verification information, continue to set invalid flag bits for the marking area.

3. The rollbackable, in-application programmable upgrade method according to claim 2, characterized in that, Also includes: S30: Retrieve transmitted text from transmitted information by splitting the buffer based on the storage area; S31: Retrieve historical testing information from the testing area; S32: Obtain historical execution text by using historical detection information; S33: Compare the transmitted text with the historical execution text to obtain the difference text; S34: Retrieve the location of the difference program from the transmitted information based on the difference text; S35: Obtain the differential transmission information based on the differential program location and transmission information; S36: Obtain historical combined information based on the difference procedure location and historical detection information; S37: Input the difference transmission information and historical combination information into the buffer and combine them to update the transmission information.

4. The rollbackable, in-application programmable upgrade method according to claim 2, characterized in that, Methods for program input validation based on transmitted information and invalidation flag bits also include: S40: Acquire hardware type and surrounding environment parameters; S41: Retrieve baseline environment parameters from hardware type; S42: Compare the consistency between the surrounding environmental parameters and the reference environmental parameters to terminate the transmission after a preset reference deviation time. S43: Obtain the marked transmission segment based on the surrounding environmental parameters, the reference environmental parameters, and the reference deviation duration; S44: Obtain the marked transmission location by using hardware type, surrounding environment parameters, and marked transmission segment; S45: Retransmit based on the transmission information and start transmission writing with the transmission position marked by the transmission information.

5. A rollbackable, in-application programmable upgrade method according to claim 4, characterized in that, Methods for obtaining the marked transmission location include: S50: Collects hardware type operating information; S51: The transmission time interval is obtained by using hardware type and surrounding environment parameters; S52: Compare the consistency between the running information and the preset baseline running information to obtain the interval correction coefficient; S53: Update the transmission time interval based on the interval correction factor; S54: Obtain the estimated transmission time by combining operation information and transmission information; S55: Combine the estimated transmission duration with the transmission time interval to obtain the transmission time point; S56: Retrieve the time point from the marker transmission segment where the surrounding environmental parameters are inconsistent with the reference environmental parameters; S57: The marked transmission location is obtained by marking the time point and the transmission time point.

6. A rollbackable, in-application programmable upgrade method according to claim 5, characterized in that, Methods for obtaining the transmission time interval include: S60: Retrieve hardware parameters from hardware type; S61: Combine hardware parameters and operational information to obtain the marking time interval; S62: Compare the surrounding environmental parameters with the baseline environmental parameters to obtain the deviation environmental parameters; S63: Obtain correction coefficients based on deviation environment parameters and hardware type; S64: The transmission time interval is obtained based on the correction factor and the marking time interval.

7. A rollbackable, in-application programmable upgrade method according to claim 6, characterized in that, Methods for obtaining the marked transmission location also include: S70: Select the transmission time point closest to the marked time point from the transmission time points as the adjacent time point; S71: Compare the running information with the preset baseline running information to obtain the deviation running information; S72: Obtain the deviation transmission segment at the marked time point by using deviation operation information and transmission information; S73: Obtain the target time point based on the deviation transmission segment and the marked time point; S74: Update adjacent time points based on the target time point; S75: Select the adjacent time point that has not exceeded the target time point as the selected time point, and use the position in the transmitted information corresponding to the selected time point as the marked transmission position.

8. A rollbackable, in-application programmable upgrade method according to claim 7, characterized in that, Methods for verifying transmission time intervals include: S80: Detection load rate of the acquisition hardware; S81: Retrieve baseline load rate from hardware type; S82: Calculate the difference between the detected load rate and the reference load rate as the load deviation value; S83: Update operating information based on load deviation values; S84: Obtain load transmission information by using load deviation value and hardware type; S85: Combines operational information with load transmission information to update the transmission time interval.

9. A rollbackable, in-application programmable upgrade method according to claim 8, characterized in that, Also includes: S90: Retrieve deviation transmission information from the deviation transmission segment; S91: Obtain data integrity and data interval position based on deviation transmission information; S92: Obtain the data interval duration based on the data interval location; S93: Extract the vibration interval duration from the surrounding environmental parameters; S94: Compare the vibration interval duration with the data interval duration to determine the vibration anomaly type and report it.

10. A rollbackable, in-application programmable upgrade method according to claim 9, characterized in that, Also includes: S100: Obtain interval information by transmitting information and data interval position through deviation transmission; S101: Update surrounding environmental parameters based on continuous conditions with interval information; S102: Obtain information about the changed environment based on the surrounding environmental parameters before and after the update; S103: Obtain the duration of the marked change based on the changing environment information, hardware type, and operating information; S104: Compare the consistency between the marker change duration and the data interval duration to determine the type of environmental anomaly and report it.

Citation Information

Patent Citations

  • Reliable firmware upgrading realizing method for distributed control system

    CN104007996A

  • Optical module firmware program online upgrade method supporting version fallback

    CN105912356A

  • ECU program backup and cyclic upgrade control method and device

    CN110231952A

  • Equipment upgrading method and device, electronic equipment and storage medium

    CN119105784A