Method, device, electronic device and medium for operating an internet of things system

CN114489662BActive Publication Date: 2026-09-18ADVANCED INST OF INFORMATION TECH (AIIT) PEKING UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111604450.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-24
Publication Date
2026-09-18
Estimated Expiration
2041-12-24

AI Technical Summary

Technical Problem

[0004]本申请实施例提供一种物联网系统的运行方法、装置、电子设备及介质,本申请实施例用于解决相关技术中存在的物联网系统中内核程序包和应用程序包混合编译所导致的编码效率不高的问题

Benefits of technology

[0031] This application provides a method to obtain an initial IoT system architecture, a kernel code package, and an application code package. Within the initial IoT system architecture, the kernel code package is assigned to a first address field, and the application code package is assigned to a second address field, resulting in a target IoT system. An interface function is established between the kernel code package and the application code package, and the target IoT system is run. When the target IoT system processes business logic, resource data from the kernel code package is transmitted to the application program through the interface function. By applying the technical solution of this application, different address fields can be assigned to the kernel package and the application package in the IoT system architecture, and a connection interface can be established to achieve their respective operational purposes. This provides a method for decoupling the kernel package and the application package in the IoT system architecture, thereby avoiding the problem of low coding efficiency caused by the mixed compilation of the kernel package and the application package in the existing IoT system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114489662B_ABST
    Figure CN114489662B_ABST
Patent Text Reader

Abstract

The application discloses a running method and device of an Internet of Things system, electronic equipment and a medium. Through application of the technical solution of the application, different address fields can be allocated to a kernel program package and an application program package in an Internet of Things system architecture, and a connection interface is established to achieve the respective running purposes. Thus, a method of decoupling the kernel program package and the application program package in the Internet of Things system architecture is realized, and the problem of low coding efficiency caused by mixed compilation of the kernel program package and the application program package in the Internet of Things system in the prior art is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technology, and in particular to a method, apparatus, electronic device and medium for operating an Internet of Things (IoT) system. Background Technology

[0002] With the development of the Internet of Things (IoT) industry, major manufacturers are launching their own real-time IoT systems. Many open-source IoT systems, such as rt_thread, TencentOS, and LiteOS, currently employ a hybrid development approach, combining kernel packages and application code.

[0003] However, there is a drawback to using the aforementioned hybrid compilation of kernel packages and application packages in IoT systems: the compilation time cost of this development method is higher than that of compiling them separately, which leads to low coding efficiency. Summary of the Invention

[0004] This application provides an operating method, apparatus, electronic device, and medium for an Internet of Things (IoT) system. This application addresses the problem of low coding efficiency caused by the mixed compilation of kernel packages and application packages in IoT systems, which exists in related technologies.

[0005] According to one aspect of the embodiments of this application, a method for operating an Internet of Things (IoT) system is provided, characterized in that it includes:

[0006] Obtain the initial IoT system architecture, kernel code package, and application code package;

[0007] In the initial IoT system architecture, the kernel code package is assigned to the first address field, and the application code package is assigned to the second address field to obtain the target IoT system;

[0008] Establish interface functions between the kernel code package and the application code package, and run the target IoT system;

[0009] When the target IoT system processes business, it transmits resource data from the kernel code program to the application through the interface.

[0010] Optionally, in another embodiment based on the method described above in this application, allocating the kernel code package in the first address field in the initial IoT system architecture includes:

[0011] In the initial IoT system architecture, the kernel space code is allocated to the first Flash address field, and the kernel program code is allocated to the first SRAM memory address field.

[0012] Optionally, in another embodiment based on the method described above in this application, after allocating the kernel space code to the first Flash address field in the initial IoT system architecture, the method further includes:

[0013] Obtain the global service table field and allocate the global service table field in the first Flash address field. The global service table field is used to define the addresses of all application programming interface entity functions implemented by the kernel code program.

[0014] Optionally, in another embodiment based on the method described above in this application, the step of allocating the global service table field in the first Flash address field includes:

[0015] Divide the first Flash address field into a first sub-Flash address field;

[0016] The link address corresponding to the global service table field is stored in the first sub-Flash address field, and the start field bit and end field bit corresponding to the first sub-Flash address field are recorded.

[0017] Optionally, in another embodiment based on the method described above in this application, the step of allocating the application code package in the second address field in the initial IoT system architecture includes:

[0018] In the initial IoT system architecture, the application space code is allocated to the second Flash address field, and the application code program is allocated to the second SRAM memory address field.

[0019] Optionally, in another embodiment based on the method described above in this application, after allocating the application code package to the second address field in the initial IoT system architecture, the method further includes:

[0020] The application code program's BSS segment is cleared, and the global service table is copied to the starting address of the kernel SRAM memory;

[0021] The application code program is initialized, and the application thread program is created and run according to the application code program.

[0022] According to another aspect of the embodiments of this application, an operating apparatus for an Internet of Things (IoT) system is provided, characterized in that it includes:

[0023] The acquisition module is configured to acquire the initial IoT system architecture, kernel code package, and application code package.

[0024] The configuration module is configured to allocate the kernel code package to the first address field and the application code package to the second address field in the initial IoT system architecture to obtain the target IoT system.

[0025] The runtime module is configured to establish interface functions between the kernel code package and the application code package, and to run the target IoT system;

[0026] The processing module is configured to transmit resource data from the kernel code program to the application program through the interface when the target IoT system processes business.

[0027] According to another aspect of the embodiments of this application, an electronic device is provided, comprising:

[0028] Memory, used to store executable instructions; and

[0029] A display, used to execute the executable instructions with the memory to complete the operation of any of the above-described IoT system operation methods.

[0030] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided for storing computer-readable instructions, which, when executed, perform the operation of any of the above-described IoT system operation methods.

[0031] This application provides a method to obtain an initial IoT system architecture, a kernel code package, and an application code package. Within the initial IoT system architecture, the kernel code package is assigned to a first address field, and the application code package is assigned to a second address field, resulting in a target IoT system. An interface function is established between the kernel code package and the application code package, and the target IoT system is run. When the target IoT system processes business logic, resource data from the kernel code package is transmitted to the application program through the interface function. By applying the technical solution of this application, different address fields can be assigned to the kernel package and the application package in the IoT system architecture, and a connection interface can be established to achieve their respective operational purposes. This provides a method for decoupling the kernel package and the application package in the IoT system architecture, thereby avoiding the problem of low coding efficiency caused by the mixed compilation of the kernel package and the application package in the existing IoT system.

[0032] The technical solution of this application will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0033] The accompanying drawings, which form part of this specification, illustrate embodiments of this application and, together with the description, serve to explain the principles of this application.

[0034] This application can be more clearly understood with reference to the accompanying drawings and the following detailed description, wherein:

[0035] Figure 1 This is a schematic diagram of the operation method of an Internet of Things system proposed in this application;

[0036] Figure 2 This is an architecture diagram of a memory board for an Internet of Things system proposed in this application;

[0037] Figure 3 This is an internal architecture diagram of another Internet of Things (IoT) system proposed in this application;

[0038] Figure 4 This is a schematic diagram of the operating electronic device of an Internet of Things (IoT) system proposed in this application;

[0039] Figure 5 This is a schematic diagram of an electronic device operating in an Internet of Things (IoT) system as proposed in this application. Detailed Implementation

[0040] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0041] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0042] The following description of at least one exemplary embodiment is merely illustrative and is not intended to limit the scope of this application or its application or use.

[0043] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0044] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.

[0045] Furthermore, the technical solutions of the various embodiments of this application can be combined with each other, but only if they are based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such combination of technical solutions does not exist and is not within the scope of protection claimed by this application.

[0046] It should be noted that all directional indicators (such as up, down, left, right, front, back, etc.) in the embodiments of this application are only used to explain the relative positional relationship and movement of each component in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicator will also change accordingly.

[0047] The following is combined Figures 1-3 This application describes a method for operating an Internet of Things (IoT) system according to exemplary embodiments. It should be noted that the following application scenarios are shown only to facilitate understanding of the spirit and principles of this application, and the embodiments of this application are not limited in any way. Rather, the embodiments of this application can be applied to any applicable scenario.

[0048] This application also proposes an operation method, apparatus, target terminal, and medium for an Internet of Things (IoT) system.

[0049] Figure 1 A schematic flowchart illustrating an operation method of an Internet of Things (IoT) system according to an embodiment of this application is shown. Figure 1 As shown, the method includes:

[0050] S101, obtain the initial IoT system architecture, kernel code package, and application code package.

[0051] In related technologies, most modern IoT systems distinguish between separate kernel code packages and upper-layer application packages. The proper functioning of these separate application and kernel packages depends on the system call mechanism. An IoT system is a program that manages computer hardware and software resources. Applications are programs that run on the IoT system, operating in user space. The kernel provides a set of interfaces for user processes to interact with the kernel. Based on the CPU architecture, these interfaces access kernel resources through system calls.

[0052] Furthermore, from the perspective of CPU architecture, system calls rely on system call instructions provided by the architecture to generate system function call requests. When an application runs in user mode, the IoT system restricts the application's ability to directly access hardware. Through the system call functions provided above, system call instructions are used in user space to trap into kernel space, allowing the kernel to indirectly and securely access hardware resources. This distinguishes between kernel mode and user mode.

[0053] The process of a system call consists of four steps: First, the user program's data value is stored in a register; second, the user program executes the system call instruction; third, the CPU generates an exception, switches to kernel mode, saves the current context, and jumps to the specified memory location; finally, the kernel processes the system call task, restores the context, and returns the result.

[0054] Understandably, the drawback of separating application and kernel programs and accessing them via system calls is the significant system overhead, requiring constant failover, context saving, and context restoration. Currently, many open-source IoT systems do not support system calls, nor do they support separating application and kernel programs.

[0055] S102, in the initial IoT system architecture, the kernel code package is allocated to the first address field, and the application code package is allocated to the second address field, to obtain the target IoT system.

[0056] S103 establishes interface functions between the kernel code package and the application code package, and runs the target IoT system.

[0057] In one approach, this application allows the application program and the kernel program in the Internet of Things system to run simultaneously, with different address fields allocated to them. That is, the memory space where the kernel runs and the memory space where the application runs are their respective separate address space ranges.

[0058] This application may also include an application interface switching method implemented in the kernel space of an IoT system architecture. This method is implemented through interface functions between kernel code packages and application code packages. Specifically, it is used to implement parameter passing for the application interface and access to the kernel address space.

[0059] In one approach, the application programming interface (API) switching method implemented in kernel space can be defined as an API switching function with fixed parameters and a global service table `g_service_table` in the public address space. The first parameter of the switching function specifies the number of arguments to be passed, and this number defines the number of parameters to be passed. When the application calls the API function, the parameters are saved through the switching function; then, the number of arguments and the parameter data are passed into the kernel through the global service table `g_service_table`.

[0060] The aforementioned global service table `g_service_table` in the public address space is defined as an array used to store the addresses of all application programming interface entity functions implemented by the kernel. Its specific contents are as follows:

[0061] Thread creation, execution, destruction, delay, CPU binding, status acquisition, etc.;

[0062] The interface functions for inter-thread communication specifically include the following: mutex creation, acquisition, release, and deletion; semaphore creation, acquisition, release, and deletion; and event creation, deletion, triggering, and handling.

[0063] Memory allocation and deallocation;

[0064] File system access interface functions.

[0065] Furthermore, after creating the global service table for the public address space, this application can also store the global service table for the public address space in the memory address field of the kernel program.

[0066] Specifically, in this embodiment of the application, a segment of address can be designated in the first address field of the kernel code program to link the contents of this segment (i.e., the address used to store the global service table fields). During the kernel compilation process, the contents of the global service table g_service_table can be linked according to the designated address. In addition, the IoT system can also record the start position g_service_table_start and the end position g_service_table_end of this link address.

[0067] In another approach, embodiments of this application may also allocate a portion of physical addresses SERVICE_TABLE_ADDRESS based on the layout of the physical memory regions where the kernel program runs, for storing the global service table during subsequent system initialization.

[0068] Furthermore, this application may also include planning and distribution units for partitioning the application's address space. In this application, the application's runtime space is a physical memory region separate from the kernel's runtime address space. Therefore, the compilation and linking of the application and kernel programs are also performed independently.

[0069] In one approach, this application can predefine the application's entry address. That is, when planning the link address distribution in `link_userspace.lds`, the starting address of the application's execution, `userspace`, is set as the application's entry point. Then, the link layout is performed according to the code segment, data segment, and BSS segment. The application's entry point, `userspace`, is defined as a structure, specifically containing the following:

[0070] The application's main entry point, us_entrypoint, is used to store the address of the main entry point.

[0071] The application exit point us_taskquit stores the address of the garbage collection function UserTaskQuit when an application thread exits.

[0072] The application code segment begins at address us_textstart;

[0073] The application code segment ends at address us_textend;

[0074] The application data segment is located at the starting address us_datasource in flash memory;

[0075] The starting address of the application data segment in memory is us_datastart;

[0076] The end address of the application data segment in memory is us_dataend;

[0077] The application's BSS starting address is us_bssstart;

[0078] The application's BSS starting address is us_bssend;

[0079] Furthermore, after establishing the interface functions between the kernel code package and the application code package and running the target IoT system, this application also requires an initialization unit for the application space. The specific initialization process is as follows:

[0080] Clear the application space bss segment to zero, that is, clear the address from us_bssstart to the address us_bssend;

[0081] Copy the application data segment, copying the contents of the us_datasource address to the memory address space from us_datastart to us_dataend;

[0082] Copy the contents of the kernel service table, specifically the contents of the address space from g_service_table_start to g_service_table_end, to SERVICE_TABLE_ADDRESS.

[0083] The kernel creates the application's entry point, the main thread, and passes the thread entry point, us_entrypoint, during creation.

[0084] S104: When the target IoT system processes business, it transmits resource data from the kernel code program to the application program through interface functions.

[0085] It should also be noted that this application requires the establishment of a set of predefined programming interface functions required by the application in the kernel code program of the IoT system, as well as the entry point for the application to run. The IoT system kernel code program needs to call the application interface programming method unit of the first module, the global service table storage unit of the second module, and the application initialization unit of the fourth module, including the following three steps:

[0086] Step one: The kernel code program defines the application programming interface and the global service table g_service_table, and determines the corresponding parameter types and quantities according to the programming interface required by the application. The application programming interface switching method unit can pass parameters to the kernel service table layer and call the function entities defined in the service table to perform resource creation and access in the kernel code program.

[0087] Step 2: The IoT system calls the global service table storage unit, defines a link address in the code segment of the kernel code program compilation and linking script link.lds and reserves it for the global service table, and determines the specific address of the table according to the specific memory address information;

[0088] Step 3: During the startup process of the IoT system, it is necessary to call the application space initialization unit to provide the environment and entry point for application startup.

[0089] On the other hand, the application space in this application needs to call the application address space planning and distribution unit, first define the entry structure of the application, and link the structure to the beginning of the application address memory space. The application memory address is divided according to the specific CPU memory address.

[0090] This application provides a method to obtain an initial IoT system architecture, a kernel code package, and an application code package. Within the initial IoT system architecture, the kernel code package is assigned to a first address field, and the application code package is assigned to a second address field, resulting in a target IoT system. An interface function is established between the kernel code package and the application code package, and the target IoT system is run. When the target IoT system processes business logic, resource data from the kernel code package is transmitted to the application program through the interface function. By applying the technical solution of this application, different address fields can be assigned to the kernel package and the application package in the IoT system architecture, and a connection interface can be established to achieve their respective operational purposes. This provides a method for decoupling the kernel package and the application package in the IoT system architecture, thereby avoiding the problem of low coding efficiency caused by the mixed compilation of the kernel package and the application package in the existing IoT system.

[0091] Optionally, in one possible implementation of this application, allocating the kernel code package in the first address field in the initial IoT system architecture includes:

[0092] In the initial IoT system architecture, the kernel space code is allocated to the first Flash address field, and the kernel program code is allocated to the first SRAM memory address field.

[0093] Optionally, in one possible implementation of this application, after allocating the kernel space code to the first Flash address field in the initial IoT system architecture, the method further includes:

[0094] Obtain the global service table field and allocate the global service table field in the first Flash address field. The global service table field is used to define the addresses of all application programming interface entity functions implemented by the kernel code program.

[0095] Optionally, in one possible implementation of this application, allocating the global service table field in the first Flash address field includes:

[0096] Divide the first Flash address field into a first sub-Flash address field;

[0097] The link address corresponding to the global service table field is stored in the first sub-Flash address field, and the start field bit and end field bit corresponding to the first sub-Flash address field are recorded.

[0098] Optionally, in one possible implementation of this application, assigning the application code package to the second address field in the initial IoT system architecture includes:

[0099] In the initial IoT system architecture, the application space code is allocated to the second Flash address field, and the application code program is allocated to the second SRAM memory address field.

[0100] Optionally, in one possible implementation of this application, after allocating the application code package to the second address field in the initial IoT system architecture, the method further includes:

[0101] The application code program's BSS segment is cleared, and the global service table is copied to the starting address of the kernel SRAM memory;

[0102] The application code program is initialized, and the application thread program is created and run according to the application code program.

[0103] In one approach, such as Figure 2As shown, the IoT system proposed in this application can be a development board based on the STM32F4DiscoveryARM 32-bit architecture. The flash address size of the development board is 1MB, the address space is 0x08000000 to 0x08100000, the SRAM address size is 192KB, of which 128KB of memory address ranges from 0x20000000 to 0x20020000, and 64KB of memory address ranges from 0x10000000 to 0x10010000.

[0104] Furthermore, this application may initially include four decoupling modules, including a first module, a second module, a third module, and a fourth module.

[0105] The first module can be used to provide parameter parsing and transmission for application interfaces, and to create resource data by the kernel through a switching method.

[0106] In addition, this application requires pre-planning of memory usage space for the IoT system, planning reasonable flash address ranges and memory address ranges for the kernel and application programs, and ensuring a one-to-one correspondence between the second module and the third module. The specific steps are as follows:

[0107] Step one involves configuring the development board's memory layout using the second module. This includes allocating 512KB of flash memory (0x08000000 to 0x08080000) to the kernel space code within the kernel code package, and allocating 128KB of SRAM memory (0x20000000 to 0x20020000) to the kernel program code. Additionally, the subsequent copy memory address of the global service table (SERVICE_TABLE_ADDRESS) can be defined as the starting address of the SRAM (0x20000000).

[0108] Step two: In the application address space planning and distribution unit of the third module, according to the memory distribution of the development board, 512KB of flash address 0x08080000 to 0x081000000 is allocated to the application space code, and 64KB of SRAM memory address 0x10000000 to 0x10010000 is allocated to the application code program.

[0109] Understandable, such as Figure 3 As shown, after the above two steps, the kernel code package and the application code package are written into their respective linker scripts, and the memory address space is planned.

[0110] Furthermore, the fourth module can be used for initialization. The specific steps are as follows: first, the application's BSS segment needs to be zeroed; then the application's data segment needs to be copied; the global service table needs to be copied to the starting address of the kernel's SRAM memory; and after initializing the application's memory space, the target IoT system can be run, thus beginning the creation and execution of the first application thread program. Subsequent application development can be performed within the application code, using the application programming interface provided by the kernel.

[0111] By applying the technical solution of this application, different address fields can be assigned to the kernel package and application package respectively in the IoT system architecture, and connection interfaces can be established to achieve their respective operational purposes. This provides a method for decoupling the kernel package and application package in the IoT system architecture, thereby avoiding the problem of low coding efficiency caused by the mixed compilation of kernel packages and application packages in existing IoT systems.

[0112] In another embodiment of this application, such as Figure 4 As shown, this application also provides an operating device for an Internet of Things (IoT) system. It includes:

[0113] Module 201 is configured to acquire the initial IoT system architecture, kernel code package, and application code package.

[0114] Configuration module 202 is configured to allocate the kernel code package to the first address field and the application code package to the second address field in the initial IoT system architecture to obtain the target IoT system;

[0115] The runtime module 203 is configured to establish interface functions between the kernel code package and the application code package, and to run the target IoT system;

[0116] The processing module 204 is configured to transmit resource data in the kernel code program to the application program through the interface when the target IoT system processes business.

[0117] In this application, an initial IoT system architecture, a kernel code package, and an application code package can be obtained; in the initial IoT system architecture, the kernel code package is allocated to the first address field, and the application code package is allocated to the second address field to obtain the target IoT system; an interface function between the kernel code package and the application code package is established, and the target IoT system is run; when the target IoT system processes business, the resource data in the kernel code package is transmitted to the application through the interface function.

[0118] In another embodiment of this application, the acquisition module 201 further includes:

[0119] The acquisition module 201 is configured to allocate the kernel space code to the first Flash address field and the kernel program code to the first SRAM memory address field in the initial IoT system architecture.

[0120] In another embodiment of this application, the acquisition module 201 further includes:

[0121] The acquisition module 201 is configured to acquire a global service table field and allocate the global service table field in the first Flash address field. The global service table field is used to define the addresses of all application programming interface entity functions implemented by the kernel code program.

[0122] In another embodiment of this application, the acquisition module 201 further includes:

[0123] The acquisition module 201 is configured to divide the first sub-Flash address field from the first Flash address field;

[0124] The acquisition module 201 is configured to store the link address corresponding to the global service table field in the first sub-Flash address field, and record the start field bit and end field bit corresponding to the first sub-Flash address field.

[0125] In another embodiment of this application, the acquisition module 201 further includes:

[0126] The acquisition module 201 is configured to allocate the application space code to a second Flash address field and allocate the application code program to a second SRAM memory address field in the initial IoT system architecture.

[0127] In another embodiment of this application, the acquisition module 201 further includes:

[0128] The acquisition module 201 is configured to clear the BSS segment of the application code program and copy the global service table to the starting address of the kernel SRAM memory.

[0129] The acquisition module 201 is configured to initialize the application code program and start the creation and execution of the application thread program based on the application code program.

[0130] Figure 5This is a logical structure block diagram of an electronic device according to an exemplary embodiment. For example, the electronic device 300 may be a mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, medical device, fitness equipment, personal digital assistant, etc.

[0131] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory including instructions. These instructions can be executed by a processor of an electronic device to complete the operation method of the aforementioned Internet of Things (IoT) system. The method includes: obtaining an initial IoT system architecture, a kernel code package, and an application code package; allocating the kernel code package to a first address field and the application code package to a second address field in the initial IoT system architecture to obtain a target IoT system; establishing an interface function between the kernel code package and the application code package, and running the target IoT system; and when the target IoT system processes services, transmitting resource data from the kernel code package to the application program through the interface. Optionally, the instructions can also be executed by a processor of an electronic device to complete other steps involved in the exemplary embodiment. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0132] In an exemplary embodiment, an application / computer program product is also provided, including one or more instructions that can be executed by a processor of an electronic device to complete the above-described method for operating an IoT system. The method includes: obtaining an initial IoT system architecture, a kernel code package, and an application code package; allocating the kernel code package to a first address field and the application code package to a second address field in the initial IoT system architecture to obtain a target IoT system; establishing an interface function between the kernel code package and the application code package, and running the target IoT system; and when the target IoT system processes services, transmitting resource data from the kernel code package to the application program through the interface. Optionally, the above instructions can also be executed by a processor of an electronic device to complete other steps involved in the above exemplary embodiment.

[0133] Figure 5 This is an example diagram of an electronic device 300. Those skilled in the art will understand that it is illustrative. Figure 5 This is merely an example of electronic device 300 and does not constitute a limitation on electronic device 300. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 300 may also include input / output devices, network access devices, buses, etc.

[0134] The processor 302 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or processor 302 can be any conventional processor. Processor 302 is the control center of electronic device 300, connecting all parts of electronic device 300 via various interfaces and lines.

[0135] The memory 301 can be used to store computer-readable instructions. The processor 302 implements various functions of the electronic device 300 by running or executing the computer-readable instructions or modules stored in the memory 301 and by calling the data stored in the memory 301. The memory 301 may mainly include a program storage area and a data storage area. The program storage area may store the Internet of Things system, the application program required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device 300, etc. In addition, the memory 301 may include a hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, read-only memory (ROM), random access memory (RAM), or other non-volatile / volatile storage devices.

[0136] If the modules integrated in the electronic device 300 are implemented as software functional modules 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 instructing related hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when executed by a processor, the computer-readable instructions can implement the steps of the various method embodiments described above.

[0137] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0138] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for operating an Internet of Things (IoT) system, characterized in that, include: Obtain the initial IoT system architecture, kernel code package, and application code package; In the initial IoT system architecture, the kernel code package is allocated to the first address field, and the application code package is allocated to the second address field to obtain the target IoT system; wherein, the memory space where the kernel runs and the memory space where the application runs are their respective separate address space ranges; Establish interface functions between the kernel code package and the application code package, and run the target IoT system; When the target IoT system processes business, it transmits the resource data in the kernel code program to the application through the interface; When the application calls an application programming interface (API) function, the parameters are saved through an interface switching function; the number of parameters and the parameter entities of the interface switching function are passed into the kernel through the global service table of the public address space; the global service table of the public address space is used to define the addresses of all API entity functions implemented by the kernel code program; When planning the link distribution address of the application, the starting address of the application is set as the entry point of the application, and the link layout is carried out according to the code segment, data segment, and BSS segment; the BSS segment of the application code program is cleared, and the global service table is copied to the starting address of the kernel SRAM memory; the application code program is initialized, and the application thread program is created and run according to the application code program.

2. The method as described in claim 1, characterized in that, The step of allocating the kernel code package in the first address field in the initial IoT system architecture includes: In the initial IoT system architecture, the kernel space code is allocated to the first Flash address field, and the kernel code program is allocated to the first SRAM memory address field.

3. The method as described in claim 2, characterized in that, After allocating the kernel space code to the first Flash address field in the initial IoT system architecture, the system further includes: Obtain the global service table fields and assign the global service table fields to the first Flash address field.

4. The method as described in claim 3, characterized in that, The step of allocating the global service table field to the first Flash address field includes: Divide the first Flash address field into a first sub-Flash address field; The link address corresponding to the global service table field is stored in the first sub-Flash address field, and the start field bit and end field bit corresponding to the first sub-Flash address field are recorded.

5. The method as described in claim 1 or 2, characterized in that, The step of allocating the application code package in the second address field in the initial IoT system architecture includes: In the initial IoT system architecture, the application space code is allocated to the second Flash address field, and the application code program is allocated to the second SRAM memory address field.

6. An operating device for an Internet of Things (IoT) system, characterized in that, include: The acquisition module is configured to acquire the initial IoT system architecture, kernel code package, and application code package. The configuration module is configured to allocate the kernel code package to the first address field and the application code package to the second address field in the initial IoT system architecture to obtain the target IoT system; wherein the memory space for kernel execution and the memory space for application execution are their respective separate address space ranges. The runtime module is configured to establish interface functions between the kernel code package and the application code package, and to run the target IoT system; The processing module is configured to transmit resource data from the kernel code program to the application program through the interface when the target IoT system processes business. When the application calls an application programming interface (API) function, the parameters are saved through an interface switching function; the number of parameters and the parameter entities of the interface switching function are passed into the kernel through the global service table of the public address space; the global service table of the public address space is used to define the addresses of all API entity functions implemented by the kernel code program; When planning the link distribution address of the application, the starting address of the application is set as the entry point of the application, and the link layout is carried out according to the code segment, data segment, and BSS segment; the BSS segment of the application code program is cleared, and the global service table is copied to the starting address of the kernel SRAM memory; the application code program is initialized, and the application thread program is created and run according to the application code program.

7. An electronic device, characterized in that, include: Memory, used to store executable instructions; as well as, A processor, configured to execute the executable instructions with the memory to perform the operation of the method of operating the Internet of Things system according to any one of claims 1-5.

8. A computer-readable storage medium for storing computer-readable instructions, characterized in that, When the instruction is executed, it performs the operation of the operating method of any of the IoT systems described in claims 1-5.

Citation Information

Patent Citations

  • Compiling and deploying method, compiling method and compiling system of embedded system

    CN110990018A

  • A method for realizing residence of a real-time operating system under an embedded architecture

    CN112416443A