Firmware upgrade procedure, device, server, end device and storage medium
The firmware upgrade method for IoT devices addresses security risks by dividing and ordering upgrade packets based on unique identification codes, ensuring secure and customized firmware updates for each device, thus enhancing system integrity.
Patent Information
- Application Number
- DE112023004428
- Authority / Receiving Office
- DE · DE
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-10-21
- Filing Date
- 2023-03-31
- Publication Date
- 2025-08-07
AI Technical Summary
Conventional security management solutions based on operating systems, such as firewalls and application stores, are inadequate for ensuring the security of firmware upgrades in Internet of Things (IoT) devices with limited computing and memory resources, leading to potential security risks during the upgrade process.
A firmware upgrade method that involves dividing the upgrade packet based on unique identification codes for each device, altering the order of sub-upgrade packets, and storing/transmitting these packets in a manner that prevents unauthorized access and manipulation, using a server-side and terminal-side approach.
Enhances the security of the firmware upgrade process by preventing unauthorized access and manipulation, ensuring that each device receives a customized upgrade package that is difficult to intercept or tamper with, thereby safeguarding the integrity of the IoT system.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[0001] This application claims priority to Chinese Patent Application No. 202211295975.2 filed on October 21, 2022, and the disclosure of the above-mentioned Chinese patent application is hereby incorporated in its entirety as part of this application. FIELD OF TECHNOLOGY
[0002] The present invention relates to the technical field of firmware upgrade, in particular to a firmware upgrade method, a device, a server, a terminal and a storage medium. STATE OF THE ART
[0003] Unlike traditional network security, Internet of Things (IoT) security is the product of the integration of network security and other technical disciplines. Compared with simple data, server, network infrastructure, and information security, the connotations of Internet of Things security are richer. Furthermore, Internet of Things security must also include direct or distributed monitoring and control of the state of the networked physical system.
[0004] There are a large number of end devices in the Internet of Things system, and a large proportion of them are single-chip devices with limited computing power and memory resources. In this resource-limited device environment, traditional operating system-based security management solutions such as firewalls and application stores cannot ensure device security during upgrades.
[0005] Therefore, a secure firmware upgrade solution is urgently needed in this area to effectively avoid security risks in the firmware upgrade process of end devices. SUMMARY
[0006] The present invention provides a firmware upgrade method, a device, a server, a terminal, and a storage medium that can effectively avoid security risks in the firmware upgrade process.
[0007] According to one embodiment of this disclosure, there is provided a server-side firmware upgrade method comprising: obtaining a target firmware upgrade package; receiving an identification code of a target terminal; splitting the target firmware upgrade package into partial upgrade packages based on the identification code of the target terminal; storing the partial upgrade packages and / or transmitting the partial upgrade packages to the target terminal.
[0008] A server-side firmware upgrade method according to an embodiment of this disclosure further comprises: obtaining a size of the partial upgrade packets by the identification code of the target terminal, determining a number of divided partial upgrade packets based on the size of the partial upgrade packets.
[0009] A server-side firmware upgrade method according to an embodiment of this disclosure further comprises: determining a download address for the target terminal to download the partial upgrade packages based on the identification code and a modifiable default address of the partial upgrade packages.
[0010] A server-side firmware upgrade method according to an embodiment of this disclosure further comprises: obtaining an order identifier of the partial upgrade package by the identification code of the target terminal, determining whether to change an order of the partial upgrade package based on the order identifier of the partial upgrade package, numbering the partial upgrade package according to an original order of the partial upgrade package in response to determining not to change the order of the partial upgrade package, changing the order of the partial upgrade package, and numbering the partial upgrade package according to the changed order of the partial upgrade package in response to determining to change the order of the partial upgrade package.
[0011] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein each of the partial upgrade packets comprises a partial upgrade packet header, and the partial upgrade packet header comprises a number of the partial upgrade packet.
[0012] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein the partial upgrade packet header further comprises at least one of the identification code of the target terminal and a number of partial upgrade packets divided by the target firmware upgrade packet.
[0013] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein determining whether to change an order of the partial upgrade package based on the order identifier of the partial upgrade package comprises: identifying a numerical value indicated by the order identifier, determining whether to change the order of the partial upgrade package based on the numerical value indicated by the order identifier.
[0014] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein determining whether to change the order of the partial upgrade package based on the numerical value indicated by the order identifier comprises: determining whether to change the order of the partial upgrade package based on whether the numerical value indicated by the order identifier is a first predetermined value.
[0015] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein determining whether to change the order of the partial upgrade package based on the numerical value indicated by the order identifier comprises: taking a remainder of the numerical value indicated by the order identifier over a second predetermined numerical value to obtain a remainder, wherein the second predetermined numerical value is a natural number greater than or equal to 2, determining whether to change the order of the partial upgrade package based on the remainder.
[0016] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein the second predetermined value is 2, wherein determining whether to change the order of the partial upgrade package based on the numerical value indicated by the order identifier comprises: determining whether to change the order of the partial upgrade package based on a parity of the numerical value indicated by the order identifier.
[0017] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein changing the order of the partial upgrade package based on the order identifier comprises: identifying the numerical value specified by the order identifier, changing the order of the partial upgrade package based on the numerical value specified by the order identifier.
[0018] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein the order identifier comprises data having a predetermined number of bits, and identifying the numerical value indicated by the order identifier comprises identifying the numerical value indicated by the data, wherein changing the order of the partial upgrade package comprises: dividing the partial upgrade packages into partial upgrade package groups, each partial upgrade package group comprising a certain number of partial upgrade packages adjacent to each other in the original order, the certain number being the maximum numerical value that the data having a predetermined number of bits can indicate plus 1, exchanging the order of two partial upgrade packages whose original orders differ by the numerical value indicated by the data in each partial upgrade package group.
[0019] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein changing the order of the partial upgrade package comprises: dividing the partial upgrade packages into partial upgrade package groups, each partial upgrade package group comprising a certain number of partial upgrade packages adjacent to each other in the original order, the certain number being determined in advance at the server, exchanging the order of two partial upgrade packages whose original order differs by a value less than a certain number in each partial upgrade package group.
[0020] A server-side firmware upgrade method according to an embodiment of this disclosure further comprises: generating a matrix corresponding to the number of partial upgrade packages, ordering the partial upgrade packages in the matrix, wherein changing the order of the partial upgrade packages comprises performing a translation of the partial upgrade packages in the matrix according to the order identifier.
[0021] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein generating a matrix corresponding to the number of partial upgrade packages comprises: determining whether to generate an odd-dimensional matrix or an even-dimensional matrix corresponding to the number of partial upgrade packages.
[0022] A server-side firmware upgrade method according to an embodiment of this disclosure, further comprising: filling the matrix with one or more of garbled packets, empty packets, and repeated partial upgrade packets.
[0023] A server-side firmware upgrade method according to an embodiment of this disclosure, wherein the order identifier indicates one or more of the number of translations of the partial upgrade packages in the matrix, the pushing-out direction of the partial upgrade packages, and the clockwise and counterclockwise rotation of the partial upgrade packages in the matrix.
[0024] A server-side firmware upgrade method according to an embodiment of this disclosure further comprises: determining a type of translation of the partial upgrade packages according to the number of the partial upgrade packages in the matrix and the dimension of the matrix.
[0025] A server-side firmware upgrade method according to an embodiment of this disclosure further comprises: storing the header of the target firmware upgrade package and / or transmitting the header of the target firmware upgrade package to the target terminal, wherein the header of the target firmware upgrade package includes one or more of the identification code of the target terminal, the number and number of the partial upgrade packages, a firmware upgrade key, and / or integrity check information.
[0026] According to an embodiment of this disclosure, there is provided a firmware upgrade method applied to a terminal device, comprising: obtaining an instruction for firmware upgrade; transmitting an identification code of a target terminal device; downloading partial upgrade packages from a server; splicing the partial upgrade packages into a target firmware upgrade package based on an identification code of the target terminal device.
[0027] A firmware upgrade method applied to a terminal device according to an embodiment of this disclosure, the method further comprising downloading a header of the firmware upgrade package from the server and performing the following steps, by a security boot program: determining, based on the order identifier in the identification code of the terminal device, whether to change the order of the downloaded partial upgrade packages in response to downloading all of the partial upgrade packages and the firmware upgrade package header to the terminal device; performing a security or integrity check on the downloaded partial upgrade packages; executing the target firmware spliced by the partial upgrade packages in response to the downloaded partial upgrade packages passing the security or integrity check.
[0028] A firmware upgrade method applied to a terminal device according to an embodiment of this disclosure, wherein obtaining a firmware upgrade instruction comprises obtaining the firmware upgrade instruction and the security verification key in a manner separate from the wide area network; wherein downloading partial upgrade packages from the server comprises obtaining the firmware upgrade package and a security key of the firmware upgrade package via the wide area network; performing the security verification on the downloaded partial upgrade packages comprises determining whether the security verification key matches the security key of the firmware upgrade package.
[0029] According to one embodiment of this disclosure, there is provided a firmware upgrade device applied to a server, comprising: firmware upgrade package obtaining means for obtaining a target firmware upgrade package; receiving means for receiving an identification code of a target terminal; dividing means for dividing the target firmware upgrade package into partial upgrade packages based on the identification code of the target terminal; storing / transmitting means for storing the partial upgrade packages and / or transmitting the partial upgrade packages to the target terminal.
[0030] According to one embodiment of this disclosure, there is provided a firmware upgrade device applied to a terminal device, comprising: firmware upgrade instruction obtaining means for obtaining firmware upgrade instructions; receiving means for transmitting an identification code of a target terminal device; downloading / receiving means for downloading / receiving the partial upgrade packages from the server; splicing means for splicing the partial upgrade packages into a target firmware upgrade package based on the identification code of the target terminal device.
[0031] According to one embodiment of this disclosure, a server is provided, comprising a memory and one or more processors, the server comprising a memory and one or more processors, wherein a computer program is stored on the memory, and when the computer program is executed by the one or more processors, a firmware upgrade method applied to a server as described above is implemented.
[0032] According to one embodiment of this disclosure, a terminal device is provided, the device comprising a memory and one or more processors, wherein a computer program is stored on the memory, and when the computer program is executed by the one or more processors, a firmware upgrade method applied to a terminal device as described above is implemented.
[0033] According to one embodiment of this disclosure, a method for secure booting is provided for a terminal device, comprising: determining, based on the order identifier in the terminal device's identification code, whether to change the order of the downloaded partial upgrade packages in response to downloading all partial upgrade packages and the firmware upgrade package header to the terminal device; performing a security or integrity check on the downloaded partial upgrade packages; executing the target firmware spliced through the partial upgrade packages in response to the downloaded partial upgrade packages passing the security or integrity check.
[0034] According to one embodiment of this disclosure, a security verification method for a target terminal is provided, comprising: obtaining a firmware upgrade instruction and a security verification key in a manner separate from the wide area network; obtaining a firmware upgrade package and a security key of the firmware upgrade package via the wide area network; determining whether the security verification key matches the security key of the firmware upgrade package.
[0035] A security verification method according to an embodiment of this disclosure, wherein obtaining a firmware upgrade package via wide area network comprises downloading a partial upgrade package from the server via wide area network, the method further comprising: transmitting the identification code of the target terminal; splicing the partial upgrade packages into a target firmware upgrade package based on the identification code of the target terminal.
[0036] A security verification method according to an embodiment of this disclosure, the method further comprising downloading a header of the firmware upgrade package from the server and performing, by a security boot program, the following steps: determining, based on the sequence identifier in the identification code of the target terminal, whether to change the order of the downloaded partial upgrade packages in response to downloading all partial upgrade packages and the firmware upgrade package header to the target terminal; performing a security or integrity check on the downloaded partial upgrade packages; executing the target firmware spliced by the partial upgrade packages in response to the downloaded partial upgrade packages passing the security or integrity check. SHORT DESCRIPTION OF THE CHARACTERS
[0037] The above and other aspects, features, and advantages of certain embodiments of the disclosure will become more apparent from the following description taken in conjunction with the accompanying drawings, in which: Fig. 1 is a flowchart of a firmware upgrade method applied to a server according to an embodiment of the disclosure; Fig. 2 is a flowchart of a firmware upgrade method applied to a terminal device according to an embodiment of the disclosure; Fig. 3 is a flowchart of a firmware upgrade method applied to a server according to an embodiment of the disclosure; Fig. 4 is a flowchart of a firmware upgrade method applied to a terminal device according to an embodiment of the disclosure; Fig.5A-5C are schematic diagrams of a server changing the order of partial upgrade packages within an odd-dimensional matrix in a clockwise and left-shift direction, according to an embodiment of the disclosure; Fig. 5D is a schematic diagram of an inverse process of a data packet translation process according to an embodiment of the disclosure; Fig. 6 is a flowchart for determining a type of translation of data packets within an odd-dimensional matrix according to an embodiment of the disclosure; Fig. 7 is a flowchart of an inverse process of a translation process of a data packet according to an embodiment of the disclosure; Fig.8 is a flowchart for determining the number of translations performed by the server that must continue to be performed to restore the order of the partial upgrade package, according to an embodiment of the disclosure; Fig. 9A-9D are schematic diagrams of the manner in which a server performs translation of data packets within an odd-dimensional matrix according to various shift directions, according to an embodiment of the disclosure; Fig. 10 is a schematic diagram of a server that changes the order of partial upgrade packages based on an order identifier indicating that the push-out direction is left and counterclockwise, according to an embodiment of the disclosure; Fig.11 is a schematic diagram of a server changing the order of partial upgrade packages within an even-dimensional matrix in a clockwise and leftward push-out direction, according to an embodiment of the disclosure; Fig. 12 is a flowchart for determining a type of translation of data packets within an even-dimensional matrix according to an embodiment of the disclosure; Fig. 13A-13D are schematic diagrams of the manner in which a server performs translation of data packets within an even-dimensional matrix according to various shift directions, according to an embodiment of the disclosure; Fig. 14 illustrates a firmware upgrade device for a server according to an embodiment of the disclosure; Fig. 15 illustrates a firmware upgrade device for a terminal device according to an embodiment of the disclosure; Fig.16 is a flowchart for securely booting a target terminal according to an embodiment of the disclosure; Fig. 17 is a flowchart for security verification with a combination of off-network and on-network for the target terminal according to an embodiment of the disclosure. DETAILED DESCRIPTION OF REVELATION
[0038] Before proceeding with the following detailed description, it may be beneficial to explain the definitions of certain words and phrases in this patent document. The terms "comprise" and "include" and their derivatives refer to including, but not limited to. The term "control device" or "control unit" refers to any device, system, or part thereof that controls at least one process. Such a control device may be implemented in hardware or in a combination of hardware and software and / or firmware. The functions associated with a particular control device may be centralized or distributed, either locally or remotely. The phrase "at least one" in conjunction with a list of elements means that various combinations of one or more of the listed elements may be used, and only one element in the list may be required.For example, “at least one of A, B, C” includes any of the following combinations: A, B, C, A and B, A and C, B and C, A and B and C.
[0039] Further definitions of specific words and phrases are included in this patent document. It should be clear to one skilled in the art that these definitions apply in many, if not most, cases to past and future uses of the words and phrases so defined.
[0040] The following description of various embodiments of the principles of the present disclosure in this specification, taken in conjunction with the accompanying drawings, is for illustrative purposes only and is in no way intended to limit the scope of the present disclosure. Those skilled in the art will understand that the principles of the present disclosure may be implemented in any suitable system or device. In some cases, the acts described in the description may be performed in a different order and still achieve the desired results. Furthermore, the processes illustrated in the accompanying drawings do not necessarily require the illustrated order to achieve the desired results. Multitasking and parallel processing may be advantageous in certain cases.
[0041] The Internet of Things (IoT) is a real-time collection of objects or processes that are monitored and connected by various information sensors, radio frequency identification technology, global positioning systems, infrared sensors, laser scanners, and other various devices and technologies. They must interact with each other to collect various required information such as sound, light, heat, electricity, mechanics, chemistry, biology, and location. They can achieve intelligent sensing and management of objects and processes through various types of networks. Through various types of network access, it realizes the ubiquitous connection between things and objects, as well as between things and people, and realizes the intelligent sensing, identification, and management of objects and processes. The IoT is a network based on the Internet, traditional telecommunications networks, and so on.based information carrier that enables all ordinary physical objects that can be addressed independently of one another to form an interconnected network. In contrast to network security in the traditional sense, IoT security is a product of the integration of network security with other technical disciplines. IoT security is much more comprehensive than just data, server, network infrastructure, and information security. Furthermore, IoT security must include the direct or distributed monitoring and control of the state of the connected physical systems. There are a large number of end devices in IoT systems, a large proportion of which are monolithic devices with limited computing and storage resources.In this highly resource-constrained device environment, traditional operating system-based security management solutions such as firewalls and application shops are unable to ensure device security during upgrades.
[0042] Taking the Android system terminal as an example, the terminal device can be upgraded through the application store. In some cases, the firmware upgrade can be performed through the application store. Although the source of the upgrade package is legal and there is encryption processing during the transmission process, both the full package and the differential package complete the entire upgrade process as a whole. If each terminal device upgrades the same firmware, the firmware upgrade package and the upgrade process are the same, which does not effectively avoid the security risks in the upgrade process. In other cases, the firmware can be downloaded in APK format from the website to upgrade the firmware, and it is also difficult to avoid the security risks in the firmware upgrade process because it involves the subjective judgment and selection of risks by users.
[0043] The embodiment of the present invention provides a firmware upgrade method, a device, a server, a terminal device, and a storage medium that can effectively avoid security risks in the firmware upgrade process. Since different devices may have different identification codes, the partial upgrade packages and firmware upgrade processes of different devices may be different, and a single device cannot leak the information of other devices when hacked, and it is difficult to observe regular and widespread disruption of the firmware upgrade of terminal devices in the network. The difficulty of cracking the system is proportional to the number of terminal devices, which is especially suitable for large-scale sensor and controller networks, military, and factory scenarios.
[0044] Fig.1 is a flowchart of a firmware upgrade method applied to a server according to an embodiment of the disclosure.
[0045] In step S101, the server receives the target firmware upgrade package. For example, a firmware upgrade package created by a developer may be obtained. When the developer develops the upgraded firmware, the upgraded firmware adds to or rewrites the existing firmware on the device, allowing it to function with maximum efficiency and security again. For example, if a bug occurs that needs to be fixed or a new security patch is created, the currently installed firmware is no longer applicable. For devices that frequently access the Internet or need to constantly update their security features, firmware upgrades can occur very frequently. In practical applications, the firmware upgrade package can be considered a whole file that is debugged and tested by developers when creating the firmware upgrade package.
[0046] In step S102, the server receives the identification code of the target terminal. For example, the server receives its identification code from the target terminal.
[0047] The target terminal device may refer to the terminal device to be upgraded, and the terminal device may be any terminal device in the Internet of Things, such as various information sensors, radio frequency identification devices, global positioning systems, infrared sensors, laser scanners, computers, etc.
[0048] In some implementations, the identification code may point to the SN (serial number) code of the pre-configured terminal device, and the firmware upgrade package in the related technology is made into a unified upgrade package file. Therefore, when upgrading the firmware of a group of terminal devices, the firmware upgrade package and upgrade process of each terminal device are the same. Once the firmware upgrade package is intercepted during transmission (download), it is easy for the entire firmware upgrade package to be leaked or even tampered with. Therefore, the security of terminal devices with the same firmware upgrade requirements cannot be effectively guaranteed during the firmware upgrade.
[0049] In the firmware upgrade security mechanism adopted in this embodiment, each terminal device is provided with an identification code configured with a certain degree of adaptability, and at least some fields in the identification code are configured with upgrade information, and the identification code is customized for each terminal device. Since the identification codes of terminal devices with the same firmware upgrade requirements are configured differently or not exactly the same, the specific forms of unpacking transmission (downloading) are not all consistent, so even if the information of a single terminal device is leaked, it will not cause a security problem for all terminal devices of the entire system.
[0050] In some implementations, the upgrade information includes at least one of the size of the partial upgrade packet, the order identifier of the partial upgrade packet, and the download address offset of the partial upgrade packet. Among them, the size of the partial upgrade packet is the size of each partial upgrade packet when the partial upgrade packets are split, for example, the size of the partial upgrade packet can be transmitted by 7 bits. The order identifier of the partial upgrade packet is used to distinguish whether and how to change the order of each partial upgrade packet, so as to change the transmission order of the split partial upgrade packets, improve the complexity in the transmission process, and prevent the entire firmware upgrade package from being leaked or even tampered with during eavesdropping.In practice, the sequence identifier of the various partial upgrade packages may be set randomly or according to a certain rule, and the embodiment is not limited thereto.
[0051] An example of the composition of the identification code is shown in Table 1: Table 1 Header field Order identifier Size of the partial upgrade package Download address offset Tail field Multiple bytes 1 bit (0 or 1) 7 bits (represents the size of the partial upgrade package from 0-127 bits) Multiple bytes Multiple bytes
[0052] The identification codes in Table 1 include the header field, the sequence identifier of the partial upgrade packet, the size of the partial upgrade packet, the download address offset of the partial upgrade packet, and the tail field. The sequence identifier of the partial upgrade packet, the size of the partial upgrade packet, and the position of the download address offset of the partial upgrade packet in the identification code are only schematic and can be located in different orders in the identification code. The total number of bits of the identification code and various bytes (or bits) such as the upgrade information, header field, and tail field can be determined according to the actual identification code configuration rules.Among them, the header field and tail field can refer to the settings of the header field and tail field in the SN in the related art to identify the basic information of the corresponding terminal device. The header field and tail field can also be customized. In some cases, the header field and tail field can be omitted, that is, the identification code is configured only with the upgrade information.
[0053] In step S103, the server splits the target firmware upgrade package into partial upgrade packages based on the identification code of the target terminal. The server stores or transmits the split package during the firmware upgrade process. Splitting the package may require input of the identification number of the terminal to be upgraded, or the server may automatically split the firmware upgrade package according to the identification number of the terminal. In one embodiment, the server may split the target firmware upgrade package into a series of partial upgrade packages based on the size of the target firmware upgrade package and the size of the partial upgrade package in the identification code of the target terminal. Alternatively, the server may split the target firmware upgrade package into multiple partial upgrade packages based on the size of the target firmware upgrade package and the size of the predetermined partial upgrade package, or based on other mechanisms.In one embodiment, the server may determine whether to change the order of the partial upgrade packages and how to change the order of the partial upgrade packages based on the order identifier of the partial upgrade packages in the identification code of the target terminal.
[0054] In step S104, the server stores and / or transmits the partial upgrade package to the target terminal. The server stores each partial upgrade package file on the server and transmits it when the firmware of the target terminal is upgraded. Alternatively or additionally, the partial upgrade package file is transmitted to the target terminal when the current target terminal is in a firmware upgrade process. In practical applications, the server may store multiple split partial upgrade packages in advance and start transmitting the partial upgrade packages to the target terminal when the terminal requests it. Alternatively or additionally, the server may automatically transmit to the target terminal. In one embodiment, multiple split partial upgrade packages may be stored and transmitted to the target terminal at the same time to realize backup.In one embodiment, the server may determine an address where the partial upgrade package is stored based on the identification code of the target terminal device, so that the terminal device can download the partial upgrade package from that address. For example, the server may receive the terminal device's identification code sn001 from the terminal device. The server stores the partial upgrade package at PROTOCOL: / / HOSTNAME / PATH / sn001 based on the modifiable default address PROTOCOL: / / HOSTNAME / PATH / SN and the target terminal device's identification code sn001. The target terminal device can download the partial upgrade package from the address PROTOCOL: / / HOSTNAME / PATH / sn001. The specific form of the above address is exemplary, not restrictive. Alternatively, the server may store the partial upgrade package at a predetermined address so that the terminal device can download the partial upgrade package from the predetermined address.
[0055] Fig.2 is a flowchart of a firmware upgrade method applied to a terminal device according to an embodiment of the disclosure. The terminal device may be various Internet of Things terminal devices, such as smart sensors (such as sensors for collecting environmental data such as temperature, humidity, vibration, pressure, liquid level, etc.), smart home devices (such as smart plugs, smart lights, smart stereos, smart washing machines, smart refrigerators, smart air purifiers, etc.), smart wearable devices (such as smart streetlights, smart cars, smart parking lots, etc.), smart medical devices (such as smart blood pressure monitors, smart health bracelets, smart paging machines), smart industrial devices (such as CNC machine tools, industrial robots), etc. The above-mentioned terminal devices may be realized by embedded technology or other technologies.
[0056] In step S201, the terminal device receives a firmware upgrade instruction. In some implementations, the firmware upgrade command is transmitted from a broadcast device separate from the wide area network or triggered by the terminal device's preset buttons. The broadcast device separate from the wide area network can be, for example, a handling broadcast device. The broadcast device separate from the wide area network can be implemented using short-range wireless communication such as Bluetooth, Bluetooth LE, ZigBee, radio frequency identification (RFID), UWB, 60GHz, Wi-Fi, WiMAX, or wired communication such as USB. Since the broadcast device is separated from the wide area network, security risks when transmitting through the wide area network can be well avoided without using the wide area network. Terminal devices can also preset buttons, such asPhysical buttons such as toggle, slide key, and push button, as well as specific areas displayed on the touchscreen, are used to trigger firmware upgrade commands and implement the off-network and on-network cooperative upgrade strategy. In one embodiment, the firmware upgrade command can be transmitted from the server to the terminal device via the wide area network. In practical applications, one or more of the following options can be selected according to the firmware upgrade requirements: sending the firmware upgrade command by the broadcast device, triggering the firmware upgrade command by a preset button of the terminal device, or sending the firmware upgrade command by the server via the wide area network.
[0057] In step S202, the terminal device sends the identification code of the target terminal. For example, the terminal device can obtain the identification code of the target terminal from the memory area of the flash chip of the terminal device. The identification code of the target terminal has already been received in step S102 by Fig. 1, and the description is not repeated here.
[0058] In step S203, the terminal device receives (downloads) the partial upgrade packages. In one embodiment, the terminal device can download the partial upgrade package from the server.
[0059] In one embodiment, the identification code may also include a memory address offset, but this is not required. For example, the terminal device stores the partial upgrade package in a memory address of a flash memory of the terminal device, which is determined based on the modifiable memory address and the memory address offset. This enables partitioned storage of the partial upgrade packages in the terminal device. The memory address offset of the partial upgrade packages is used to determine the memory address of the partial upgrade packages in the terminal device, in order to implement partitioned storage of the partial upgrade packages in the terminal device. In practical applications, the partial upgrade packages are stored in the flash chip of the terminal device, and by dividing the flash chip into different memory areas, the partial upgrade packages can be stored in partitions in the terminal device.
[0060] Examples of the memory area partition of the end device's flash chip are shown in Table 2: Table 2 Memory address offset function note 00000000 Memory address of the identification code (SN) SN consists of 16 bytes. 0000000F Modifiable download address (PROTOCOL: / / HOST NAME / PATH / SN) The modifiable download address is a string representing the firmware download address that the terminal device can change according to the terminal device identification code. 00000500 Memory address of the first packet It can be determined by modifiable memory address and identification code. 0000057F Memory address of the second packet It can be determined by modifiable memory address and identification code. 000005FF Memory address of the third packet It can be determined by modifiable memory address and identification code. ...... ...... It can be determined by modifiable memory address and identification code. FFFFFF7F Reserved address of the Tmp package It can be determined by modifiable memory address and identification code.
[0061] It can be seen that the partial upgrade packages in the terminal device are stored in partitions by dividing different memory areas in the flash chip.
[0062] In one embodiment, the terminal device can determine the address for downloading the partial upgrade package from the server based on the terminal device's identification code and the modifiable default download address read from the terminal device's flash chip according to the download address offset. For example, in the example in Table 2, the terminal device can obtain the download address offset address_offset001 of the target terminal device based on the identification code read from the flash chip's 0000000 address. The terminal device can read the modifiable address PROTOCOL: / / HOSTNAME / PATH / SN from the flash chip address 0000000f based on address_offset001, and determine to download the partial upgrade package stored in the server from PROTOCOL: / / HOSTNAME / PATH / sn001 according to the terminal device's identification code sn001 and the modifiable address PROTOCOL: / / HOSTNAME / PATH / SN. The specific form of the above address is exemplary and not restrictive.Alternatively, the terminal device can download the partial upgrade package from a predetermined address.
[0063] In step S204, the partial upgrade packets are spliced into a target firmware upgrade packet based on the identification code of the target terminal. For example, based on the order identifier of the partial upgrade packets in the identification code of the target terminal, the terminal may determine whether to change the order of the received partial upgrade packets and how to change the order of the partial upgrade packets to further splice the partial upgrade packets into the target firmware upgrade packet. In one embodiment, splicing may refer to reading the partial upgrade packets from the storage area of the target terminal in order. In some embodiments, a soft reboot is also performed after splicing the partial upgrade packets into the target firmware upgrade packet.
[0064] Fig.3 is a flowchart of a firmware upgrade method applied to a server according to an embodiment of the disclosure.
[0065] In step S301, the server receives the target firmware upgrade package. The part of step S301 in Fig. 3, which corresponds to step S101 in Fig. 1 is similar, will not be repeated here.
[0066] In step S302, the server receives the identification code of the destination terminal. The part of step S302 in Fig. 3, which corresponds to step S102 in Fig. 1 is similar, will not be repeated here.
[0067] In step S303, the server determines whether to change the order of the partial upgrade packages based on the identification code of the target terminal. If it is determined that the order of the partial upgrade packages should be changed, the process proceeds to S304. In S304, the server divides the target firmware upgrade package into partial upgrade packages, performs the order change, and numbers the partial upgrade packages. If it is determined that the order of the partial upgrade packages should not be changed, the process proceeds to S305. In S304, the server divides the target firmware upgrade package into partial upgrade packages without performing the order change and numbers the partial upgrade packages. In one embodiment, each partial upgrade package is numbered 0001, 0002, 0003, 0004, 0005 on the server.Regardless of whether the order of each partial upgrade packet is changed or not, the numbering is written sequentially and indicates the order in which the partial upgrade packets are transmitted. In one embodiment, the header of each partial upgrade packet may contain a number of the partial upgrade packet. In one embodiment, the header of each partial upgrade packet may also contain the identification code of the destination terminal and the number of partial upgrade packets.
[0068] In one embodiment, the sequence identifier may be binary data. However, the binary data is only exemplary, and in other embodiments, the sequence identifier may be other forms of identification.
[0069] In some implementations, in step S303, it is determined whether the order of individual partial upgrade packages should be changed while splitting the target firmware upgrade package into multiple partial upgrade packages based on whether the value corresponding to the binary data with a preset number of bits is a predetermined value (e.g., 0). The security of the transmission (download) of the firmware upgrade package can be improved by determining the order of the partial upgrade packages based on the order identifier and changing the order of the partial upgrade packages during splitting.
[0070] For example, a specific order modification rule may be that in S304, multiple partial upgrade packages are divided into multiple pairs of adjacent partial upgrade packages, and the order of two partial upgrade packages in each pair of adjacent partial upgrade packages is swapped. Changing the order of the partial upgrade packages according to this rule greatly increases the difficulty of being intercepted, leaked, and tampered with during the transmission (download) of the firmware upgrade package, thus improving the security of the firmware upgrade.
[0071] In one example, if the preset number of bits is 1, the binary data contains 0 or 1, and the corresponding numerical value is also 0 or 1. In step S303, if the numerical value corresponding to the binary data corresponding to the sequence identifier in the identification code of the current terminal device is 0, the sequence of each partial upgrade package remains unchanged while splitting the target firmware upgrade package into multiple partial upgrade packages. And if the numerical value corresponding to the binary data corresponding to the sequence identifier in the identification code of the current terminal device is 1, it is necessary to change the sequence of each partial upgrade package while splitting the target firmware upgrade package into multiple partial upgrade packages. Alternatively, the opposite setting may also be made.
[0072] In some implementations where the preset number of bits is 1, adjacent partial upgrade packets may be swapped in order in S304 to realize the change in the order of the partial upgrade packets. Thus, the order of each partial upgrade packet is changed according to the numerical value corresponding to the binary data with the preset number of bits, including: splitting multiple partial upgrade packets into multiple pairs of adjacent partial upgrade packets; swapping the order of two partial upgrade packets in each pair of adjacent partial upgrade packets. Also, in the previous example, if the preset number of bits is 1, the binary data contains 0 or 1. If the numerical value corresponding to the order identifier in the identification code of the current terminal is 1, it is determined to change the order of each partial upgrade packet.In this case, multiple partial upgrade packages obtained by splitting the target firmware upgrade package are divided into multiple pairs of adjacent partial upgrade packages, and the order of two partial upgrade packages in each pair is swapped. However, if the numeric value corresponding to the order identifier in the identification code of the current terminal device is 0, this order swap operation is unnecessary, and the original order can be maintained.
[0073] In another example, if the preset number of bits is 2, the binary data includes 00, 01, 10, and 11, and the corresponding numerical values are 0, 1, 2, and 3. In step S303, if the binary data 00 corresponding to the sequence identifier in the identification code of the current terminal device corresponds to the numerical value 0, the target firmware upgrade package is divided into multiple partial upgrade packages, while the order of each partial upgrade package remains unchanged. However, if the corresponding binary data 01, 10, or 11 corresponding to the sequence identifier in the identification code of the current terminal device corresponds to the numerical value 1, 2, and 3, the target firmware upgrade package is divided into multiple partial upgrade packages, and the order of each partial upgrade package needs to be changed. Alternatively, a different setting from the above setting can be made.
[0074] In some implementations, it is also possible to determine in step S303 whether the change of the order of the partial upgrade packets should be performed according to the parity of the numerical values corresponding to the binary data with a preset number of bits.Therefore, according to the numerical value corresponding to the binary data with preset number of bits, it is determined whether to change the order of each partial upgrade package while splitting the target firmware upgrade package into multiple partial upgrade packages, including: when the numerical value corresponding to the binary data with preset number of bits is even, it is determined that the order of each partial upgrade package remains unchanged while splitting the target firmware upgrade package into multiple partial upgrade packages; when the numerical value corresponding to the binary data with preset number of bits is odd, it is determined that the order of each partial upgrade package is changed while splitting the target firmware upgrade package into multiple partial upgrade packages.Alternatively, if the numeric value corresponding to the binary data with a preset number of bits is even, it is determined that the order of each partial upgrade packet remains unchanged while the target firmware upgrade packet is split into multiple partial upgrade packets; if the numeric value corresponding to the binary data with a preset number of bits is even, it is determined that the order of each partial upgrade packet is changed while the target firmware upgrade packet is split into multiple partial upgrade packets. If the preset number of bits is 1, the process for determining whether to change the order of the partial upgrade packets according to parity is similar to the process for determining whether to change the order of the partial upgrade packets based on whether the order identifier is 0 or 1.
[0075] In some implementations, it is also possible to determine in step S303 whether the change in the order of the partial upgrade packets should be performed by taking the remainder of the numerical value corresponding to the binary data with a preset number of bits above a predetermined value. Therefore, it is determined whether the change in the order of the partial upgrade packets should be performed while dividing the target firmware upgrade packet into multiple partial upgrade packets by taking the remainder of the numerical value corresponding to the binary data with a preset number of bits above a predetermined value, including: if the detected remainder of the numerical value corresponding to the binary data with a preset number of bits above the predetermined value is one of one or more specific numerical values, it is determined that the order of each partial upgrade packet remains unchanged,while the target firmware upgrade package is divided into multiple partial upgrade packages; if the detected remainder of the numerical value corresponding to the binary data with a preset number of bits above the predetermined value is not one of one or more specific numerical values, it is determined that the order of each partial upgrade package is changed while the target firmware upgrade package is divided into multiple partial upgrade packages. Alternatively, if the detected remainder of the numerical value corresponding to the binary data with a preset number of bits above the predetermined value is one of one or more specific numerical values, it is determined that the order of each partial upgrade package is changed,while the target firmware upgrade package is divided into multiple partial upgrade packages; if the detected remainder of the numerical value corresponding to the binary data with a preset number of bits above the predetermined value is not one of one or more specific numerical values, it is determined that the order of each partial upgrade package remains unchanged while the target firmware upgrade package is divided into multiple partial upgrade packages. For example, if the predetermined numerical value is 3, based on the detected remainder of the numerical value corresponding to the binary data with a preset number of bits above the predetermined value being a specific numerical value (e.g., 0), it can be determined whether to change the order of each partial upgrade package while the target firmware upgrade package is divided into multiple partial upgrade packages. If the predetermined value is 2, the process of determiningwhether the change in the order of the partial upgrade packets should be performed by taking the remainder of the numerical value corresponding to the binary data with a preset number of bits over the predetermined value, similar to the process of determining whether the order of the partial upgrade packets should be changed according to parity.
[0076] In some implementations, the order swapping rules may be determined according to the numerical values corresponding to the binary data with a preset number of bits. Thus, in step S304, the order of each partial upgrade packet is changed according to the numerical value corresponding to the binary data with a preset number of bits, including: dividing the partial upgrade packets into multiple partial upgrade packet groups, each partial upgrade packet group containing a specific number of partial upgrade packets, and the specific number is the numerical value plus 1, the numerical value corresponding to the maximum binary data with a preset number of bits; and swapping the order of two partial upgrade packets in each group of partial upgrade packets that differ in order by the numerical value corresponding to the binary data with a preset number of bits.
[0077] Also in the previous example, when the preset number of bits is 2, the binary data includes 00, 01, 10, and 11, and the numeric value corresponding to the maximum binary data of 2 bits is 3. If the numeric value corresponding to the binary data 00, which corresponds to the sequence identifier in the identification code of the current terminal device, is 0, the target firmware upgrade package will be split into multiple partial upgrade packages, while the order of each partial upgrade package remains unchanged, so there is no need to swap. However, if the numeric value corresponding to the binary data 01, 10, or 11, which corresponds to the sequence identifier in the identification code of the current terminal device, is 1, 2, and 3, the target firmware upgrade package will be split into multiple partial upgrade packages, and the order of each partial upgrade package needs to be changed.The binary data corresponding to the sequence identifier is taken as 10 as an example, and the corresponding numerical value is 2. In this case, the specific way of changing the sequence is: divide several partial upgrade packets into several groups, each group contains 4 partial upgrade packets (that is, the numerical value corresponding to the maximum binary data is 3 + 1), where the first group contains the zeroth packet, the first packet, the second packet, and the third packet, and the sequence of two partial upgrade packets with a difference of two bits in the sequence is exchanged, that is, the zeroth packet is exchanged with the second packet, and the first packet is exchanged with the third packet.When the preset number of bits is 1, the process of grouping the partial upgrade packets by the numerical value corresponding to the maximum binary data with the preset number of bits plus 1, and changing the order of the partial upgrade packets by the numerical value corresponding to the maximum binary data with the preset number of bits, is similar to the process of dividing the partial upgrade packets into multiple pairs of adjacent partial upgrade packets and changing the order of two partial upgrade packets in each pair to change the order of the partial upgrade packets. Following a similar principle, the case where the preset number of bits is 3, 4, ... n, is not individually cited in this embodiment. The more preset bits and / or the more complicated the order exchange rule, the higher the transmission (download) complexity in the firmware upgrade process.
[0078] Although some of the above embodiments associate the determination of whether the order is changed and how the order is changed with the preset number of bits of the order identifier, the disclosure is not limited thereto. For example, in the embodiment where the preset number of bits is 1, the binary data contains 0 or 1, and the corresponding numeric value is also 0 or 1.In step S303, when the numerical value corresponding to the binary data corresponding to the sequence identifier in the identification code of the current terminal is 0, the target firmware upgrade package is divided into a plurality of partial upgrade packages while keeping the order of each partial upgrade package unchanged, and when the numerical value corresponding to the binary data corresponding to the sequence identifier in the identification code of the current terminal is 1, the target firmware upgrade package is divided into a plurality of partial upgrade packages while changing the order of each partial upgrade package.However, the way of changing the order may be that the partial upgrade packages are divided into several partial upgrade package groups, and each partial upgrade package group contains a certain number of partial upgrade packages, and the number is a number (greater than or equal to 2) previously scheduled by the server and the target terminal; and the order of two partial upgrade packages in each group whose order differs by this number minus 1 (or whose order differs by other numerical values less than this number, for example, whose order differs by this number minus 2, etc.) is exchanged.For example, in the embodiment of determining whether to perform the change in the order of the partial upgrade packages, by taking the remainder of the numerical value corresponding to the binary data with a preset number of bits over the predetermined value, the manner of changing the order of the partial upgrade packages of the target terminals with different remainders can be set between the server and the target terminal. For example, if the remainder is 0, the order of the partial upgrade packages cannot be changed. If the remainder is 1, the partial upgrade packages can be divided into several pairs of adjacent partial upgrade packages, and the order of two partial upgrade packages in each pair of adjacent partial upgrade packages can be exchanged. If the remainder is 2, several sub-upgrades can be divided into several groups, each group containing 3 partial upgrade packages (ie,The remainder plus 1), and the order of two partial upgrade packages with a difference of 2 (i.e., the remainder) in the order may be exchanged. However, the disclosure is not limited to this.
[0079] In S306, the server generates the header of the target firmware upgrade package. The header of the target firmware upgrade package may contain one or more of the identification codes of the target terminal, the quantity and number of the partial upgrade packages, the firmware upgrade key, and / or the integrity verification information. The firmware upgrade key and / or the integrity verification information may be used for security verification of the terminal in the secure boot process.
[0080] In S307, the server stores and / or transmits the partial upgrade packages and the info package to the target terminal. The info package corresponds to the data package that provides the header of the target firmware upgrade package. The parts in S307 of Fig. 3, which is similar to S104 from Fig. 1 will not be repeated.
[0081] Fig. 4 is a flowchart of a firmware upgrade method applied to a terminal device according to an embodiment of the disclosure.
[0082] In S401, the terminal device receives a firmware upgrade instruction. The part of step S401 in Fig. 4, which corresponds to step S201 in Fig. 2 is similar, will not be repeated here.
[0083] In S402, the terminal sends the identification code of the destination terminal. The part of step S402 in Fig. 4, which corresponds to step S202 in Fig. 2 is similar, will not be repeated here.
[0084] In S403, the terminal device downloads the information packet. The terminal device obtains one or more of the identification codes of the target terminal device, the number of partial upgrade packages, the firmware upgrade key, and / or the integrity check information from the downloaded information packet. For example, it can check whether the identification code of the target terminal device in the information packet matches the identification code of this terminal device. Under the condition that the identification code of the terminal device matches the identification code in the information packet transmitted from the server, the partial upgrade packages sent by the server are downloaded, which are divided based on the upgrade information. If the obtained identification code of the terminal device does not match the identification code in the header transmitted from the server, the current firmware upgrade instruction may be illegal and the download operation cannot be executed.
[0085] The server can transmit GET information (INFO packets with header information) to the terminal device. The GET information can include the terminal device's identification code (SN), the number of split partial upgrade packets, the number of split partial upgrade packets, integrity check values such as the MD5 value, the firmware upgrade key, and other security verification information. In practical applications, more and more quantities and types of security verification information can be specified according to security requirements to realize terminal device security verification and improve firmware security.
[0086] In some cases, the header may also contain a firmware upgrade key and / or integrity verification information to verify against the firmware upgrade key and / or integrity verification information carried in the firmware upgrade instruction to improve security.
[0087] The information package transferred from the server is downloaded and stored in the default tmp partition of the end device for accessing the information during the upgrade process.
[0088] When downloading the partial upgrade packages, which are split based on the upgrade information transmitted by the server, package-by-package requests and package-by-package transfers and downloads may be used. Each time a partial upgrade package is downloaded, it may be determined whether the download of the last partial upgrade package is complete according to the information provided in the header. Therefore, in some implementations, the method further includes determining whether the download of the last partial upgrade package is complete according to the number of partial upgrade packages in the header.
[0089] Since the number and number of partial upgrade packages are determined, when each partial upgrade package is downloaded sequentially according to the number of the partial upgrade package, it can be judged whether all partial upgrade packages have been transferred according to the number of the partial upgrade package.
[0090] In S404, the terminal device determines whether to change the order of the partial upgrade packages based on the identification code.
[0091] If it is determined that the order of the partial upgrade packages is changed, the flow proceeds to S405. In S405, the terminal device downloads the partial upgrade packages. In S406, the terminal device determines whether the currently downloaded partial upgrade package is the last upgrade package. If the currently downloaded partial upgrade package is not the last upgrade package, the flow proceeds to S405. If the currently downloaded partial upgrade package is the last upgrade package, the flow proceeds to S407. In S407, the terminal device changes the order of the partial upgrade packages.
[0092] If it is determined that the order of the partial upgrade package should not be changed, the flow proceeds to S408. In S408, the terminal device downloads the partial upgrade package. In S409, the terminal device confirms whether the currently downloaded partial upgrade package is the last upgrade package. If the currently downloaded partial upgrade package is not the last upgrade package, the flow proceeds to S408. If the currently downloaded partial upgrade package is the last upgrade package, the flow proceeds to S410. In S410, the terminal device does not change the order of the partial upgrade packages.
[0093] Therefore, when the terminal device finishes downloading the partial upgrade package, it first determines whether to perform the order change on the partial upgrade package based on the order identifier. If the order change needs to be performed on the partial upgrade package, it changes the order of the partial upgrade package back to the original order and then splices each partial upgrade package into the original firmware upgrade package; if the order of the partial upgrade packages does not need to be changed, all partial upgrade packages can be directly spliced into the original firmware upgrade package.
[0094] In S411, the end device splices the partial upgrade packets into a target firmware upgrade packet.
[0095] The process in S404 in which the terminal determines whether to change the order of the partial upgrade packets based on the identification code, and the process in S406 in which the terminal changes the order of the partial upgrade packets to splice the changed order into the original order, is similar to steps 303 and 304 of Fig. 3 and will not be described again here.
[0096] Fig. 5A - Fig. 5C are schematic diagrams of a server changing the order of partial upgrade packages within an odd-dimensional matrix in a clockwise and left-shift direction, according to an embodiment of the disclosure;
[0097] In the Fig. 5A - Fig. 5C is the process of dividing the partial upgrade packages by the server based on the identification code of the destination terminal in relation to Fig.3, and the description is not repeated.
[0098] In one embodiment, the sequence identifier in the identification code may include data with a preset number of bits indicating at least one of the number of translations, the ejection direction, and the rotation direction. If the sequence identifier includes data with a preset number of bits indicating one or two of the number of translations, the ejection direction, and the rotation direction, the remaining parts of the number of translations, the ejection direction, and the rotation direction may be predetermined between the terminal device and the server in advance. Depending on the needs, the number of translations may be 1, 2, 3, or more. The ejection direction refers to the translation direction of the partial upgrade packet or other data packet that is moved out of the matrix during translation. Depending on the needs, the ejection direction may be up, down, left, right, or other directions.Depending on the requirements, the rotation direction can be clockwise or counterclockwise. For example, if the number of translations is 2, the shift direction is left, and the rotation direction is clockwise, it can be assumed that all data packets within the matrix are translated twice, and each time the data shifted out of the matrix is shifted out in a left-hand direction, and the data packets within the matrix are rotated clockwise. If the number of translations specified by the sequence identifier in the identification code is not 0, it can be determined that the order of the upgrade packets should be changed.
[0099] The server generates a matrix corresponding to the number N of partial upgrade packages into which the target upgrade package is divided. In one embodiment, the server determines the dimension of the generated matrix according to the number N of partial upgrade packages into which the target upgrade package is divided. T is calculated using the following formula: T=roundup(N)
[0100] Where roundup () means Rounding up. T undergoes a remainder operation of 2, and if the remainder is 0, an even-dimensional matrix is used. If the remainder is 1, an odd-dimensional matrix is used.
[0101] Next, with reference to Fig. 5A describes the way to change the order of partial upgrade packages using matrix with odd dimensions.
[0102] Assume that there are N = 17 partial upgrade packages. According to equation (1), T = 5, and the remainder of T over 2 is taken as 1, so it can be determined that a matrix with odd dimensions is generated. When generating a matrix with odd dimensions, the dimensions of the matrix are determined by the following equation: n=roundup(N−12)
[0103] According to equation (2), n = 2, then the dimension of the odd matrix is 2n+1=5. That is, in the case of N = 17 partial upgrade packages, a 5-dimensional matrix as in Fig. 5A. As shown in Fig.As shown in Figure 5A, the 17 partial upgrade packages with initial numbers S from 1 to 17 are arranged in the matrix from left to right in automatically permuted rows. The above arrangement is merely exemplary, and other arrangements may be used. Each position in the matrix from left to right and from top to bottom has the original serial number P_original. As shown in Fig. As shown in Figure 5A, the 17 partial upgrade packets may not exactly fill the 5-dimensional matrix, and the matrix may be filled with interference packets (garbled packets, empty packets, or one or more of the reused 17 partial upgrade packets) until the matrix is filled.
[0104] It is assumed that the sequence identifier contains data with a preset number of bits indicating that the number K of translation is 1, the shift direction is left, and the rotation direction is clockwise. As in Fig. As shown in Figure 5A, the data packet (P_original=21) with coordinates (1, 5) is moved to the left out of the matrix, and the data packet rotates clockwise within the matrix. After the data packet with coordinates (1, 5) is left-translated from the matrix, the matrix is Fig. 5B. Then, the data packet shifted from the matrix is stored in the emptying position in the middle of Fig. 5B, and the matrix on which the translation is performed is in Fig. 5C. The matrix of Fig. 5C is the matrix after the matrix of Fig. 5A is translated once to the left and clockwise.
[0105] Fig. 6 is a flowchart for determining a type of translation of data packets within an odd-dimensional matrix according to an embodiment of the disclosure.
[0106] With reference to Fig. 5A and Fig.Figure 6 describes the process of determining the translation type for each data packet in the matrix. The following process is performed for a data packet in the matrix.
[0107] In S601, it is determined whether the number K of translations is 0. The number of translations K = 1, and the flow goes to S602.
[0108] In S602, the layer number of the data packet (which is a partial upgrade packet) with the original serial number P_original in the matrix can be determined according to the original serial number P_original. The original serial number P_original=13 of the data packet located in the middle of Fig. The data packet located in 5A is taken as an example. P_original / (2n+1)=(Y−1)……X where (Y-1) is the quotient and X is the remainder. Equation (3) shows that the coordinates (X, Y) = (3, 3) of the partial upgrade package in the matrix are determined according to the original number P_original = 13. Layer=max(|X−n−1|,|Y−n−1|)
[0109] Where max (|Xn-1|, |Yn-1|) means taking the maximum value of |Xn-1| and |Yn-1|. According to equation (4), it can be calculated that the layer number of the data packet with the original serial number P_original=13 in the matrix is Layer = 0. At the same time, the value of K is decreased by 1, i.e., K'=K-1, K'=0, and K=K'.
[0110] When translating to the left, depending on the layer number on which the data packet is located in the matrix and the coordinates of the data packet in the matrix, it can be determined how the data packet is moved within the matrix, under the following conditions:
[0111] Condition 1: the coordinate of the data packet Y=(n+1)+Layer.
[0112] In S603, if condition 1 is met, the flow goes to S604, and the coordinates of the data packet are changed as follows: the value of X is reduced by 1, and the value of Y remains unchanged. If condition 1 is not met, the flow goes to S605.
[0113] In Fig. 5A, a data packet satisfying condition 1 corresponds to a data packet that undergoes a left translation, ie, a data packet that is contained in a dashed area 1.
[0114] Condition 2: the coordinate of the data packet X = n+1 layer and n+1 layer < Y < n+1+layer.
[0115] In S605, if condition 2 is met, the flow goes to S606 and the coordinates of the data packet are changed as follows: the value of X is unchanged and the value of Y is reduced by 1. If condition 2 is not met, the flow goes to S607.
[0116] In Fig.5A, a data packet satisfying condition 2 corresponds to a data packet that undergoes an upper translation, ie, a data packet that is contained in the deleted areas 2.
[0117] Condition 3: the coordinate of the data packet Y=n+1 layer and n+1 layer < =X <n+1+ Layer.
[0118] In S607, if condition 3 is met, the flow goes to S608 and the coordinates of the data packet are changed as follows: the value of X is increased by 1 and the value of Y remains unchanged. If condition 3 is not met, the flow goes to S609.
[0119] In Fig. 5A, a data packet satisfying condition 3 corresponds to a data packet that undergoes a right translation, ie, a data packet that is contained in the dashed areas 3.
[0120] Condition 4: the coordinate of the data packet Y=n+1 layer and n+1 layer < =X <n+1+Layer.
[0121] In S609, if condition 4 is satisfied, the flow goes to S610 and the coordinates of the data packet are changed as follows: the value of X remains unchanged and the value of Y is increased by 1.
[0122] In Fig. 5A, a data packet satisfying condition 4 corresponds to a data packet that undergoes a lower translation, ie, a data packet that is contained in the deleted areas 4.
[0123] It should be clear to those skilled in the art that since in this embodiment, in addition to the movement into the matrix, there are four translation modes of the data packet within the matrix, namely up, down, left, right, and left, and under the condition that three of the above-mentioned four conditions are met, the translation modes of the data packet can be determined by the process of elimination. The selection of conditions one to four and the order of execution in Fig.6 are merely examples.
[0124] Condition 5: the coordinate of the moved data packet X= 0.
[0125] In S611, if condition 5 is met, the flow goes to S612, and the coordinates of the data packet are changed to x=n+1 and y=n+1, and then the flow proceeds from S612 to S613. If condition 5 is not met, the flow goes directly to S613.
[0126] As in Fig. As shown in Figure 5A, the data packet with the original serial number P_original=13 satisfies condition 1 and is located in the dashed area 1 in the matrix, and the type of translation of the data packet with the original serial number P_original=13 is left translation. The new serial number of the data packet with the original serial number P_original=13 that undergoes translation is P_new-X+(Y-1)(2n+1)=12, as shown in Fig.5C. The data packet with the original serial number P_original=21 satisfies condition 1 and is located in the dashed area 1 in the matrix, and the translation method of the data packet with the original serial number P_original=21 is left translation. The coordinate of the data packet with the original serial number P_original=21 undergoing translation is (0, 5), which satisfies condition 5. The coordinates of the data packet with the original serial number P_original = 21 are changed to (3, 3), so the new serial number of the data packet with the original serial number P_original = 21 undergoing translation is P_new = X + (Y-1) (2n+1) = 13, as shown in Fig. 5C shown.
[0127] The flow continues to S601, currently K=0, and the flow ends.
[0128] By repeating the process of Fig.6 For each data packet in the matrix, the type of translation of all data packets in the matrix can be obtained.
[0129] The above mentioned how the server performs a translation of data packets in the matrix when the number of translations is 1. A person skilled in the art can understand the process of multiple translations based on the Fig. 5A - Fig. 5C and Fig. 6 understand.
[0130] After the server translates all data packets in the matrix k times, P_new in the matrix undergoing translation is assumed to be the number S of data packets in the matrix and transmitted to the target terminal. During the transmission process, the order of the partial upgrade packets is disrupted and mixed with interference packets, which significantly increases the difficulty of cracking.
[0131] The destination terminal can determine how (e.g., the direction of forwarding, clockwise and counterclockwise) and how often the received data packets are translated by the server based on the sequence identifier in the identification code read from the flash. Based on the number of partial upgrade packets contained in the info packet, the destination terminal can obtain the total number of data packets (including, for example, partial upgrade packets and interference packets) in the matrix generated by the server transmitted to the destination terminal and the dimensions of the matrix generated by the destination terminal. Alternatively or additionally, the info packet can contain the total amount of data packets (e.g., including partial upgrade packets and interference packets) contained in the matrix generated by the server, and the destination terminal can generate the dimension of the matrix (i.e., the square root of the total amount) based on the total number.The target terminal determines the dimensions of the generated matrix based on the set of partial upgrade packages, which is similar to the one defined in terms of the . Fig. 5A-5C, and the description is not repeated here.
[0132] In one embodiment, the destination terminal may restore the order of the partial upgrade packets based on the reverse process of the server translation process of the data packets in the matrix.
[0133] Fig. 5D is a schematic diagram of an inverse process of a data packet translation process according to an embodiment of the disclosure.
[0134] Fig. 7 is a flowchart of an inverse process of a translation process of a data packet according to an embodiment of the disclosure.
[0135] With reference to the Fig. 5A - Fig. 5D and Fig.Figure 7 describes the reverse process of the translation process for each data packet in the matrix. The following procedure is performed for each data packet in the matrix.
[0136] In S701, it is determined whether the number K of translations is 0. The number of translations K = 1, and the flow goes to S702.
[0137] In S702, the layer number on which the partial upgrade package with the original serial number P_new is located in the matrix can be determined according to the new serial number P_new. The method for calculating the layer number is the same as in step S602 of Fig. 6, and the description is not repeated here. The new serial number P_new=12 of the one in the middle of Fig.The data packet located in Figure 7A is taken as an example. The new serial number P_new=12 determines the coordinate (X, Y)=(2, 3) of the partial upgrade packet in the matrix. The layer number at which the data packet with P_new=12 is located in the matrix is Layer=1. Furthermore, the value of K is subtracted by 1, and the value of K after subtracting 1 is 0.
[0138] When translating to the left, depending on the layer number on which the data packet is located in the matrix and the coordinates of the data packet in the matrix, it can be determined how the data packet is moved within the matrix, under the following conditions:
[0139] Preprocessing condition: the coordinates of the data packet X = n+1 and Y = n+1.
[0140] In S703, if the preprocessing condition is met, the flow proceeds to S704, where the coordinates of the data packet are changed to X=0, Y=2n+1, and the flow proceeds to S705. If the preprocessing condition is not met, the flow proceeds directly to S705.
[0141] Condition 1: the coordinate of the data packet Y = layer+n+1, and X < n+1+ layer; or X = n+1-layer and Y = n+1 + layer-1.
[0142] In S705, if condition 1 is met, the flow proceeds to S706 and the coordinates of the data packet are changed as follows: the value of X is increased by 1 and the value of Y remains unchanged. If condition 1 is not met, the flow proceeds to S707.
[0143] In Fig. 5D, a data packet satisfying condition 1 corresponds to a data packet that undergoes a right translation, ie, a data packet that is contained in the deleted regions 1.
[0144] Condition 2: the coordinate of the data packet X = n+1 + layer and Y < n+1 - layer.
[0145] In S707, if condition 2 is met, the flow goes to S708 and the coordinates of the data packet are changed as follows: the value of X is unchanged and the value of Y is reduced by 1. If condition 2 is not met, the flow goes to S709.
[0146] In Fig. 5D, a data packet satisfying condition 2 corresponds to a data packet that undergoes an upper translation, ie, a data packet that is contained in the deleted areas 4.
[0147] Condition 3: the coordinate of the data packet Y=n+1 layer and n+1 layer < X <n+1 + Layer.
[0148] In S709, if condition 3 is met, the flow proceeds to S710 and the coordinates of the data packet are changed as follows: the value of X is reduced by 1 and the value of Y remains unchanged. If condition 3 is not met, the flow proceeds to S711.
[0149] In Fig. 5D, a data packet satisfying condition 3 corresponds to a data packet that undergoes a left translation, ie, a data packet that is contained in the dashed areas 3.
[0150] Condition 4: the coordinate of the data packet is X = n+1 layer, Y > n+1 layer 1.
[0151] If condition 4 is satisfied in S711, the flow advances to S712, and the coordinates of the data packet are changed as follows: the value of X remains unchanged and the value of Y is increased by 1.
[0152] In Fig.5D, a data packet satisfying condition 4 corresponds to a data packet that undergoes a lower translation, ie, a data packet that is contained in the deleted areas 1.
[0153] It should be clear to those skilled in the art that since in this embodiment, in addition to moving out of the matrix, there are four translational modes of the data packet within the matrix, namely up, down, left, right and left, and under the condition that three of the above four conditions are obtained, the translational modes of the data packet can be determined by the method of elimination. Fig. Figure 7 shows only three of the four conditions, with the exception of the preprocessing condition for brevity. The selection of conditions one to three and the order of execution in Fig. 7 are merely examples.
[0154] As in Fig.As shown in Figure 5D, the data packet with the new serial number P_new=12 satisfies condition 1, and the data packet with the new serial number P_new=12 is moved to the right, and the coordinates change to (3, 3). The process proceeds to S713, P=13.
[0155] The flow continues to S701, currently K=0, and the flow ends.
[0156] The matrix can be Fig. 5C to Fig. 5A can be restored by following the above process of Fig. 7 is repeated for each data packet in the matrix. In Fig. 5A, the serial number of the partial upgrade package in the matrix is the same as the original order of the partial upgrade package. According to the serial number of the partial upgrade package in the restored matrix and the number of partial upgrade packages, the partial upgrade packages whose order is restored can be obtained.
[0157] The above description shows how the destination terminal moves the data packets within the matrix when the number of translations is 1. A person skilled in the art can understand the process of restoring the translation multiple times based on the Fig. 5D and Fig. 7 understand.
[0158] In one embodiment, the destination terminal may restore the order of the partial upgrade packets by continuing the server's process of translating the data packets in the matrix.
[0159] The server's process for translating the data packets in the matrix is described above with reference to the Fig. 5A- Fig. 5C and Fig. 6, and the description is not repeated here.
[0160] Fig.8 is a flowchart for determining the number of translations performed by the server that must continue to be performed to restore the order of the partial upgrade package, according to one embodiment of the disclosure.
[0161] It is assumed that the data packet with the original serial number of P_original as in Fig. 6 and the new serial number is P_new. The sequence of Fig. 8 can be used to calculate how many times the translation performed by the server must be continued so that the order of the partial upgrade packages can be restored.
[0162] At step S801, it is determined whether P_original is equal to P_new. If not, the process continues to step S802.
[0163] In S802, the layer number on which the partial upgrade package with the original serial number P_original is located in the matrix can be determined according to the original serial number P_original. The determination method is similar to that described above with reference to Fig. 6, and the description will not be repeated. At the same time, 1 is added to the R value, and the added R value is equal to 1.
[0164] S802-S813 is similar to S602-S613 in Fig. 6, and the description is not repeated.
[0165] The flow continues to S801, and the flow continues until P_new = P_original, and the flow ends. At the end, R indicates how many times the translation performed by the server must be repeated to restore the order of the partial upgrade package.
[0166] Fig. 9A - Fig.9D are schematic diagrams of the manner in which a server performs translation of data packets within an odd-dimensional matrix according to various shift directions, according to an embodiment of the disclosure.
[0167] In one embodiment, the layer number Layer on which the data packet is located in the matrix may be determined according to the serial number P of each data packet. With reference to layers 1 and 2 of Fig. 5A, the data packets in each layer of the matrix are processed as in Fig. 9A when the extension direction is left and clockwise.
[0168] In area 1, the data packet moves to the left, and the coordinates of the data packet are changed to: the value of X is reduced by 1, and the value of Y remains unchanged.
[0169] In area, the data packet moves up, and the coordinates of the data packet are changed to: the value of X is unchanged, and the value of Y is reduced by 1.
[0170] In area 3, the data packet moves to the right and the coordinates of the data packet are changed to: the value of X is increased by 1 and the value of Y remains unchanged.
[0171] In area 4, the type of movement of the data packet is downward, and the coordinates of the data packet are changed to: the value of X remains unchanged, and the value of Y is increased by 1.
[0172] Based on the division of areas with different movement directions in the layer of Fig. 9A, conditions 1-5 for determining the direction of movement of data packets can be obtained by referring to Fig. 6 are described.
[0173] With reference to Fig.Figure 9B describes the movement of data packets in each layer in the matrix when the shift direction is right and clockwise.
[0174] In Area 1-Area 4, the type of movement of data packets is the same as that described with reference to Fig. 9A, and the description is not repeated here. Based on the division of areas with different movement directions in the layer of Fig. 9B, the condition that the server determines the movement direction of data packets in the matrix can be obtained when the push-out direction is right and the rotation is clockwise, and the specific conditions are not briefly described.
[0175] With reference to Fig. Figure 9C describes the movement of data packets in each layer in the matrix when the shift direction is upward and clockwise.
[0176] In Area 1-Area 4, the type of movement of data packets is the same as that described with reference to Fig. 9A, and the description is not repeated here. Based on the division of areas with different movement directions in the layer of Fig. 9C, the condition that the server determines the movement direction of data packets in the matrix can be obtained when the push-out direction is upward and the rotation is clockwise, and the specific conditions are not briefly described.
[0177] With reference to Fig. 9D describes the nature of the movement of data packets in each layer in the matrix when the direction of movement is downward and clockwise.
[0178] In Area 1-Area 4, the type of movement of data packets is the same as that described with reference to Fig.9A, and the description is not repeated here. Based on the division of areas with different movement directions in the layer of Fig. 9D, the condition that the server determines the movement direction of data packets in the matrix can be obtained when the push-out direction is downward and the rotation is clockwise, and the specific conditions are not briefly described.
[0179] Fig. 10 is a schematic diagram of a server that changes the order of partial upgrade packages based on an order identifier indicating that the push-out direction is left and counterclockwise, according to one embodiment of the disclosure.
[0180] In Fig. 10, the process of determining the layer in which the data packet is located is the same as in Fig.5A. The description is not repeated. The process in which the server changes the order of the partial upgrade packages based on the order identifier, which indicates that the push-out direction is left and counterclockwise, similar to the process in Fig. 6, in which the server changes the order of the partial upgrade packets based on the order identifier, which indicates that the push-out direction is left and clockwise. By adjusting Condition 1-Condition 5, the type of translation of data packets in the matrix can be obtained.
[0181] When a data packet is moved in an odd matrix, the data packet moved out of the matrix is always placed back in the middle (n+1, n+1) of the odd matrix.
[0182] With reference to the Fig. 9A- Fig.10, the server can perform a translation of data packets within the matrix according to the sequence identifier in the identification code, using shift directions such as left, right, up, and down, and clockwise or counterclockwise rotations to change the order of the partial upgrade packets. Accordingly, the destination terminal can restore the order of the partial upgrade packets through the reverse process of the server's process of performing a translation of data packets within the matrix according to the sequence identifier in the identification code.
[0183] Fig. 11 is a schematic diagram of a server changing the order of partial upgrade packages within an even-dimensional matrix in a clockwise and left-shift direction, according to one embodiment of the disclosure.
[0184] Assuming that there are N = 14 partial upgrade packages, according to equation (1), T = 4, and the remainder of T above 2 is 0, it can be determined that a matrix with even dimensions is generated. When generating a matrix with even dimensions, the matrix is determined by the following equation: n=roundup(n4)
[0185] According to equation (5), n = 2, then the dimension of the even matrix is 2n = 4. That is, in the case of N=14 partial upgrade packages, a four-dimensional matrix as in Fig. 11. As shown in Fig. As shown in Figure 11, the 14 partial upgrade packages with initial numbers S from 1 to 14 are arranged in the partial upgrade packages matrix from left to right in automatically permuted rows. Each position in the matrix from left to right and from top to bottom has the original serial number P_original. As shown in Fig.As shown in Figure 11, the 14 partial upgrade packets cannot exactly fill the 4-dimensional matrix, and the matrix may be filled with interference packets (garbled packets, empty packets, or one or more of the reused 14 partial upgrade packets) until the matrix is filled.
[0186] It is assumed that the sequence identifier contains data with a preset number of bits indicating that the number K of translation is 1, the shift direction is left, and the rotation direction is clockwise. As in Fig. As shown in Figure 11, the data packet with coordinates (1, 4) is moved to the left out of the matrix, and the data packet rotates clockwise in the matrix. After the data packet with coordinates (1, 4) has been shifted out of the matrix to the left, the data packet shifted out of the matrix is moved to the position (n, n), which is in the middle of Fig. 11 becomes free.
[0187] Fig. 12 is a flowchart for determining a type of translation of data packets within an even dimensional matrix according to an embodiment of the disclosure.
[0188] With reference to Fig. 11 and Fig. 12 describes the process of determining the type of translation of the data packet within the matrix.
[0189] At S1201, it is determined whether the number K of translations is 0. If the number K of translations is 1, the process proceeds to S1202.
[0190] At S1202, the layer number on which the partial upgrade package with the original serial number P_original is located in the matrix can be determined according to the original serial number P_original. The original serial number P_original=13 of the data package in Fig. 11 is taken as an example. P_original / (2n)=(Y−1)……X
[0191] Where (Y-1) is the quotient and X is the remainder. Equation (3) shows that the coordinates (X, Y) = (2,2) of the partial upgrade package in the matrix are determined according to the original serial number P_original = 6 of the partial upgrade package. Layer=|max(X−n−0.5, Y−n−0.5)|+0.5
[0192] Where max (,) means taking the maximum value. According to equation (6), it can be calculated that the layer number of the data packet with the original serial number P_original=6 in the matrix Layer = 0. At the same time, the value of K is reduced by 1, and the value of K after the reduction by 1 is equal to 0.
[0193] When translating to the left, depending on the layer number on which the data packet is located in the matrix and the coordinates of the data packet in the matrix, it can be determined how the data packet is moved within the matrix, under the following conditions:
[0194] Condition 1: the coordinate of the data packet Y=n + layer.
[0195] In S1203, if condition 1 is met, the flow proceeds to S1204, and the coordinates of the data packet are changed as follows: the value of X is reduced by 1, and the value of Y remains unchanged. If condition 1 is not met, the flow proceeds to S1205.
[0196] In Fig. 11, a data packet satisfying condition 1 corresponds to a data packet that undergoes a left translation, ie, a data packet that is contained in the deleted areas 1.
[0197] Condition 2: the coordinate of the data packet X = n-layer and Y < n-layer.
[0198] In S1205, if condition 2 is met, the flow proceeds to S1206, and the coordinates of the data packet are changed as follows: the value of X remains unchanged and the value of Y is reduced by 1. If condition 2 is not met, the flow proceeds to S1207.
[0199] In Fig. 11, a data packet satisfying condition 2 corresponds to a data packet that undergoes an upper translation, ie, a data packet that is contained in the deleted areas 2.
[0200] Condition 3: the coordinate of the data packet Y=n+1 layer and X <n+Layer.
[0201] In S1207, if condition 3 is met, the flow proceeds to S1208, and the coordinates of the data packet are changed as follows: the value of X is increased by 1, and the value of Y remains unchanged. If condition 3 is not met, the flow proceeds to S1209.
[0202] In Fig. 5A, a data packet satisfying condition 3 corresponds to a data packet that undergoes a right translation, ie, a data packet that is contained in the dashed areas 3.
[0203] Condition 4: the coordinates of the data packet X = n + layer and Y < n + layer.
[0204] In S1209, if condition 4 is satisfied, the flow proceeds to S1210, and the coordinates of the data packet are changed as follows: the value of X remains unchanged and the value of Y is increased by 1.
[0205] In Fig. 11, a data packet satisfying condition 4 corresponds to a data packet that undergoes a lower translation, ie, a data packet that is contained in the deleted areas 4.
[0206] It should be clear to those skilled in the art that since in this embodiment, in addition to the movement into the matrix, there are four translation modes of the data packet within the matrix, namely up, down, left, right, and left, and under the condition that three of the above-mentioned four conditions are met, the translation modes of the data packet can be determined by the process of elimination. The selection of conditions one to four and the order of execution in Fig.12 are merely examples.
[0207] Condition 5: the coordinate of the moved data packet X = 0.
[0208] In S1211, if condition 5 is met, the flow proceeds to S1212, and the coordinates of the data packet are changed as follows: X=n, Y=n, and then the flow proceeds from S1212 to S1213. If condition 5 is not met, the flow proceeds directly to S1213.
[0209] As in Fig. As shown in Figure 11, the data packet with the original serial number P_original=6 satisfies condition 3 and is located in the dashed area 3 in the matrix, and the type of translation of the data packet with the original serial number P_original=6 is the right translation. The new serial number of the data packet with the original serial number P_original=6 that undergoes translation is P_new=X+2n(Y-1)=7, as shown in Fig.5C. The data packet with the original serial number P_original=13 satisfies Condition 1 and is located in the primed region 1 in the matrix. The translation method of the data packet with the original serial number P_original=13 is left translation. The coordinate of the data packet with the original serial number P_original=13 undergoing translation is (0, 4), which satisfies Condition 5. The coordinate of the data packet with the original serial number P_original=13 is changed to (2, 2), so the new serial number of the data packet with the original serial number P_original=13 undergoing translation is P_new=X+2n(Y-1)=6.
[0210] The flow continues to S1201, currently K=0, and the flow ends.
[0211] By repeating the process of Fig. 12 For each data packet in the matrix, the type of translation of all data packets in the matrix can be obtained.
[0212] The above description shows how the server performs a translation of data packets within the matrix when the number of translations is 1. A person skilled in the art can understand the process of multiple translations based on the Fig. 11 and Fig. 12 understand.
[0213] After the server translates all data packets in the matrix k times, P_new in the matrix undergoing translation is assumed to be the number of data packets in the matrix and transmitted to the target terminal. During the transmission process, the order of the partial upgrade packets is disrupted and mixed with interference packets, which significantly increases the difficulty of cracking.
[0214] Fig. 13A - Fig.13D are schematic diagrams of the manner in which a server performs translation of data packets within an even-dimensional matrix according to various shift directions, according to an embodiment of the disclosure.
[0215] In one embodiment, the layer number Layer on which the data packet is located may be determined according to the serial number P of each data packet. With reference to layers 1 and 2 of Fig. 11, the data packets in each layer of the matrix are as in Fig. 13A when the extension direction is left and clockwise.
[0216] In area 1, the data packet moves to the left, and the coordinates of the data packet are changed to: the value of X is reduced by 1, and the value of Y remains unchanged.
[0217] In area 2, the data packet moves up and the coordinates of the data packet are changed to: X = the value of X remains unchanged and the value of Y is reduced by 1.
[0218] In area 3, the data packet moves to the right and the coordinates of the data packet are changed to: the value of X is increased by 1 and the value of Y remains unchanged.
[0219] In area 4, the data packet moves down and the coordinates of the data packet are changed to: the value of X remains unchanged and the value of Y is increased by 1.
[0220] Based on the division of areas with different movement directions in the layer of Fig. 13A, conditions 1-5 for determining the direction of movement of data packets can be obtained by referring to Fig. 12 are described.
[0221] In Fig.13A the data packet shifted out of the matrix is reset to the coordinate (n, n).
[0222] With reference to Fig. Figure 13B describes the movement of data packets in each layer in the matrix when the shift direction is right and clockwise.
[0223] In Area 1-Area 4, the mode of movement of the data packet is the same as that described with reference to Fig. 13A, and the description is not repeated here. Based on the division of areas with different movement directions in the layer of Fig. 13B, the condition that the server determines the movement direction of data packets in the matrix can be obtained when the push-out direction is to the right and the rotation is clockwise, and the specific conditions are not briefly described.
[0224] In Fig.13B the data packets shifted out of the matrix are returned to coordinates (n+1, n+1).
[0225] With reference to Fig. Figure 13C describes the nature of the movement of data packets in each layer in the matrix when the direction of movement is upward and the rotation is clockwise.
[0226] In Area 1-Area 4, the mode of movement of the data packet is the same as that described with reference to Fig. 13A, and the description is not repeated here. Based on the division of areas with different movement directions in the layer of Fig. 13C, the condition that the server determines the movement direction of data packets in the matrix can be obtained when the push-out direction is upward and the rotation is clockwise, and the specific conditions are not briefly described.
[0227] In Fig.13C the data packet shifted out of the matrix is reset to the coordinate (n+1, n).
[0228] With reference to Fig. Figure 13D describes the movement of data packets in each layer in the matrix when the shift direction is downward and the rotation is clockwise.
[0229] In Area 1-Area 4, the mode of movement of the data packet is the same as that described with reference to Fig. 13A, and the description is not repeated here. Based on the division of areas with different movement directions in the layer of Fig. 13D, the condition that the server determines the movement direction of data packets in the matrix can be obtained when the push-out direction is downward and the rotation is clockwise, and the specific conditions are not briefly described.
[0230] In Fig.13D the data packet shifted out of the matrix is reset to the coordinate (n, n+1).
[0231] Furthermore, the order of the partial upgrade packages can be changed by performing a translation of the matrix within an even-dimensional matrix to achieve counterclockwise rotation. The detailed process is not described for brevity.
[0232] In one embodiment, the target terminal may restore the order of the partial upgrade packets based on the reverse process of the server's translation process of the data packets in the matrix. In one embodiment, the target terminal may restore the order of the partial upgrade packets by having the server continue the translation process into the data packets in the matrix.
[0233] The embodiment in which the order of the partial upgrade packets is changed in a rotational manner by translating the data packets within the matrix has been described above. In addition to the above-described change / restoration of the order of the partial upgrade packets by translating the data packets in the odd- or even-dimensional matrix with a left, right, up, and down movement direction, a clockwise and counterclockwise rotation, and a different number of translations, those skilled in the art who benefit from this disclosure can also shift the data packets within the matrix to change / restoration the order of the partial upgrade packets without rotation or other translation methods. These are all within the contemplation of this disclosure.
[0234] Fig. 14 is a firmware upgrade device for a server according to an embodiment of the disclosure.
[0235] As in Fig.As shown in Figure 14, 1400 is a firmware upgrade device for a server.
[0236] The firmware upgrade device 1400 may include a firmware upgrade package obtaining device 1410 for obtaining a target firmware upgrade package.
[0237] The firmware upgrade device 1400 may include a receiving device 1420 for receiving an identification code of a target terminal.
[0238] The firmware upgrade device 1400 may include a splitting device 1430 for splitting the target firmware upgrade package into partial upgrade packages based on the identification code of the target terminal.
[0239] The firmware upgrade device 1400 may include a storage / transmission device 1440 for storing the partial upgrade packages and / or for transmitting the partial upgrade packages to the target terminal device.
[0240] Fig.15 is a firmware upgrade device for a terminal according to an embodiment of the disclosure.
[0241] As in Fig. 15, 1500 is a firmware upgrade device for a target terminal.
[0242] The firmware upgrade device 1500 may include a firmware upgrade instruction receiving device 1510 for receiving firmware upgrade instructions.
[0243] The firmware upgrade device 1500 may include a transmission device 1520 for transmitting the identification code of the destination terminal.
[0244] The firmware upgrade device 1500 may include a download / receive device 1530 for downloading / receiving the partial upgrade packages.
[0245] The firmware upgrade device 1500 may include a splicer 1540 for splicing the partial upgrade packages into a target firmware upgrade package based on the identification code of the target terminal.
[0246] Fig. 16 is a flowchart for securely booting a target terminal according to an embodiment of the disclosure.
[0247] After the soft reboot of the device, the device executes the security boot program.
[0248] At step S1601, it is determined whether the firmware upgrade information is "upgraded." If so, the process proceeds to step S1602 to start the target firmware.
[0249] If not, the flow proceeds to S1603, and the information in the tmp partition preset by the terminal device is obtained and analyzed to determine whether to change the order of the partial upgrade packages. In S1603-S1605, the process of determining whether to change the order of the partial upgrade packages and how to change the order of the partial upgrade packages is similar to the description in the corresponding section above, and the description will not be repeated.
[0250] At S1606, it is determined whether the target firmware security check has passed. The security check may be performed on this target firmware according to the firmware upgrade key and / or the integrity check information included in the firmware upgrade instruction. In some implementations, the integrity check information is, for example, an md5 value or other integrity check information, and this embodiment is not limited thereto. The info packet transmitted to the target terminal may also include the firmware upgrade key and / or the integrity check information.The security check of the target firmware is performed based on the firmware upgrade key and / or integrity check information. The security check is passed if the firmware upgrade key carried in the info packet and transmitted to the terminal device matches the firmware upgrade key in the firmware upgrade instruction, and / or if the terminal device's integrity check information matches the integrity check information in the firmware upgrade instruction. If the security check fails, the process ends. If the security check passes, the flow proceeds to step S1607.
[0251] In S1607, the firmware upgrade package can be executed. In one embodiment, the firmware upgrade package can be copied to the current address and jumped to the current address, i.e., the upgraded target firmware can be executed. In one embodiment, the firmware upgrade package can be executed directly from the corresponding partition in the flash.
[0252] In S1607, the boot information of the target firmware can be changed to “Upgraded”.
[0253] Through the above-mentioned secure boot process, based on the division of the firmware upgrade packages and the subsequent transfer and download of the partial upgrade packages with a change in order, the security of the firmware upgrade can be further improved, the configuration process of firmware integrity verification and secure boot can be realized, and the legitimacy of the firmware can be ensured.
[0254] Fig. 17 is a flowchart for security verification with a combination of off-network and on-network for the target terminal according to an embodiment of the disclosure.
[0255] At S1701, the target terminal may obtain the firmware upgrade instruction and the security verification key in a manner separate from the WAN (Wide Area Network). The target terminal may obtain the firmware upgrade instruction and the security verification key from a broadcast device separate from the WAN in the form of broadcast or point-to-point communication. The broadcast device separate from the WAN may be, for example, a handler broadcast device. In one embodiment, the target terminal may obtain a download base address from a broadcast device separate from the WAN. The target terminal may obtain the download address of the firmware upgrade package based on the modifiable default address, the download base address, and the identification code.The broadcast device, separated from the wide area network, can be implemented using short-range wireless communication such as Bluetooth, Bluetooth LE, ZigBee, radio frequency identification (RFID), UWB, 60GHz, Wi-Fi, WiMAX, or wired communication such as USB. Because the broadcast device is separated from the wide area network, security risks associated with transmission through the wide area network can be effectively avoided without using the wide area network.
[0256] In S1702, the target terminal can obtain the firmware upgrade package and the security key of the firmware upgrade package through a WAN.
[0257] In S 1703, the target terminal can determine whether the security verification key matches the security key of the firmware upgrade package. For example, the target terminal can determine whether the security verification key obtained by disconnecting the WAN matches the security key of the firmware upgrade package obtained via the WAN. If they match, the firmware upgrade package can be confirmed to be secure; otherwise, risk information is reported.
[0258] The process for obtaining the firmware upgrade package by the target terminal device may be similar to the above-mentioned process of upgrading the firmware of the terminal device based on the identification code and the secure boot process for the target terminal device, and the description is not repeated here.
[0259] The text and accompanying drawings are provided only as examples to facilitate understanding of the present disclosure. They should not be construed as limiting the scope of the disclosure. Although specific embodiments and examples have been presented based on the disclosure, it will be apparent to those skilled in the art that changes may be made to the illustrated embodiments and examples without departing from the scope of this disclosure.
[0260] Although the disclosure has been described with exemplary embodiments, various changes and modifications may occur to those skilled in the art. This disclosure is intended to cover changes and modifications that fall within the scope of the appended claims.
[0261] Nothing in the description of the present invention should be understood to imply that any particular element, step, or function is an essential element that must be included within the scope of the claims. The scope of the patent subject matter is limited only by the claims. QUOTES CONTAINED IN THE DESCRIPTION
[0000] This list of documents submitted by the applicant was generated automatically and is included solely for the convenience of the reader. This list is not part of the German patent or utility model application. The DPMA assumes no liability for any errors or omissions. Cited patent literature
[0000] CN 202211295975.2
[0001]
Claims
[1] Firmware upgrade procedure applied on a server side, characterized by that the procedure includes: Obtaining a target firmware upgrade package; Receiving an identification code of a destination terminal; Splitting the target firmware upgrade package into partial upgrade packages based on the identification code of the target terminal; Saving the partial upgrade packages and / or transferring the partial upgrade packages to the target terminal. [2] Firmware upgrade method according to claim 1, characterized by that the procedure further comprises: Obtaining a size of the partial upgrade packages by the identification code of the destination terminal, Determine a number of split partial upgrade packages based on the size of the partial upgrade packages. [3] Firmware upgrade method according to claim 1, characterized by that the procedure further comprises: Determining a download address for the target terminal device to download the partial upgrade packages based on the identification code and a modifiable default address of the partial upgrade packages. [4] Firmware upgrade method according to claim 1, characterized by that the procedure further comprises: Obtaining a sequence identifier of the partial upgrade package through the identification code of the destination terminal, Determine whether to change the order of the partial upgrade package based on the order identifier of the partial upgrade package, Numbering the partial upgrade package according to an original order of the partial upgrade package, in response to a determination not to change the order of the partial upgrade package, Changing the order of the partial upgrade package, and numbering the partial upgrade package according to the changed order of the partial upgrade package, in response to a determining to change the order of the partial upgrade package. [5] Firmware upgrade method according to claim 4, characterized by that each of the partial upgrade packages includes a partial upgrade package header and the partial upgrade package header includes a partial upgrade package number. [6] Firmware upgrade method according to claim 5, characterized by that the partial upgrade packet header further comprises at least one of the identification code of the target terminal and a number of partial upgrade packets divided by the target firmware upgrade packet. [7] Firmware upgrade method according to claim 4, characterized by that determining whether to change an order of the partial upgrade package based on the order identifier of the partial upgrade package comprises: Identifying a numeric value specified by the sequence identifier, Determining whether to change the order of the partial upgrade package based on the numeric value specified by the sequence identifier. [8] Firmware upgrade method according to claim 7, characterized by that determining whether to change the order of the partial upgrade package based on the numeric value specified by the order identifier includes: Determine whether to change the order of the partial upgrade package based on whether the numeric value specified by the order identifier is a first predetermined value. [9] Firmware upgrade method according to claim 7, characterized by that determining whether to change the order of the partial upgrade package based on the numeric value specified by the order identifier includes: Forming a remainder of the numerical value specified by the sequence identifier over a second predetermined numerical value to obtain a remainder, wherein the second predetermined numerical value is a natural number greater than or equal to 2, Determine whether to change the order of the partial upgrade package based on the rest. [10] Firmware upgrade method according to claim 9, characterized by that the second predetermined value is 2, wherein determining whether to change the order of the partial upgrade package based on the numerical value specified by the order identifier comprises: Determine whether to change the order of the partial upgrade package based on a parity of the numeric values specified by the order identifier. [11] Firmware upgrade method according to claim 4, characterized bythat changing the order of the partial upgrade package based on the order identifier includes: Identifying the numeric value specified by the sequence identifier, Change the order of the partial upgrade package based on the numeric value specified by the order identifier. [12] Firmware upgrade method according to claim 11, characterized by that the sequence identifier comprises data having a predetermined number of bits and identifying the numerical value specified by the sequence identifier, identifying the numerical value specified by the data, wherein changing the sequence of the partial upgrade package comprises: Dividing the partial upgrade packets into partial upgrade packet groups, each partial upgrade packet group comprises a certain number of partial upgrade packets that are adjacent to each other in the original order, where the certain number is the maximum numerical value that the data can display with a predetermined number of bits plus 1, Exchange the order of two partial upgrade packages whose original order differs by the numerical value specified by the data, in each partial upgrade package group. [13] Firmware upgrade method according to claim 4, characterized by that changing the order of the partial upgrade package includes: Dividing the partial upgrade packages into partial upgrade package groups, each partial upgrade package group comprises a specific number of partial upgrade packages that are arranged next to each other in the original order, with the specific number being determined in advance on the server, Exchange the order of two partial upgrade packages whose original order differs by a value less than a specified number in each partial upgrade package group. [14] Firmware upgrade method according to claim 4, characterized by that the procedure further comprises: Creating a matrix according to the number of partial upgrade packages, Arranging the partial upgrade packages in the matrix, wherein changing the order of the partial upgrade packages comprises performing a translation of the partial upgrade packages in the matrix according to the order identifier. [15] Firmware upgrade method according to claim 14, characterized by that involves creating a matrix according to the number of partial upgrade packages: Determine whether to create an odd-dimensional matrix or an even-dimensional matrix, according to the number of partial upgrade packages. [16] Firmware upgrade method according to claim 15, characterized by that the procedure further comprises: Filling the matrix with one or more of garbled packages, empty packages, and repeated partial upgrade packages. [17] Firmware upgrade method according to claim 14, characterized by that the sequence identifier specifies one or more of the number of translations of the partial upgrade packages in the matrix, the direction of ejection of the partial upgrade packages, and the clockwise and counterclockwise rotation of the partial upgrade packages in the matrix. [18] Firmware upgrade method according to claim 17, characterized by that the procedure further comprises: Determining a type of translation of the partial upgrade packages according to a serial number of the partial upgrade packages in the matrix and the dimension of the matrix. [19] Firmware upgrade method according to claim 1, characterized by that the procedure further comprises: Saving the header of the target firmware upgrade package and / or transmitting the header of the target firmware upgrade package to the target terminal, wherein the header of the target firmware upgrade package comprises one or more of the identification code of the target terminal, the quantity and number of the partial upgrade packages, a firmware upgrade key and / or integrity check information. [20] Firmware upgrade procedure applied to a terminal device, characterized by that the procedure includes: Receive a firmware upgrade instruction; Transmitting an identification code of a destination terminal; Downloading partial upgrade packages from a server; Splicing the partial upgrade packages into a target firmware upgrade package based on an identification code of the target terminal. [21] Firmware upgrade method according to claim 20, characterized bythat the method further comprises downloading a header of the firmware upgrade package from the server and performing the following steps by a security boot program: Determining whether to change the order of the downloaded partial upgrade packages based on the sequence identifier in the terminal device's identification code in response to downloading all partial upgrade packages and the firmware upgrade package header to the terminal device; Performing a security or integrity check on the downloaded partial upgrade packages; Executing the target firmware spliced by the partial upgrade packages in response to the downloaded partial upgrade packages passing the security or integrity check. [22] Firmware upgrade method according to claim 21, characterized bythat receiving a firmware upgrade instruction comprises receiving the firmware upgrade instruction and the security verification key in a manner separate from the wide area network; wherein downloading partial upgrade packages from the server comprises receiving the firmware upgrade package and a security key of the firmware upgrade package via a wide area network; performing the security check on the downloaded partial upgrade packages and determining whether the security check key matches the security key of the firmware upgrade package. [23] Firmware upgrade device applied to a server, characterized by that the device includes: Get Firmware Upgrade Package Setup to get a target firmware upgrade package; Receiving device for receiving an identification code of a destination terminal; Dividing means for dividing the target firmware upgrade package into partial upgrade packages based on the identification code of the target terminal; Storage / transmission device for storing the partial upgrade packages and / or for transmitting the partial upgrade packages to the destination terminal. [24] Firmware upgrade device applied to a terminal device, characterized by that the device includes: Get Firmware Upgrade Instruction Setup to get firmware upgrade instruction; Receiving device for transmitting an identification code of a destination terminal; Download / receive device for downloading / receiving the partial upgrade packages from the server; Splicing device for splicing the partial upgrade packages into a target firmware upgrade package based on the identification code of the target terminal. [25] Servers, characterized bythat it comprises a memory and one or more processors, wherein a computer program is stored on the memory and when the computer program is executed by the one or more processors, the method according to any one of claims 1-19 is implemented. [26] Terminal, characterized by that it comprises a memory and one or more processors, wherein a computer program is stored on the memory and when the computer program is executed by the one or more processors, the method is implemented according to any one of claims 20-22. [27] Method for secure booting, for a terminal device, characterized by that the procedure includes: Determining whether to change the order of the downloaded partial upgrade packages based on the sequence identifier in the terminal device's identification code in response to downloading all partial upgrade packages and the firmware upgrade package header to the terminal device; Performing a security or integrity check on the downloaded partial upgrade packages; Executing the target firmware spliced by the partial upgrade packages in response to the downloaded partial upgrade packages passing the security or integrity check. [28] Security screening procedures for a target terminal, characterized by , the security clearance process includes: Obtaining a firmware upgrade instruction and a security validation key in a manner separate from the wide area network; Obtaining a firmware upgrade package and a firmware upgrade package security key via wide area network; Determine whether the security verification key matches the security key of the firmware upgrade package. [29] Security screening method according to claim 28, characterized by that receiving a firmware upgrade package via wide area network comprises downloading a partial upgrade package from the server via wide area network, the method further comprising: Transmitting the identification code of the destination terminal; Splicing the partial upgrade packages into a target firmware upgrade package based on the identification code of the target terminal. [30] Security screening method according to claim 29, characterized by that the method further comprises downloading a header of the firmware upgrade package from the server and performing the following steps by a security boot program: Determining whether to change the order of the downloaded partial upgrade packages based on the sequence identifier in the identification code of the target terminal in response to downloading all partial upgrade packages and the firmware upgrade package header to the target terminal; Performing a security or integrity check on the downloaded partial upgrade packages; Executing the target firmware spliced by the partial upgrade packages in response to the downloaded partial upgrade packages passing the security or integrity check.
Citation Information
Patent Citations
202211295975.2