Linux system program burning methods, devices, equipment, and media
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2026-08-14
AI Technical Summary
[0005]鉴于以上内容,有必要提供一种Linux系统的程序烧写方法、装置、设备及介质,旨在解决嵌入式Linux系统程序烧写效率低的问题
[0038]由以上技术方案可以看出,一方面,对待安装程序的每个镜像进行压缩打包,并将压缩打包后的目标安装程序及对应的配置表传输至嵌入式设备的RAM内存中的虚拟U盘,由于降低了数据传输量,因此有效缩短了数据传输的时间,并且,由于采用了虚拟U盘,进一步提高了数据向内存的传输效率;另一方面,根据配置表将目标安装程序烧写至嵌入式设备的FLASH,仅烧写有效数据,能够基于内存映射进一步压缩程序烧写的时间,进而提高了嵌入式Linux系统的程序烧写效率。
Smart Images

Figure CN117492778B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of program burning technology, and in particular to a method, apparatus, device and medium for burning programs to a Linux system. Background Technology
[0002] As embedded Linux rapidly develops in the emerging field of embedded operating systems, its applications are becoming increasingly widespread and its functions increasingly complex. Many products also have higher requirements for file systems. Along with the increasing demand for larger storage capacities, the time required for program burning is also increasing, consequently raising the production time and cost of the products.
[0003] Furthermore, in the existing technology, a lot of time is wasted on invalid data during the program burning process of embedded Linux operating system, that is, a lot of zero data erasure and writing of FLASH. This not only takes a long time, but repeated erasure and writing will also reduce the lifespan of FLASH.
[0004] Therefore, while meeting the requirements of large-capacity file systems, how to shorten the time for burning programs has become an urgent problem to be solved. Summary of the Invention
[0005] In view of the above, it is necessary to provide a method, apparatus, device and medium for burning programs to a Linux system, in order to solve the problem of low efficiency in burning programs to embedded Linux systems.
[0006] A method for flashing programs into a Linux system, the method comprising:
[0007] The server transmits pre-installed programs to Linux-based embedded devices;
[0008] The embedded device runs the received pre-installed program and starts the virtual USB drive in the RAM memory of the embedded device;
[0009] The server obtains the installation program to be installed and compresses and packages each image of the installation program to be installed, thereby obtaining the compressed target installation program and the configuration table corresponding to the target installation program;
[0010] The server transmits the target installation program and the configuration table to the virtual USB drive;
[0011] The embedded device burns the target installation program to the FLASH of the embedded device according to the configuration table.
[0012] According to a preferred embodiment of the present invention, the server transmitting a pre-installation program to a Linux-based embedded device includes:
[0013] The server transmits the pre-installation program to the SOC main control chip of the embedded device via a USB data cable.
[0014] According to a preferred embodiment of the present invention, the step of booting the virtual USB drive in the RAM memory of the embedded device includes:
[0015] The embedded device initiates the USB Mass Storage protocol and RAMFS transfer protocol of the virtual USB flash drive;
[0016] The USB Mass Storage protocol is used to enable the server to recognize the virtual USB flash drive; the RAMFS transfer protocol is used to support read and write operations on the RAM memory.
[0017] According to a preferred embodiment of the present invention, the step of compressing and packaging each image of the installer to obtain the compressed target installer and the configuration table corresponding to the target installer includes:
[0018] The server compresses and packages each image of the installer to be installed using the gzip command to obtain the target installer;
[0019] The server obtains the start address and end address of each image and records the start address and end address of each image in the configuration file to obtain the configuration table;
[0020] Specifically, empty data partitions in the installation program are not compressed or packaged.
[0021] According to a preferred embodiment of the present invention, the embedded device programming the target installation program to the FLASH of the embedded device according to the configuration table includes:
[0022] The embedded device determines the zero data and empty data partitions in the target installation program according to the configuration table;
[0023] During the process of burning the target installation program to the FLASH, the embedded device skips the zero data and performs formatting partitioning on the empty data partition.
[0024] According to a preferred embodiment of the present invention, the embedded device performs formatting partitioning processing on the empty data partition, including:
[0025] The embedded device only writes the corresponding partition information at the header of the empty data partition.
[0026] According to a preferred embodiment of the present invention, the method further includes:
[0027] Multi-threading is used to perform data transfer to the virtual USB drive and program writing to the FLASH memory.
[0028] A Linux system program burning device, the Linux system program burning device comprising:
[0029] A server used to transmit pre-installed programs to embedded devices;
[0030] The embedded device is used to run the received pre-installed program and start the virtual USB drive in the RAM memory of the embedded device;
[0031] The server is also used to obtain the installation program to be installed, and to compress and package each image of the installation program to be installed, so as to obtain the compressed target installation program and the configuration table corresponding to the target installation program;
[0032] The server is also used to transfer the target installation program and the configuration table to the virtual USB drive;
[0033] The embedded device is further configured to burn the target installation program to the FLASH of the embedded device according to the configuration table.
[0034] A computer device, the computer device comprising:
[0035] Memory, storing at least one instruction; and
[0036] The processor executes the instructions stored in the memory to implement the program burning method of the Linux system.
[0037] A computer-readable storage medium storing at least one instruction, which is executed by a processor in a computer device to implement a program burning method for the Linux system.
[0038] As can be seen from the above technical solutions, on the one hand, compressing and packaging each image of the installation program and transferring the compressed and packaged target installation program and the corresponding configuration table to the virtual USB drive in the RAM memory of the embedded device effectively shortens the data transmission time due to the reduction of data transmission volume. Furthermore, the use of a virtual USB drive further improves the data transmission efficiency to memory. On the other hand, burning the target installation program to the FLASH of the embedded device according to the configuration table and only burning valid data can further compress the program burning time based on memory mapping, thereby improving the program burning efficiency of the embedded Linux system. Attached Figure Description
[0039] Figure 1This is a flowchart of a preferred embodiment of the program burning method for the Linux system of the present invention.
[0040] Figure 2 This is a functional block diagram of a preferred embodiment of the program burning device for the Linux system of the present invention.
[0041] Figure 3 This is a schematic diagram of the structure of a computer device that implements a preferred embodiment of the method for burning programs into a Linux system according to the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0043] like Figure 1 The diagram shown is a flowchart of a preferred embodiment of the program flashing method for the Linux system of the present invention. Depending on different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.
[0044] The Linux system program burning method is applied to one or more computer devices. The computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0045] The computer device can be any electronic product that can interact with the user, such as a personal computer, tablet computer, smartphone, personal digital assistant (PDA), game console, interactive network television (IPTV), smart wearable device, etc.
[0046] The computer equipment may also include network equipment and / or user equipment. The network equipment includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.
[0047] The server can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0048] Artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0049] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0050] The network in which the computer device is located includes, but is not limited to, the Internet, wide area network, metropolitan area network, local area network, and virtual private network (VPN).
[0051] S10, the server transmits pre-installed programs to Linux-based embedded devices.
[0052] In this embodiment, the server may include a PC (Personal Computer) or the like.
[0053] In this embodiment, the pre-installation program can be generated by the server and is a binary executable program. The pre-installation program has a small footprint and is used to activate the FLASH programming function.
[0054] In this embodiment, the server transmitting a pre-installed program to a Linux-based embedded device includes:
[0055] The server transmits the pre-installed program to the SOC (System on Chip) main control chip of the embedded device via a USB (Universal Serial Bus) data cable.
[0056] The USB data cable has a relatively fast transmission speed.
[0057] S11, the embedded device runs the received pre-installed program and starts the virtual USB drive in the RAM (Random Access Memory) memory of the embedded device.
[0058] In this embodiment, the step of booting the virtual USB drive in the RAM memory of the embedded device includes:
[0059] The embedded device starts the USB MassStorage protocol and RAMFS (Random-Access Memory File System) transfer protocol of the virtual USB flash drive.
[0060] The USB Mass Storage protocol is used to enable the server to recognize the virtual USB flash drive; the RAMFS transfer protocol is used to support read and write operations on the RAM memory.
[0061] By activating the USB Mass Storage protocol, the server can recognize the virtual USB drive, thus enabling simple and intuitive file copying and transfer.
[0062] By activating the RAMFS transmission protocol, the RAM read / write speed is 6 to 10 times faster than the FLASH read / write speed, enabling rapid transmission of the actual burning program, i.e., the program to be installed.
[0063] S12, the server obtains the installation program to be installed, and compresses and packages each image of the installation program to be installed, to obtain the compressed target installation program and the configuration table corresponding to the target installation program.
[0064] In reality, a large amount of space is reserved for users to expand later when burning the file system. The storage space will not be completely used up, and many partitions are only formatted, so there is a lot of zero data.
[0065] In view of the above, the installation program to be installed can be compressed.
[0066] Specifically, the step of compressing and packaging each image of the installer to obtain the compressed target installer and the configuration table corresponding to the target installer includes:
[0067] The server compresses and packages each image of the installer to be installed using the gzip command to obtain the target installer;
[0068] The server obtains the start address and end address of each image and records the start address and end address of each image in the configuration file to obtain the configuration table;
[0069] Specifically, empty data partitions in the installation program are not compressed or packaged.
[0070] For example, through compression, the original 16GB of space can be compressed to 200MB, thus effectively shortening the subsequent transmission time from the server to the embedded device.
[0071] In the above embodiments, the gzip command offers a high overall cost-effectiveness in terms of storage space and decompression time. By compressing and packaging each image of the installer to be installed, the actual installer does not need to create formatted files or ISO image files during transmission; it only needs to compress and package each image, recording the start and end addresses of each image in the configuration file. Testing shows that, due to the relatively small amount of actual effective data, the compression ratio can reach approximately 3 to 10 times. Furthermore, since the effective data in the empty data partition is zero, no compression program is needed, further improving the efficiency of compression and packaging.
[0072] S13, the server transmits the target installation program and the configuration table to the virtual USB drive.
[0073] In this embodiment, the virtual USB drive is part of the memory. Using a virtual USB drive allows for faster transfer of programs to the memory. Furthermore, since the virtual USB drive supports the USB Mass Storage protocol and the RAMFS transfer protocol, it not only makes it easier for the server to recognize the virtual USB drive, but also ensures high transfer efficiency.
[0074] S14, the embedded device burns the target installation program to the FLASH of the embedded device according to the configuration table.
[0075] In this embodiment, the embedded device burning the target installation program to the FLASH of the embedded device according to the configuration table includes:
[0076] The embedded device determines the zero data and empty data partitions in the target installation program according to the configuration table;
[0077] During the process of burning the target installation program to the FLASH, the embedded device skips the zero data and performs formatting partitioning on the empty data partition.
[0078] Specifically, the embedded device performs formatting partitioning processing on the empty data partition, including:
[0079] The embedded device only writes the corresponding partition information at the header of the empty data partition.
[0080] For example, for an empty data partition, you only need to format the partition. If a data partition has 4GB of empty space, then formatting ext4 only requires erasing and writing a 512KB sector at the beginning.
[0081] In the above embodiments, the burning process is actually equivalent to the decompression process of the gzip command. It skips consecutive zero data, that is, it automatically avoids erasing and writing consecutive zero data. For empty data partitions, it only performs partition formatting, which saves a lot of burning time. At the same time, since it avoids repeated invalid burning of partitions, it also improves the lifespan of FLASH and the stability of erasing and writing.
[0082] In this embodiment, the method further includes:
[0083] Multi-threading is used to perform data transfer to the virtual USB drive and program writing to the FLASH memory.
[0084] Through the above embodiments, multi-threaded asynchronous parallel processing can be used for data transfer to the virtual USB drive and program writing to the FLASH memory. This eliminates the need for waiting during the writing process; writing can begin as soon as the first compressed file is in memory. Due to the high speed of memory transfer, subsequent compressed file writing also does not require waiting. Furthermore, the writing process can be performed simultaneously on multiple FLASH chips, enabling parallel operation of server data transfer and FLASH writing. Correspondingly, USB data cable transmission, the device's main control SOC, memory, and FLASH devices can also operate simultaneously, meaning all devices can work in parallel.
[0085] In existing technologies, the main approach is to first transmit uboot (Universal Boot Loader) to the embedded device. After uboot starts, it sequentially writes each image to FLASH according to the configuration table. The writing time depends on the capacity of FLASH; the larger the FLASH capacity, the longer the writing time.
[0086] For example, it has been verified that the current power industry's data acquisition terminal system is mainly based on the mainstream FLASH storage eMMC (embedded MultiMediaCard), with a capacity of 16GB. The clock frequency of eMMC according to the HS200 standard is 200MHz. Affected by the latency of eMMC and a series of buses and controllers such as SOC, the data write rate is usually 20MByte / s. If the entire 16GB is normally written (the actual effective data is only about 200MB), it will take about 15 minutes.
[0087] In comparison, this embodiment utilizes compression, virtual USB drives, and other methods to flexibly use memory mapping and decompression, transferring only the valid data without erasing the entire FLASH memory. For larger partitions (such as container partitions and data partitions), this embodiment achieves a program file compression rate of over 90%. Furthermore, for individual empty partitions (such as log partitions and reserved partitions), only quick formatting is required, thus maximizing the system's burning speed. Since burning time depends on the actual valid data, burning invalid data is avoided, compressing the program from 16GB to 200MB, skipping zero data, and burning only valid data, reducing the original burning time of approximately 15 minutes to 1-2 minutes.
[0088] As can be seen, this embodiment first solves the problem of long transmission time of the installation program from the server to the embedded device due to the large image package and the formatted partition image being the same size as the FLASH. Secondly, compression solves the problem of long full-disk burning time. Finally, because the transmission and burning processes are processed asynchronously and in parallel by multiple sites, the time utilization rate is high. The server can transmit the installation program and burn the FLASH at the same time, divided into a fragmented mode with each block being 512 bytes. Transmission and burning can be switched back and forth, reducing waiting time.
[0089] As can be seen from the above technical solutions, on the one hand, compressing and packaging each image of the installation program and transferring the compressed and packaged target installation program and the corresponding configuration table to the virtual USB drive in the RAM memory of the embedded device effectively shortens the data transmission time due to the reduction of data transmission volume. Furthermore, the use of a virtual USB drive further improves the data transmission efficiency to memory. On the other hand, burning the target installation program to the FLASH of the embedded device according to the configuration table and only burning valid data can further compress the program burning time based on memory mapping, thereby improving the program burning efficiency of the embedded Linux system.
[0090] like Figure 2 The diagram shown is a functional block diagram of a preferred embodiment of the Linux system program burning device of the present invention. The Linux system program burning device 11 includes a server 110 and an embedded device 111. The module / unit referred to in this invention refers to a series of computer program segments that can be executed by a processor and perform a fixed function, and which are stored in memory. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.
[0091] The server 110 is used to transmit pre-installed programs to the embedded device 111;
[0092] The embedded device 111 is used to run the received pre-installed program and start the virtual USB drive in the RAM memory of the embedded device 111;
[0093] The server 110 is also used to obtain the installation program to be installed, and to compress and package each image of the installation program to be installed, so as to obtain the compressed target installation program and the configuration table corresponding to the target installation program;
[0094] The server 110 is also used to transfer the target installation program and the configuration table to the virtual USB drive;
[0095] The embedded device 111 is further configured to burn the target installation program to the FLASH of the embedded device 111 according to the configuration table.
[0096] As can be seen from the above technical solutions, on the one hand, compressing and packaging each image of the installation program and transferring the compressed and packaged target installation program and the corresponding configuration table to the virtual USB drive in the RAM memory of the embedded device effectively shortens the data transmission time due to the reduction of data transmission volume. Furthermore, the use of a virtual USB drive further improves the data transmission efficiency to memory. On the other hand, burning the target installation program to the FLASH of the embedded device according to the configuration table and only burning valid data can further compress the program burning time based on memory mapping, thereby improving the program burning efficiency of the embedded Linux system.
[0097] like Figure 3 The diagram shown is a schematic representation of the structure of a computer device that implements the program burning method for the Linux system according to a preferred embodiment of the present invention.
[0098] The computer device 1 may include a memory 12, a processor 13 and a bus, and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a Linux system program burning program.
[0099] Those skilled in the art will understand that the schematic diagram is merely an example of computer device 1 and does not constitute a limitation on computer device 1. Computer device 1 can be either a bus topology or a star topology. Computer device 1 may also include more or fewer other hardware or software than shown in the diagram, or different component arrangements. For example, computer device 1 may also include input / output devices, network access devices, etc.
[0100] It should be noted that the computer device 1 described is merely an example. Other existing or future electronic products that are adaptable to this invention should also be included within the scope of protection of this invention and are incorporated herein by reference.
[0101] The memory 12 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the computer device 1, such as a portable hard drive of the computer device 1. In other embodiments, the memory 12 can be an external storage device of the computer device 1, such as a plug-in portable hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device 1. Furthermore, the memory 12 can include both internal and external storage units of the computer device 1. The memory 12 can be used not only to store application software and various types of data installed on the computer device 1, such as the code for burning programs to a Linux system, but also to temporarily store data that has been output or will be output.
[0102] In some embodiments, the processor 13 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 13 is the control unit of the computer device 1, connecting various components of the computer device 1 via various interfaces and lines. It executes programs or modules stored in the memory 12 (e.g., executing Linux system program flashing programs), and calls data stored in the memory 12 to perform various functions of the computer device 1 and process data.
[0103] The processor 13 executes the operating system of the computer device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-described embodiments of the Linux system program burning method, for example... Figure 1 The steps are shown.
[0104] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device 1. For example, the computer program may be divided into a server 110 and an embedded device 111.
[0105] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute the program burning method for the Linux system described in the various embodiments of this invention.
[0106] If the modules / units integrated in the computer device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware devices. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above.
[0107] The computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, etc.
[0108] Furthermore, the computer-readable storage medium may primarily include a stored program area and a stored data area, wherein the stored program area may store the operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of blockchain nodes, etc.
[0109] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.
[0110] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, in... Figure 3 The bus is represented by only one straight line, but this does not mean that there is only one bus or one type of bus. The bus is configured to enable communication between the memory 12 and at least one processor 13, etc.
[0111] Although not shown, the computer device 1 may also include a power supply (such as a battery) to power various components. Preferably, the power supply can be logically connected to the at least one processor 13 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The computer device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0112] Furthermore, the computer device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish a communication connection between the computer device 1 and other computer devices.
[0113] Optionally, the computer device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the computer device 1 and to display a visual user interface.
[0114] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.
[0115] Figure 3 Only computer device 1 with components 12-13 is shown; those skilled in the art will understand that... Figure 3 The structure shown does not constitute a limitation on the computer device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0116] Combination Figure 1 The memory 12 in the computer device 1 stores multiple instructions to implement a method for burning a Linux system program, and the processor 13 can execute the multiple instructions to achieve the following:
[0117] The server transmits pre-installed programs to Linux-based embedded devices;
[0118] The embedded device runs the received pre-installed program and starts the virtual USB drive in the RAM memory of the embedded device;
[0119] The server obtains the installation program to be installed and compresses and packages each image of the installation program to be installed, thereby obtaining the compressed target installation program and the configuration table corresponding to the target installation program;
[0120] The server transmits the target installation program and the configuration table to the virtual USB drive;
[0121] The embedded device burns the target installation program to the FLASH of the embedded device according to the configuration table.
[0122] Specifically, the processor 13's implementation method for the above instructions can be found in [reference needed]. Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.
[0123] It should be noted that all the data involved in this case was legally obtained.
[0124] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.
[0125] This invention can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0126] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0127] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.
[0128] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0129] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.
[0130] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in this invention can also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.
[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for flashing programs onto a Linux system, characterized in that, The program flashing method for the Linux system includes: The server transmits a pre-installed program to a Linux-based embedded device; wherein the pre-installed program is generated by the server and is a binary executable program used to activate the FLASH programming function; The embedded device runs the received pre-installed program and starts the virtual USB drive in the RAM memory of the embedded device; The server obtains the installer to be installed and compresses and packages each image of the installer to be installed to obtain a compressed target installer and a configuration table corresponding to the target installer. This includes: the server compressing and packaging each image of the installer to be installed using the gzip command to obtain the target installer; the server obtaining the start and end addresses of each image and recording the start and end addresses of each image in a configuration file to obtain the configuration table; wherein empty data partitions in the installer to be installed are not compressed and packaged. The server transmits the target installation program and the configuration table to the virtual USB drive; The embedded device writes the target installation program to the FLASH of the embedded device according to the configuration table, including: the embedded device determines the zero data and empty data partitions in the target installation program according to the configuration table; during the process of writing the target installation program to the FLASH, the embedded device skips the zero data, and the embedded device performs formatting partition processing on the empty data partition; wherein, the embedded device performs formatting partition processing on the empty data partition, including: the embedded device only writes the corresponding partition information at the beginning of the empty data partition.
2. The method for burning programs into a Linux system as described in claim 1, characterized in that, The server transmits pre-installed programs to Linux-based embedded devices, including: The server transmits the pre-installation program to the SOC main control chip of the embedded device via a USB data cable.
3. The method for burning programs into a Linux system as described in claim 1, characterized in that, The virtual USB drive in the RAM memory of the embedded device that is used to start the device includes: The embedded device initiates the USB Mass Storage protocol and RAMFS transfer protocol of the virtual USB flash drive; The USB Mass Storage protocol is used to enable the server to recognize the virtual USB flash drive; the RAMFS transfer protocol is used to support read and write operations on the RAM memory.
4. The method for burning programs into a Linux system as described in claim 1, characterized in that, The method further includes: Multi-threading is used to perform data transfer to the virtual USB drive and program writing to the FLASH memory.
5. A program burning device for a Linux system, characterized in that, The Linux system program burning device includes: A server is used to transmit a pre-installed program to an embedded device; wherein the pre-installed program is generated by the server and is a binary executable program used to activate the FLASH programming function; The embedded device is used to run the received pre-installed program and start the virtual USB drive in the RAM memory of the embedded device; The server is further configured to obtain the installer to be installed, and compress and package each image of the installer to be installed to obtain a compressed target installer and a configuration table corresponding to the target installer, including: the server compressing and packaging each image of the installer to be installed based on the gzip command to obtain the target installer; the server obtaining the start address and end address of each image, and recording the start address and end address of each image in a configuration file to obtain the configuration table; wherein, empty data partitions in the installer to be installed are not compressed and packaged; The server is also used to transfer the target installation program and the configuration table to the virtual USB drive; The embedded device is further configured to burn the target installation program to the FLASH of the embedded device according to the configuration table, including: the embedded device determining the zero data and empty data partitions in the target installation program according to the configuration table; during the process of burning the target installation program to the FLASH, the embedded device skips the zero data, and the embedded device performs format partition processing on the empty data partition; wherein, the embedded device performing format partition processing on the empty data partition includes: the embedded device only writes the corresponding partition information at the beginning of the empty data partition.
6. A computer device, characterized in that, The computer device includes: Memory, storing at least one instruction; and The processor executes the instructions stored in the memory to implement the program burning method of the Linux system as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, which is executed by a processor in a computer device to implement the program burning method for the Linux system as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Apparatus, system, and method for a shared, front-end, distributed raid
CN101689131A
Diskless computer starting method based on operating system network drive
CN101794235A