Embedded software reconstruction method and device
Through the automated data packet verification and reconstruction process, automatic reconstruction of embedded software is realized, which solves the problems of low efficiency and high risk caused by manual intervention in the existing technology, and improves the efficiency and efficiency of embedded software reconstruction. Security.
Patent Information
- Application Number
- CN202110154885.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-04
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2041-02-04
AI Technical Summary
The existing embedded software reconstruction method requires manual intervention, has many steps and is inefficient, can easily cause the embedded platform to crash, and is difficult to automate.
By obtaining the data packets split by the reconstruction control client, the verification and verification data are matched to determine the integrity of the data packets, and the embedded software is automatically reconstructed in the corresponding write area to achieve automatic re-reconstruction without manual intervention. structure.
It improves the efficiency of embedded software reconstruction, reduces manual errors, ensures the integrity and safety of the reconstruction process, and avoids the risk of platform crashes.
Smart Images

Figure CN114860308B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an embedded software reconstruction method and device. Background Art
[0002] Embedded software is software designed based on an embedded platform. It is a type of computer software that also consists of programs and their documentation. It is an important component of the embedded platform and provides the basis for the normal operation of the embedded platform.
[0003] During the use of embedded software, it is necessary to reconstruct the embedded software to make up for some vulnerabilities in the embedded software or improve some performance of the embedded software. At present, the method of reconstructing embedded software is usually: business personnel manually reconstruct the embedded software. This reconstruction process requires business personnel to use special debugging tools and manually input reconstruction commands through a specific debugging interface to complete the reconstruction of the embedded software. In this process, there are many operation steps, low reconstruction efficiency, and it is easy to make mistakes, which can easily cause the embedded platform to crash. Summary of the invention
[0004] In view of this, the present invention proposes an embedded software reconstruction method and device, the main purpose of which is to realize automatic reconstruction of embedded software. The main technical solutions include:
[0005] In a first aspect, the present invention provides an embedded software reconstruction method, the method comprising:
[0006] Acquire N data packets for reconstructing the embedded software, wherein the N data packets are obtained by splitting the reconstruction control client based on the reconstruction file of the embedded software, and N is an integer greater than or equal to 1;
[0007] Checking whether the N data packets can constitute the complete reconstructed file;
[0008] If it is verified that the N data packets can constitute the complete reconstructed file, based on the type of the embedded software, determining a writing area corresponding to the embedded software;
[0009] The embedded software is reconstructed in the writing area using the N data packets.
[0010] In a second aspect, the present invention provides an embedded software reconstruction device, the device comprising:
[0011] An acquisition unit, configured to acquire N data packets for reconstructing the embedded software, wherein the N data packets are obtained by splitting the reconstruction control client based on the reconstruction file of the embedded software, and N is an integer greater than or equal to 1;
[0012] A checking unit, used for checking whether the N data packets can constitute a complete reconstructed file;
[0013] a determining unit, configured to determine a writing area corresponding to the embedded software based on the type of the embedded software if it is verified that the N data packets can constitute the complete reconstructed file;
[0014] A reconstruction unit, configured to reconstruct the embedded software in the writing area through the N data packets;
[0015] In a third aspect, the present invention provides a computer-readable storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the embedded software reconstruction method described in the first aspect.
[0016] In a fourth aspect, the present invention provides a storage management device, the storage management device comprising:
[0017] Memory, used to store programs;
[0018] A processor is coupled to the memory and is used to run the program to execute the embedded software reconstruction method described in the first aspect.
[0019] By means of the above technical solution, the embedded software reconstruction method and device provided by the present invention obtain N data packets for reconstructing the embedded software, and the N data packets are obtained by splitting the reconstruction file of the embedded software by the reconstruction control client. Then, after checking that the N data packets can constitute the complete reconstruction file, the writing area corresponding to the embedded software is determined based on the type of the embedded software, and the embedded software is reconstructed in the writing area through the N data packets. It can be seen that the solution provided by the present invention does not require manual intervention when reconstructing the embedded software. After obtaining the N data packets sent by the reconstruction control client for reconstructing the embedded software, the reconstruction of the embedded software can be completed in the writing area corresponding to the embedded software, thereby realizing the automatic reconstruction of the embedded software and improving the reconstruction efficiency of the embedded software.
[0020] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0022] Figure 1 A flowchart of an embedded software reconstruction method provided by an embodiment of the present invention is shown;
[0023] Figure 2 A flowchart of an embedded software reconstruction method provided by another embodiment of the present invention is shown;
[0024] Figure 3 A flowchart of an embedded software reconstruction method provided by another embodiment of the present invention is shown;
[0025] Figure 4 A schematic diagram showing the structure of an embedded software reconstruction device provided by an embodiment of the present invention is shown;
[0026] Figure 5 A schematic structural diagram of an embedded software reconstruction device provided by another embodiment of the present invention is shown. DETAILED DESCRIPTION
[0027] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0028] Embedded software is software deployed on an embedded platform, which provides a software foundation for the normal operation of the embedded platform. The embedded software can be system software or application software, which is not limited in this embodiment. Exemplarily, the system software can be system software such as uboot, Linux kernel, ramdisk file system, and FPGA bitstream file corresponding to the system software, and the application software can be software that provides a certain specific function for the user. The embedded software reconstruction method provided in the embodiment of the present invention is a method applied to an embedded platform, so as to reconstruct the embedded software deployed in the embedded platform to make up for some vulnerabilities in the embedded software or improve some performance in the embedded software, so that the embedded software can be upgraded.
[0029] like Figure 1 As shown, an embodiment of the present invention provides an embedded software reconstruction method, which mainly includes:
[0030] 101. Obtain N data packets for reconstructing embedded software, wherein the N data packets are split by a reconstruction control client based on a reconstruction file of the embedded software, and N is an integer greater than or equal to 1.
[0031] The N data packets used to reconstruct the embedded software obtained in this embodiment are provided by a reconstruction control client. The reconstruction control client is a client for providing the reconstruction file of the embedded software to the embedded platform, and it can interact with the embedded platform. The reconstruction control client can be a general software based on a PC, and can support multiple embedded platforms to reconstruct the embedded software.
[0032] The N data packets provided by the reconstruction control client are obtained by splitting the reconstruction file of the embedded software based on the reconstruction control client. The way of transmitting the N data packets to the embedded platform can realize segmented transmission, reduce the amount of data transmitted each time, and improve the transmission efficiency. It should be noted that the reconstruction file can make up for some vulnerabilities in the embedded software or improve some performance in the embedded software, which corresponds to the latest version of the embedded software. After obtaining the reconstruction file of the embedded software, the reconstruction control client needs to split it into N data packets. The splitting method includes at least the following two methods: one is to evenly split the reconstruction file according to the size of the reconstruction file. The other is to split the reconstruction file according to the budget size. For example, the reconstruction file is split in units of 1K bytes. When the last split data packet is less than 1K bytes, the original size of the data packet can be maintained, or the size of the data packet can be supplemented to 1K bytes by specific characters.
[0033] After the reconstruction control client splits the reconstruction file of the embedded software to obtain N data packets for reconstructing the embedded software, the N data packets are transmitted to the embedded platform through a preset network interface so that the embedded platform can reconstruct the embedded software.
[0034] In order to ensure the correctness and integrity of the N data packets it obtains, the embedded platform performs the following steps 1 to 4 for each data packet obtained when obtaining the N data packets used to reconstruct the embedded software:
[0035] Step 1: Generate verification data for the data packet using a preset algorithm corresponding to the data packet.
[0036] The reconstruction control client and the embedded platform pre-agreed on a preset algorithm for the data packet, which is used to verify whether the data packet is a complete and legal data packet. The specific type of the preset algorithm can be determined based on business requirements, which may include but is not limited to a hash algorithm. It should be noted that each data packet has a corresponding preset algorithm, and the preset algorithms corresponding to each data packet may be the same, but in order to improve security, N data packets may correspond to at least two preset algorithms.
[0037] After obtaining a data packet, in order to verify the correctness and integrity of the data packet, it is necessary to use a preset algorithm to operate on the data in the data packet to form verification data corresponding to the data packet. The preset algorithm can be used to operate on all or part of the data in the data packet. If the operation is performed on part of the data, the reconstruction control client and the embedded platform need to predetermine which part of the data the part is.
[0038] Step 2: determine whether the generated verification data matches the verification data carried by the data packet, wherein the verification data carried by the data packet is configured by the reconstruction control client, and execute step 3 or step 4.
[0039] When the reconstruction control client splits the reconstruction file to obtain a data packet, the reconstruction control client needs to use a preset algorithm corresponding to the data packet to generate verification data corresponding to the data packet, and configure the verification data to the data packet. When the data packet is provided to the embedded platform, the verification data will be carried in the data packet for the embedded platform to verify the data packet.
[0040] When verifying a data packet, it is necessary to determine whether the generated verification data matches the verification data carried by the data packet, and execute step three or step four based on the determined matching result.
[0041] Step three: If there is no match, a data retransmission request is sent to the reconstruction control client, so that the reconstruction control client re-provides the data packet according to the data retransmission request.
[0042] If it is determined that the generated verification data does not match the verification data carried by the data packet, it means that the data has been maliciously tampered with or the data included in it is incomplete. At this time, it is necessary to send a data retransmission request to the reconstruction control client so that the reconstruction control client re-provides the data packet according to the data retransmission request. When the reconstruction control client re-provides the data packet according to the data retransmission request, in order to improve security, the preset algorithm corresponding to the data packet provided by it can be different from the preset algorithm used in the last transmission, and the verification data carried should match the new preset algorithm.
[0043] Furthermore, in order to avoid endless retransmission operations, before sending a data retransmission request to the reconstruction control client, it is necessary to determine the cumulative number of times the data retransmission request is sent to the reconstruction control client for the data packet.
[0044] When the cumulative number reaches a preset threshold, it indicates that the data packet has an anomaly that cannot be overcome by retransmission, and therefore it is necessary to stop the reconstruction of the embedded software and promptly eliminate the anomaly of the reconstruction file or the reconstruction control client.
[0045] When the accumulated number of times does not reach the preset number threshold, it indicates that the data packet may still have an anomaly that can be overcome by retransmission, so a data retransmission request is sent to the reconstruction control client, so that the reconstruction control client re-provides the data packet according to the data retransmission request.
[0046] Step 4: If a match is found, a data transmission success response notification is sent to the reconstruction control client.
[0047] When it is determined that the generated verification data matches the verification data carried by the data packet, it means that the data packet has not been maliciously tampered with and the data it includes is complete. At this time, a data transmission success response notification is sent to the reconstruction control client to let the reconstruction control client know that the data packet has been successfully received by the embedded platform.
[0048] When determining that the generated verification data matches the verification data carried by the data packet, the data packet needs to be stored in a specific storage location, so that after N data packets are successfully acquired, N data packets can be read from the storage location for subsequent embedded software reconstruction processes. When storing data packets, the embedded platform can cache the data packets in a ping-pong manner. Different types of embedded software have specific storage locations, and data packets need to be stored in their corresponding storage locations.
[0049] It should be noted that if N data packets are sent to the embedded platform in a specific order, where the specific order enables the N data packets to form a complete reconstruction file, then the data transmission success response notification corresponding to the last data packet among the N data packets needs to carry a special identifier, which can enable the reconstruction control client to know that all data packets have been successfully obtained by the embedded platform.
[0050] 102 . Check whether the N data packets can constitute the complete reconstructed file, and execute 103 or 105 .
[0051] After obtaining N data packets for reconstructing the embedded software, it is necessary to check whether the N data packets can constitute a complete reconstruction file to determine whether the reconstruction of the embedded software can be completed using the N data packets. The process of checking whether the N data packets can constitute a complete reconstruction file specifically includes the following steps 1 to 4:
[0052] Step 1: Use a preset algorithm corresponding to the reconstructed file to operate on the N data packets to generate verification data for the reconstructed file.
[0053] The reconstruction control client and the embedded platform pre-agreed on a preset algorithm for reconstructing the file, which is used to verify whether N data packets can form a complete reconstruction file. The specific type of the preset algorithm can be determined based on business requirements, and may include but is not limited to a hash algorithm.
[0054] After obtaining N data packets, a preset algorithm needs to be used to calculate the data in the N data packets to form verification data for the reconstructed file. The preset algorithm is used to calculate the data in the N data packets, which can be all or part of the data in the N data packets. If the calculation is performed on part of the data, the reconstruction control client and the embedded platform need to predetermine which part of the data the part is.
[0055] Step 2: determine whether the generated verification data matches the verification data carried by a specific data packet, wherein the specific data packet is one of the N data packets, and the verification data carried by the specific data packet is configured by the reconstruction control client, and execute step 3 or step 4.
[0056] When the reconstruction control client splits the reconstruction file to obtain data packets, the reconstruction control client needs to use the preset algorithm corresponding to the reconstruction file to generate verification data corresponding to the reconstruction file, and configure the verification data into one of the N data packets, which can be determined by the reconstruction control client, for example, the last data packet in the N data packets. When the data packet is provided to the embedded platform, the verification data will be carried in the data packet for the embedded platform to verify whether the N data packets can constitute a complete reconstruction file.
[0057] Step 3: If there is a match, verify that the N data packets can constitute the complete reconstructed file.
[0058] When it is determined that the generated verification data matches the verification data carried by a specific data packet, it means that the N data packets have not been maliciously tampered with and the data included therein is complete. At this time, it means that the N data packets can constitute a complete reconstruction file and the embedded software can be reconstructed according to the reconstruction file.
[0059] Step 4: If there is no match, stop refactoring the embedded software.
[0060] When it is determined that the verification data produced does not match the verification data carried by a specific data packet, it means that N data packets have been maliciously tampered with or the data included is an incomplete data packet. At this time, it means that the N data packets cannot constitute a complete reconstruction file and the reconstruction of the embedded software cannot be completed. In this case, the reconstruction of the embedded software is stopped and a reminder to stop the reconstruction can be issued so that the business personnel can handle the exception according to the reminder.
[0061] 103. If it is verified that the N data packets can constitute the complete reconstructed file, determine a writing area corresponding to the embedded software based on the type of the embedded software.
[0062] In an embedded platform, not only one type of embedded software is deployed, but different types of embedded software may be deployed at the same time. In order to manage different types of embedded software, different types of embedded software have their own writing areas in the embedded system. Therefore, after verifying that N data packets can constitute a complete reconstruction file, it is necessary to determine the type of embedded software corresponding to the reconstruction file, and determine the writing area corresponding to the embedded software according to the type of embedded software, so as to reconstruct the embedded software in the writing area.
[0063] 104. Reconstruct the embedded software in the writing area using the N data packets, and end the current process.
[0064] The specific process of reconstructing the embedded software by using N data packets in the write area includes the following steps 1 and 2:
[0065] Step 1: Erasing the original embedded software in the write area.
[0066] Since it is a reconstruction of the embedded software, in order to avoid the original version of the embedded software from affecting the reconstructed version corresponding to the reconstructed file, the original embedded software in the write area needs to be erased during reconstruction.
[0067] Step 2: In the write area after the erase operation, a programming operation is performed based on the N data packets, and the reconstructed files corresponding to the N data packets are written into the write area.
[0068] The write area after the erase operation will no longer contain the original embedded software. At this time, the programming operation is performed based on N data packets in the write area after the erase operation. The process of performing the programming operation based on N data packets is actually to restore the reconstruction file based on the N data packets, and then program the reconstruction version corresponding to the reconstruction file into the write area according to the programming logic of the reconstruction file, thereby completing the reconstruction of the embedded software in the write area.
[0069] Furthermore, in order to ensure that the reconstructed embedded software can run normally, a programming operation is performed based on the N data packets in the write area after the erase operation. After the reconstructed files corresponding to the N data packets are written into the write area, steps three to seven need to be performed:
[0070] Step 3: Read the data written in the write area.
[0071] After the reconstructed files corresponding to N data packets are written into the write area, the data in the write area should include all the data corresponding to the reconstructed files. Therefore, in order to verify whether the reconstructed embedded software can run normally, it is necessary to read the data written in the write area.
[0072] Step 4: Use a specific algorithm to operate on the read data to generate verification data for the read data.
[0073] The reconstruction control client and the embedded platform pre-agreed on a specific algorithm for reconstructing the file, and the preset algorithm is used to verify whether the data written in the write area can constitute a complete reconstructed file. The specific type of the preset algorithm can be determined based on business requirements, and may include but is not limited to a hash algorithm.
[0074] Step 5: Determine whether the generated verification data matches the verification data carried by a specific data packet, wherein the specific data packet is one of the N data packets, and the verification data carried by the specific data packet is configured by the reconstruction control client.
[0075] When the reconstruction control client splits the reconstruction file to obtain data packets, the reconstruction control client needs to use the specific algorithm corresponding to the reconstruction file to generate verification data corresponding to the reconstruction file, and configure the verification data into one of the N data packets. The data packet can be determined by the reconstruction control client, for example, the last data packet in the N data packets. When the data packet is provided to the embedded platform, the verification data will be carried in the data packet for the embedded platform to verify whether the data written in the write area can constitute a complete reconstruction file.
[0076] Step 6: If there is a match, a reminder is issued that the embedded software reconstruction is completed.
[0077] When it is determined that the generated verification data matches the verification data carried by the specific data packet, it means that the reconstruction file has been completely written to the write area. At this time, it means that the reconstruction of the embedded software has been completed, and a reminder of the completion of the embedded software reconstruction is issued to notify the user that the embedded software reconstruction is complete.
[0078] Step 7: If there is no match, a reminder is issued indicating that the embedded software reconstruction has failed.
[0079] When it is determined that the generated verification data does not match the verification data carried by the specific data packet, it means that the reconstruction file has not been completely written to the write area. At this time, it means that the reconstruction of the embedded software has not been completed. If there is an abnormality in the reconstructed embedded software, a reminder of embedded software reconstruction failure is issued to notify the user of the embedded software reconstruction abnormality.
[0080] 105. If it is found that the N data packets cannot constitute the complete reconstruction file, the reconstruction of the embedded software is stopped.
[0081] If it is found that the N data packets cannot constitute a complete reconstruction file, it means that the N data packets have been maliciously tampered with or the data included are incomplete data packets. At this time, it means that the N data packets cannot constitute a complete reconstruction file and the reconstruction of the embedded software cannot be completed. In this case, the reconstruction of the embedded software is stopped and a reminder to stop the reconstruction can be issued so that the business personnel can handle the exception according to the reminder.
[0082] The embedded software reconstruction method provided by the embodiment of the present invention obtains N data packets for reconstructing the embedded software, and the N data packets are obtained by splitting the reconstruction file of the embedded software by the reconstruction control client. Then, after verifying that the N data packets can constitute the complete reconstruction file, the writing area corresponding to the embedded software is determined based on the type of the embedded software, and the embedded software is reconstructed in the writing area through the N data packets. It can be seen that the solution provided by the embodiment of the present invention does not require manual intervention when reconstructing the embedded software. After obtaining the N data packets sent by the reconstruction control client for reconstructing the embedded software, the reconstruction of the embedded software can be completed in the writing area corresponding to the embedded software, thereby realizing automatic reconstruction of the embedded software and improving the reconstruction efficiency of the embedded software.
[0083] Further, according to Figure 1 Another embodiment of the present invention also provides an embedded software reconstruction method, such as Figure 2 As shown, the method mainly includes:
[0084] 201. Obtain N data packets for reconstructing embedded software, wherein the N data packets are split by a reconstruction control client based on a reconstruction file of the embedded software, and N is an integer greater than or equal to 1.
[0085] 202 . Check whether the N data packets can constitute the complete reconstructed file, and execute 203 or 207 .
[0086] 203. If it is verified that the N data packets can constitute the complete reconstructed file, determine a writing area corresponding to the embedded software based on the type of the embedded software.
[0087] 204. Reconstruct the embedded software in the writing area using the N data packets.
[0088] 205. Run the reconstructed embedded software.
[0089] After the embedded software is reconstructed through N data packets in the write area, in order to verify whether the reconstructed embedded software can be run, the reconstructed embedded software needs to be run.
[0090] The reconstructed embedded software can be run when the embedded platform is powered off and then powered on again. When powered on again, the reconstructed embedded software will be directly run to ensure that the running embedded software is the latest version of the embedded software.
[0091] 206. When the reconstructed embedded software fails to run, load the fixed version software corresponding to the embedded software and end the current process.
[0092] When the reconstructed embedded software fails to run, it indicates that there is an abnormality in the reconstructed embedded software. At this time, in order to ensure that the embedded platform can enter the working state normally, it is necessary to load the fixed version software corresponding to the embedded software and run it with the fixed version software.
[0093] The fixed version software is a pre-stored embedded software that can run successfully. The setting of the fixed version software exists to ensure the stable operation of the fixed version software. The fixed version software is set by the business personnel and is an embedded software that can run stably and successfully.
[0094] 207. If it is found that the N data packets cannot constitute the complete reconstruction file, the reconstruction of the embedded software is stopped.
[0095] Further, according to Figure 1 Another embodiment of the present invention also provides an embedded software reconstruction method, such as Figure 3 As shown, the method mainly includes:
[0096] 301. Obtain N data packets for reconstructing embedded software, wherein the N data packets are split by a reconstruction control client based on a reconstruction file of the embedded software, and N is an integer greater than or equal to 1.
[0097] 302 . Check whether the N data packets can constitute the complete reconstructed file, and execute 303 or 307 .
[0098] 303. If it is verified that the N data packets can constitute the complete reconstructed file, determine a writing area corresponding to the embedded software based on the type of the embedded software.
[0099] 304. Reconstruct the embedded software in the writing area using the N data packets.
[0100] 305. Set a version loading value for the reconstructed embedded software, wherein the version loading value of the reconstructed embedded software is different from the version loading value of the fixed version software.
[0101] In order to enable users to flexibly enable the required version of embedded software according to their own needs, after the embedded software is reconstructed in the write area through the N data packets, it is necessary to set a version loading value for the reconstructed embedded software, and users can start the required version of embedded software according to the version loading value.
[0102] It should be noted that in order to ensure that the embedded platform can run normally, the embedded platform is provided with a fixed version of software, which is a pre-stored embedded software that can run successfully, and the version of the embedded software that can run successfully is lower than the reconstructed embedded software.
[0103] It should be noted that the version loading value of each version of embedded software is unique, and the specific type of the version loading value can be determined based on business requirements, and the embodiment of the present invention does not make any specific limitation.
[0104] 306. When the version loading value input by the user is received, run the software corresponding to the received version loading value.
[0105] The user can enable the required version of the embedded software based on the version loading value, and when the version loading value input by the user is received, the software corresponding to the received version loading value is run.
[0106] Exemplarily, if the version loading value input by the user is the reconstructed embedded software, the reconstructed embedded software is started. If the reconstructed embedded software runs abnormally, the fixed version software is automatically started to ensure the normal operation of the embedded platform.
[0107] 307. If it is found that the N data packets cannot constitute the complete reconstruction file, the reconstruction of the embedded software is stopped.
[0108] Further, according to the above method embodiment, another embodiment of the present invention also provides an embedded software reconstruction device, such as Figure 4 As shown, the device comprises:
[0109] An acquisition unit 41 is used to acquire N data packets for reconstructing the embedded software, wherein the N data packets are split by the reconstruction control client based on the reconstruction file of the embedded software, and N is an integer greater than or equal to 1;
[0110] A checking unit 42, used for checking whether the N data packets can constitute a complete reconstructed file;
[0111] A determination unit 43 is configured to determine a writing area corresponding to the embedded software based on the type of the embedded software if it is verified that the N data packets can constitute the complete reconstructed file;
[0112] The reconstruction unit 44 is used to reconstruct the embedded software in the writing area through the N data packets.
[0113] The embedded software reconstruction device provided by the embodiment of the present invention obtains N data packets for reconstructing the embedded software, and the N data packets are obtained by splitting the reconstruction file of the embedded software by the reconstruction control client. Then, after verifying that the N data packets can constitute the complete reconstruction file, the writing area corresponding to the embedded software is determined based on the type of the embedded software, and the embedded software is reconstructed in the writing area through the N data packets. It can be seen that the solution provided by the embodiment of the present invention does not require manual intervention when reconstructing the embedded software. After obtaining the N data packets sent by the reconstruction control client for reconstructing the embedded software, the reconstruction of the embedded software can be completed in the writing area corresponding to the embedded software, thereby realizing automatic reconstruction of the embedded software and improving the reconstruction efficiency of the embedded software.
[0114] Optional, such as Figure 5 As shown, the device also includes:
[0115] A first running unit 45, configured to run the reconstructed embedded software after the reconstructing unit 44 reconstructs the embedded software in the writing area through the N data packets;
[0116] The loading unit 46 is used to load the fixed version software corresponding to the reconstructed embedded software when the embedded software fails to run, wherein the fixed version software is pre-stored embedded software that can run successfully.
[0117] Optional, such as Figure 5 As shown, the device also includes:
[0118] A setting unit 47, configured to set a version loading value for the reconstructed embedded software, wherein the version loading value of the reconstructed embedded software is different from the version loading value of the fixed version software;
[0119] The second running unit 48 is configured to run the software corresponding to the received version loading value when receiving the version loading value input by the user.
[0120] Optional, such as Figure 5 As shown, the acquisition unit 41 is used to execute each time a data packet is acquired: using a preset algorithm corresponding to the data packet to generate verification data for the data packet; determining whether the generated verification data matches the verification data carried by the data packet, wherein the verification data carried by the data packet is configured by the reconstruction control client; if there is a mismatch, sending a data retransmission request to the reconstruction control client, so that the reconstruction control client re-provides the data packet according to the data retransmission request; if there is a match, sending a data transmission success response notification to the reconstruction control client.
[0121] Optional, such as Figure 5 As shown, the device also includes:
[0122] The processing unit 49 is used to determine the cumulative number of times the acquisition unit 41 sends data retransmission requests to the reconstruction control client for the data packet; when the cumulative number reaches a preset number threshold, stop the reconstruction of the embedded software; when the cumulative number does not reach the preset number threshold, trigger the acquisition unit 41 to execute sending a data retransmission request to the reconstruction control client.
[0123] Optional, such as Figure 5 As shown, the verification unit 42 is used to operate the N data packets using a preset algorithm corresponding to the reconstruction file to generate verification data for the reconstruction file; determine whether the generated verification data matches the verification data carried by a specific data packet, wherein the specific data packet is one of the N data packets, and the verification data carried by the specific data packet is configured by the reconstruction control client; if they match, it is verified that the N data packets can constitute a complete reconstruction file.
[0124] Optional, such as Figure 5 As shown, the reconstruction unit 44 includes:
[0125] An erasing module 441 is used to erase the original embedded software in the writing area;
[0126] A writing module 442 is used to perform a programming operation based on the N data packets in the writing area after the erasing operation, write the reconstructed files corresponding to the N data packets into the writing area, and then read the data written in the writing area;
[0127] The verification module 443 is used to use a specific algorithm to operate on the read data to generate verification data for the read data; determine whether the generated verification data matches the verification data carried by a specific data packet, wherein the specific data packet is one of the N data packets, and the verification data carried by the specific data packet is configured by the reconstruction control client; if they match, issue a reminder that the reconstruction of the embedded software is completed.
[0128] In the embedded software reconstruction device provided by the embodiment of the present invention, the detailed description of the method used in the operation process of each functional module can be found in Figures 1 to 3 The corresponding method of the method embodiment is explained in detail and will not be repeated here.
[0129] Further, according to the above embodiment, another embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute Figures 1 to 3 Any of the embedded software reconstruction methods described above.
[0130] Further, according to the above embodiment, another embodiment of the present invention further provides a storage management device, the storage management device comprising:
[0131] Memory, used to store programs;
[0132] A processor, coupled to the memory, configured to run the program to perform Figures 1 to 3 Any of the embedded software reconstruction methods described above.
[0133] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0134] It is understandable that the related features in the above methods and devices can be referenced to each other. In addition, the "first", "second" and the like in the above embodiments are used to distinguish the embodiments, but do not represent the advantages and disadvantages of the embodiments.
[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0136] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description of the above specific languages is for disclosing the best mode of the present invention.
[0137] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0138] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0139] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0140] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0141] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the operating method, device, and framework of the deep neural network model according to an embodiment of the present invention. The present invention may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0142] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.
Claims
1. A method for refactoring embedded software. It is characterized in that The method comprises: Acquire N data packets for reconstructing the embedded software, wherein the N data packets are obtained by splitting the reconstruction control client based on the reconstruction file of the embedded software, and N is an integer greater than or equal to 1; Checking whether the N data packets can constitute the complete reconstructed file; If it is verified that the N data packets can constitute the complete reconstructed file, based on the type of the embedded software, determining a writing area corresponding to the embedded software; Reconstructing the embedded software in the writing area by using the N data packets; Obtain N data packets for reconstructing embedded software, including: Each time a data packet is obtained, the following steps are performed: generating verification data for the data packet using a preset algorithm corresponding to the data packet, wherein each of the data packet has a corresponding preset algorithm, and the N data packets correspond to at least two preset algorithms; determining whether the generated verification data matches the verification data carried by the data packet, wherein the verification data carried by the data packet is configured by the reconstruction control client based on a corresponding preset algorithm; if not, sending a data retransmission request to the reconstruction control client so that the reconstruction control client re-provides the data packet according to the data retransmission request, wherein the data packet re-provided by the reconstruction control client according to the data retransmission request is different from the preset algorithm used when the data packet was transmitted last time; if matched, sending a data transmission success response notification to the reconstruction control client.
2. The method according to claim 1, It is characterized in that After the write area reconstructs the embedded software through the N data packets, the method further includes: Run the reconstructed embedded software; When the reconstructed embedded software fails to run, a fixed version software corresponding to the embedded software is loaded, wherein the fixed version software is pre-stored embedded software that can run successfully.
3. The method according to claim 2, It is characterized in that The method further comprises: Setting a version loading value for the reconstructed embedded software, wherein the version loading value of the reconstructed embedded software is different from the version loading value of the fixed version software; When the version loading value input by the user is received, the software corresponding to the received version loading value is run.
4. The method according to claim 1, It is characterized in that Before sending the data retransmission request to the reconstruction control client, the method further includes: Determining a cumulative number of times a data retransmission request is sent to the reconstruction control client for the data packet; When the cumulative number of times reaches a preset number threshold, the reconstruction of the embedded software is stopped; When the accumulated number of times does not reach the preset number threshold, a data retransmission request is sent to the reconstruction control client.
5. The method according to claim 1, It is characterized in that Checking whether the N data packets can constitute the complete reconstructed file includes: Using a preset algorithm corresponding to the reconstructed file to operate on the N data packets to generate verification data for the reconstructed file; Determining whether the generated verification data matches the verification data carried by a specific data packet, wherein the specific data packet is one of the N data packets, and the verification data carried by the specific data packet is configured by the reconstruction control client; If they match, it is verified that the N data packets can constitute the complete reconstructed file.
6. The method according to claim 1, It is characterized in that Reconstructing the embedded software in the write area using the N data packets includes: Erasing the original embedded software in the write area; In the write area after the erase operation, a programming operation is performed based on the N data packets, a reconstruction file corresponding to the N data packets is written into the write area, and then the data written in the write area is read; Using a specific algorithm to operate on the read data to generate verification data for the read data; Determining whether the generated verification data matches the verification data carried by a specific data packet, wherein the specific data packet is one of the N data packets, and the verification data carried by the specific data packet is configured by the reconstruction control client; If they match, a reminder is issued that the embedded software reconstruction is completed.
7. An embedded software reconstruction device, It is characterized in that The device comprises: An acquisition unit, configured to acquire N data packets for reconstructing the embedded software, wherein the N data packets are obtained by splitting the reconstruction control client based on the reconstruction file of the embedded software, and N is an integer greater than or equal to 1; A checking unit, used for checking whether the N data packets can constitute a complete reconstructed file; A determination unit, configured to determine a writing area corresponding to the embedded software based on the type of the embedded software if it is verified that the N data packets can constitute the complete reconstructed file; A reconstruction unit, configured to reconstruct the embedded software in the writing area through the N data packets; The acquisition unit is specifically used to execute the following for each data packet acquired: generating verification data for the data packet using a preset algorithm corresponding to the data packet, each of the data packets having a corresponding preset algorithm, and the N data packets corresponding to at least two preset algorithms; determining whether the generated verification data matches the verification data carried by the data packet, wherein the verification data carried by the data packet is configured by the reconstruction control client based on a corresponding preset algorithm; if not, sending a data retransmission request to the reconstruction control client so that the reconstruction control client re-provides the data packet according to the data retransmission request, the data packet re-provided by the reconstruction control client according to the data retransmission request being different from the preset algorithm used when the data packet was last transmitted; if matching, sending a data transmission success response notification to the reconstruction control client.
8. A computer-readable storage medium, It is characterized in that The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the embedded software reconstruction method according to any one of claims 1 to 6.
9. A storage management device, It is characterized in that The storage management device comprises: Memory, used to store programs; A processor, coupled to the memory, is used to run the program to execute the embedded software reconstruction method described in any one of claims 1 to 6.
