Method, system, server and storage medium for starting an application
By automatically generating bootloader code for IoT devices, the problem of high manpower and time costs in existing technologies is solved, enabling automated configuration and upgrades of devices, and making it suitable for a variety of IoT devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ABUP TECH CO LTD
- Filing Date
- 2020-10-30
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, the creation and configuration of bootloaders require a lot of manpower and time, cannot be standardized, cannot be applied to different IoT devices, and lack upgrade functionality.
By acquiring user needs and IoT device hardware information through the client, it automatically generates bootloader code that matches the device, including the configuration and compilation process, and supports automated configuration and upgrades for different devices.
It enables automated configuration that can be applied to different IoT devices without additional development, saving labor and time costs, and supports the upgrade function of the bootloader, improving adaptability and efficiency.
Smart Images

Figure CN113157329B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The embodiment of the present application relates to the field of Internet of Things, in particular to a method, system, server and storage medium for starting an application. BACKGROUND
[0002] In an embedded operating system, a BootLoader initializes hardware devices and establishes a memory space map, so as to bring the hardware and software environment of the system to a suitable state, so as to prepare a correct environment for finally calling an operating system kernel. In an Internet of Things device, a BootLoader is used to complete the program of starting an embedded system and loading system software, and to guide system startup and application software loading.
[0003] However, a conventional BootLoader needs to be developed by a technician according to a current device and a chip, code for starting is written, and then the written code is compiled into a binary file through an IDE tool or a compilation chain and is written into a Flash, so that the BootLoader can be used. The process of program generation and compilation cannot be streamlined, and it takes a lot of manpower and time cost to make and configure the BootLoader. SUMMARY
[0004] The embodiment of the present application aims to provide a method, system, server and storage medium for starting an application, which automatically generates a BootLoader matched with an Internet of Things device without additional development.
[0005] To solve the above technical problems, the embodiment of the present application provides a method for starting an application, comprising the following steps:
[0006] acquiring, by a client, demand information of a user and hardware information of the Internet of Things device;
[0007] acquiring a code file of a corresponding BootLoader according to the hardware information;
[0008] configuring the Internet of Things device according to the demand information and the hardware information;
[0009] compiling the code file and sending the code file to the configured Internet of Things device, so that the Internet of Things device starts an application.
[0010] The embodiment of the present application further provides a system for starting an application, comprising:
[0011] a receiving module, configured to acquire, by a client, demand information of a user and hardware information of the Internet of Things device;
[0012] The generating module is configured to acquire a code file of a corresponding booting program according to the hardware information;
[0013] The configuring module is configured to configure the Internet of Things device according to the demand information and the hardware information.
[0014] The sending module is configured to compile the code file and send the code file to the configured Internet of Things device for starting an application.
[0015] The embodiment of the application further provides a server, comprising:
[0016] at least one processor; and
[0017] a memory connected with the at least one processor; wherein
[0018] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for starting an application.
[0019] The embodiment of the application further provides a computer storage medium, comprising: a computer program stored therein, wherein the computer program is executed by a processor to implement the method for starting an application.
[0020] Compared with the prior art, the embodiment of the application matches a corresponding code of a booting program according to different Internet of Things devices, so that the application can be applied to different devices, and the device is automatically processed according to the demand of a user, so that the user only needs to input device information and demand content to configure and embed a program in the device, without the need of re-development of a technician, thereby saving labor and time costs.
[0021] In addition, in the process that the code file matched with the Internet of Things device is acquired through the pre-set script and the model, the script is used to call the code file that can be matched with the Internet of Things device of different models.
[0022] In addition, in the process that the Internet of Things device is configured according to the demand information and the hardware information, the serial port information of the Internet of Things device is acquired as the hardware information, wherein the serial port information at least includes a serial port type; and the serial port is configured according to the serial port information.
[0023] Furthermore, the configuration of the code file according to the hardware information and the requirement information includes: obtaining partition information as the requirement information, wherein the partition information includes the bootloader storage area, data storage area, and application storage area; and configuring the IoT device according to the partition information. The device can be configured according to the requirement information, dividing it into different partitions, which facilitates subsequent use of the device. Attached Figure Description
[0024] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0025] Figure 1 This is a flowchart of the method for launching an application provided in the first embodiment of the present invention;
[0026] Figure 2 This is a flowchart of the compilation method in the application startup method provided in the first embodiment of the present invention;
[0027] Figure 3 This is a flowchart of a method for launching an application provided in the second embodiment of the present invention;
[0028] Figure 4 This is a schematic diagram of the system for launching applications provided in the third embodiment of the present invention;
[0029] Figure 5 This is a schematic diagram of the server structure provided in the fourth embodiment of the present invention. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been presented in the various embodiments of the present invention to enable the reader to better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments.
[0031] The division of the following embodiments is for ease of description and should not constitute any limitation on the specific implementation of the present invention. The various embodiments can be combined with and referenced by each other without contradiction.
[0032] The first embodiment of the present invention relates to a method for launching an application. The specific process is as follows: Figure 1 As shown.
[0033] In step 101, the client obtains the demand information of the user and the hardware information of the Internet of Things device.
[0034] In the embodiment, the Internet of Things device mainly refers to a chip in the Internet of Things device. A blank chip without setting is connected to the server of the application through a serial port, and the chip is configured by the server, BootLoader is imported, and the device is started for application.
[0035] Specifically, the user inputs the model and storage space of the chip device on the client page, wherein the storage space includes flash memory and random access memory (RAM).
[0036] In one specific example, the user inputs the chip model to be configured as STM32F413ZHT6, the Flash is 1.5 MB, and the RAM is 320 KB.
[0037] The demand information includes partition information of the storage space of the chip device, including the start address and partition size of each partition. Generally, it is divided into three areas: boot program storage area, data storage area and application storage area. Among them, the boot program storage area is used to store BootLoader, the data storage area is mainly used to store application upgrade package, and the application storage area is used to store the application program of the Internet of Things device.
[0038] In step 102, the code file of the corresponding boot program is obtained according to the hardware information.
[0039] In the embodiment, the script can call different BootLoader code files according to different devices, including general code files and special model code files. If the input chip model does not have a corresponding code file, the general code file is used, wherein the script of the embodiment is a shell script running on Linux.
[0040] Specifically, the model information in the hardware information contains MCU kernel and model related macros. The kernel and macros corresponding to the model are determined according to the model script, such as selecting STM32L452xx to define the compilation parameters kernel=cortex-m4 and STM32L452xx macro in makefile.
[0041] It is worth mentioning that an ID number can be added in the code file. The ID is a unique number of BootLoader, which can be checked according to the authentication code. If the check is correct, other operations such as upgrading can be performed.
[0042] In step 103, the Internet of Things device is configured according to the demand information and hardware information.
[0043] In the embodiment, according to step 101, it can be known that the requirement information includes partition information, and the Flash and the RAM are configured according to the partition information. The configuration methods in the Flash and the RAM are similar, and here only the Flash configuration is specifically described.
[0044] Specifically, the start address and the size of the boot startup program storage area determine the maximum value and the start address of the bin file of the BootLoader, if the BootLoader is not at the start address of the Flash, the interrupt vector table is modified; the start address and the size of the application storage area determine the jump position of the BootLoader and the maximum value of the bin file of the application program; the start address and the size of the data storage area determine the start address and the maximum value of the upgrade package, wherein the maximum value of the upgrade package is the size of the data storage area minus two Block sizes. The two Block are respectively the last two Block of the data storage area, wherein the last Block is the parameter area, and the second last Block is the restore backup area. The positions of the areas must not overlap.
[0045] It should be noted that the classification of the division of the areas is only an example, and different division can be made according to actual needs.
[0046] After the start address and the size of each area are configured, the script automatically modifies the ID file and the header file.
[0047] In the embodiment, the hardware information further includes serial port information. Since the diversity of actual application of users and the difference of different platforms determine that the serial port cannot have a unified driver, it is necessary for the user to upload a customized serial port driver file (usart.c and usart.h), and the script will read the initialization function from the usart.h according to the configured serial port name.
[0048] Step 104, the code file is compiled and sent to the configured Internet of Things device, for the Internet of Things device to start the application.
[0049] In the embodiment, the compiler of the BootLoader is gcc-arm-none-eabi, and in the compiling process, arm-none-eabi-gcc and arm-none-eabi-objcopy are mainly used, and BID.bin is generated after successful compilation, and “build error!” is reported in case of compilation failure (including flash configuration error, RAM configuration error and code error).
[0050] The compiling process is as shown in Figure 2 , which includes:
[0051] Step 201, the corresponding code file of the script call ".c file" is preprocessed to generate a preprocessing file ".i file";
[0052] Step 202, the preprocessed file is compiled to generate an assembly file ".s file";
[0053] Step 203, the assembly file is assembled to generate an object file ".o file";
[0054] Step 204, the object file is combined with other object files, library files and startup files to generate an executable file;
[0055] Step 205, the generated executable file is sent to the Internet of Things device.
[0056] Specifically, the following tools are needed: arm-none-eabi-gcc is a c language compiler that can convert.c files into.o executable files; arm-none-eabi-g++ is a c++ language compiler that can convert.cpp files into.o executable files; arm-none-eabi-ld is a linker that links all.o files to generate an executable file. Generally, we do not use arm-none-eabi-ld instructions to call it, but use arm-none-eabi-gcc to call it because the former has poor support for mixed.o files generated by c / cpp files, so the official manual also recommends using arm-none-eabi-gcc instructions instead of arm-none-eabi-ld; arm-none-eabi-objcopy converts the linker-generated file into a bin / hex format for burning into the Internet of Things device; arm-none-eabi-gdb is a debugger in the tool chain that connects to the network port generated by the debugger hardware to debug the hardware and code.
[0057] It should be noted that the present embodiment uses gcc for compilation, but the compilation method is not limited thereto, and in addition to gcc, keil or iar can also be used for compilation, but gcc is more suitable for running on linux.
[0058] The step division of the above methods is only for clarity, and in implementation, one step can be combined or some steps can be split and decomposed into multiple steps, as long as the same logical relationship is included, and all are within the protection scope of the present patent; adding insignificant modifications or introducing insignificant designs in the algorithm or process, but not changing the core design of the algorithm and process are within the protection scope of the present patent.
[0059] The second embodiment of the present invention relates to a method for launching an application, applied after the code file has been sent to an IoT device. Specific steps are as follows: Figure 3 As shown:
[0060] Step 301: Detect whether an application upgrade package exists in the data storage area of the IoT device through the bootloader;
[0061] In this embodiment, the application upgrade package only contains the differences between the new and old versions of the application;
[0062] After detecting the existence of the application upgrade package, proceed to step 302.
[0063] Step 302: Ask the user if they want to upgrade;
[0064] It should be noted that, yes, you can set up step 303 to proceed with the upgrade only after the user interacts and their needs are confirmed, or you can skip the prompt and directly execute step 303 after detecting the existence of the upgrade package.
[0065] Step 303: Load the application upgrade package into the running memory and guide the application to upgrade according to the contents of the application upgrade package.
[0066] By using the bootloader's application upgrade function, the application is taken to the upgrade page and upgraded according to the application upgrade package.
[0067] It should be noted that since the data in the application upgrade package is the difference between versions, the differential upgrade method is used, which results in a faster upgrade speed and reduces the space occupied by the application upgrade package and the upgrade process.
[0068] The third embodiment of the present invention relates to a system for launching an application, such as... Figure 4 As shown, it includes:
[0069] The receiving module 401 is used to obtain user demand information and hardware information of the IoT device through the client;
[0070] The generation module 402 is used to obtain the code file of the corresponding boot program based on the hardware information;
[0071] Configuration module 403 is used to configure the IoT device according to the requirement information and hardware information;
[0072] The sending module 404 is used to compile the code file and send it to the configured IoT device so that the IoT device can start the application.
[0073] It can be found that the embodiment is a system embodiment corresponding to the first embodiment, and the embodiment can be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in the embodiment, and in order to reduce repetition, they will not be described here. Correspondingly, the related technical details mentioned in the embodiment can also be applied in the first embodiment.
[0074] It is worth mentioning that each module involved in the embodiment is a logical module. In actual application, a logical unit can be a physical unit, a part of a physical unit, or a combination of multiple physical units. In addition, in order to highlight the innovative part of the application, units not closely related to solving the technical problems proposed in the application are not introduced in the embodiment, but this does not mean that there are no other units in the embodiment.
[0075] The fourth embodiment of the application relates to a server, as shown in the following formula: Figure 5 The server comprises:
[0076] at least one processor 501; and a memory 502 connected with the at least one processor 501; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for starting the application.
[0077] The memory and the processor are connected in a bus mode, and the bus can include any number of interconnected buses and bridges. The bus links various circuits of one or more processors and memories together. The bus can also link various other circuits such as peripheral devices, voltage stabilizers and power management circuits, which are well known in the art, and therefore will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements such as multiple receivers and transmitters, which provide a unit for communicating with various other devices on the transmission medium. The data processed by the processor is transmitted on the wireless medium through the antenna, and further, the antenna also receives data and transmits the data to the processor.
[0078] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interface, voltage regulation, power management and other control functions. The memory can be used to store data used by the processor during operation.
[0079] Those skilled in the art can understand that all or part of the steps of the method in the above-mentioned embodiments can be completed by programs instructing the relevant hardware, the programs are stored in a storage medium, and the programs include a plurality of instructions for causing an apparatus (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the method described in various embodiments of the present application. The foregoing storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media capable of storing program codes.
[0080] Those skilled in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.
Claims
1. A method for launching an application, characterized in that, Applied to IoT devices, including: The client obtains the user's requirements and the hardware information of the IoT device. The requirement information includes the partitioning information of the chip device's storage space, as well as the starting address and size of each partition. The chip device's storage space partitioning includes at least a boot program storage area, a data storage area, and an application storage area. Based on the hardware information, obtain the corresponding boot program code file, wherein the function of the code file includes booting the application and booting the application upgrade; The code file for obtaining the corresponding boot program based on the hardware information includes: obtaining the model of the IoT device as the hardware information; and obtaining the code file matching the IoT device by combining the model with a pre-set script. Configure the IoT device according to the required information and hardware information; The code file is compiled and sent to the configured IoT device, so that the IoT device can start and upgrade the application.
2. The method for launching an application according to claim 1, characterized in that, In the process of obtaining a code file that matches the IoT device by means of a pre-set script and the model number, the script is used to call the code file that can be matched with different models of the IoT device.
3. The method for launching an application according to claim 1, characterized in that, In configuring the IoT device according to the requirement information and hardware information, the requirement information includes at least: the maximum storage space available to the IoT device for the bootloader, and the method includes: The storage location of the bootloader in the storage space of the IoT device is determined based on the maximum storage space.
4. The method for launching an application according to claim 1, characterized in that, The configuration of the IoT device according to the required information and hardware information includes: The serial port information of the IoT device is obtained as the hardware information, wherein the serial port information includes at least the serial port type; Configure the serial port according to the serial port information.
5. The method for launching an application according to claim 1, characterized in that, The configuration of the code file according to the hardware information and the requirement information includes: Obtain partition information as the required information, wherein the partition information includes the bootloader storage area, data storage area, and application storage area; The IoT device is configured according to the partition information.
6. The method for launching an application according to claim 5, characterized in that, The configuration of the IoT device according to the partition information includes: The addresses of the bootloader storage area, the data storage area, and the application storage area in the storage space of the IoT device are determined based on the partition information, wherein the addresses of each area cannot overlap.
7. The method for launching an application according to claim 1, characterized in that, The code file is compiled and sent to the configured IoT device for the IoT device to launch and upgrade the application. Upgrading the application includes: The application upgrade package stored in the data storage area of the IoT device is obtained through the bootloader. The application corresponding to the application upgrade package is upgraded according to the application upgrade package.
8. A system for launching an application, characterized in that, include: The receiving module is used to obtain user demand information and IoT device hardware information through the client. The requirement information includes the partitioning information of the chip device's storage space, as well as the starting address and size of each partition. The chip device's storage space partitioning includes at least a boot program storage area, a data storage area, and an application storage area. The generation module is used to obtain the corresponding boot program code file based on the hardware information, wherein the code file has the function of booting the application and booting the application upgrade. The code file for obtaining the corresponding boot program based on the hardware information includes: obtaining the model of the IoT device as the hardware information; and obtaining the code file matching the IoT device by combining the model with a pre-set script. A configuration module is used to configure the IoT device according to the requirement information and hardware information; The sending module is used to compile the code file and send it to the configured IoT device, so that the IoT device can start the application and upgrade the application.
9. A server, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of launching an application as described in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the method for launching the application as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Method for remotely downloading programs based on STM32F4 controller
CN103514018A