WO2017124637A1 - 一种智能终端的程序流式执行方法 - Google Patents
一种智能终端的程序流式执行方法 Download PDFInfo
- Publication number
- WO2017124637A1 WO2017124637A1 PCT/CN2016/077608 CN2016077608W WO2017124637A1 WO 2017124637 A1 WO2017124637 A1 WO 2017124637A1 CN 2016077608 W CN2016077608 W CN 2016077608W WO 2017124637 A1 WO2017124637 A1 WO 2017124637A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- program
- data
- smart terminal
- segment
- server
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
- G06F8/654—Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5016—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/547—Remote procedure calls [RPC]; Web services
Definitions
- the present invention relates to the field of software execution, and in particular, to a program stream execution method of an intelligent terminal.
- the intelligent terminal usually includes one or more low-power CPU/MCU (Central Processing Unit, Micro Control Unit), memory and peripheral devices.
- the CPU/MCU is the firmware software that is primarily responsible for running the operating system or device.
- Smart terminals are usually equipped with a few thousand or several megabytes of flash memory and a few kilobytes of memory (RAM).
- RAM random Access Memory
- resource data such as pictures and fonts are usually stored in flash memory to reduce the memory dependency of the operating system or application.
- the user implements a certain function of the smart terminal by loading an operating system or an application program on the smart terminal.
- the user In order to more fully implement the application function of the smart terminal, the user often needs to install many different applications on the smart terminal. And also need to update the operating system and applications from time to time.
- the operating system of the smart terminal is often stored in the flash memory in the form of firmware.
- To upgrade the operating system it is often necessary to download the entire operating system upgrade package through a third-party program module, and erase the entire flash memory.
- the data content, and then the new operating system upgrade package is written to the flash memory, such as the over-the-air technology (OTA) in the prior art.
- OTA over-the-air technology
- the technical problem to be solved by the present invention is that, in view of the technical problems existing in the prior art, the present invention provides a The utility model can effectively improve the expandability of the smart terminal, conveniently acquire a new operating system and an application program, and can reduce the hardware requirements of the application program for the intelligent terminal, and implement the program flow execution method for the application program to effectively execute the intelligent terminal in the intelligent terminal.
- the technical solution proposed by the present invention is: a program flow execution method of an intelligent terminal, the smart terminal does not store the program package of the program before the program is executed; the program package of the program is provided by the server Storage and management, according to the ELF file standard, the package includes a code segment (.code segment), a read-only data segment (.constdata segment), an uninitialized data segment (.bss segment), and a readable/writable data segment (. Data segment);
- the smart terminal acquires a program execution instruction, downloads an uninitialized data segment and a readable/writable data segment, and a code segment of the package from a server side, and loads the file into a local storage space, and starts program execution, during execution, According to the calling request of the program for the code segment and the read-only data segment data, the intelligent terminal downloads the requested code segment and the read-only data segment data from the server, and loads the data into the local storage space for the program to call.
- the uninitialized data segment and the readable/writable data segment are downloaded from the server and loaded into the memory of the smart terminal; the code segment and the read-only data segment are downloaded from the server and loaded into the smart device.
- the flash memory of the terminal is
- the code segment, the read-only data segment, the uninitialized data segment, and the readable/writable data segment of the package are downloaded from the server and loaded into the memory of the smart terminal.
- the method before the smart terminal downloads the executable file from the server, the method further includes the step of the smart terminal allocates a local storage space for the program, where the local storage space that is idle by the smart terminal is smaller than the program execution center.
- the execution of the program is terminated, and the resources occupied by the program are released, otherwise the intelligent terminal allocates local storage space for the program.
- the smart terminal downloads only the uninitialized data segment and the readable/writable data segment of the executable file, and downloads the code from the server according to a preset blocking method. The first part of the paragraph.
- the program when the program proposes a call request for the code segment and the read-only data segment data, it is determined whether the requested data is stored in the local storage space, and the data in the local storage space is directly used for the program call. Otherwise, the smart terminal downloads the requested data from the server and loads it into the local storage space for the program to call.
- the smart terminal loading the code segment data of the executable file into the local storage space further includes the step of relocating: the smart terminal is readable according to the code segment function unit, the uninitialized data segment memory unit, and the readable unit / Write the absolute address of the data segment memory unit, and modify the relative phase address in the code segment unit to an absolute address.
- the smart terminal determines whether the data requested by the program is stored in the local storage space according to the mapping metadata table.
- the mapping metadata table includes a physical address, a file code, and a file offset; each piece of data of the mapping metadata table corresponds to one piece of data of the local storage space.
- the smart terminal manages data downloaded to the server by transmitting a list; the smart terminal determines whether data requested to be downloaded from the server is recorded in the transmission list, and is no longer directed to the server. A download application is filed, and the data download is completed. Otherwise, the data download application is submitted to the server, and the data is added to the transfer list, and the data is downloaded from the server.
- the present invention has the advantages that the invention can effectively improve the expandability of the smart terminal, conveniently acquire a new operating system and an application program, and reduce the hardware requirements of the application program for the smart terminal, especially the application program.
- the need for flash space and memory space enables applications to run efficiently on smart terminals with only small flash space and memory space.
- FIG. 1 is a schematic structural diagram of hardware of an intelligent terminal according to an embodiment of the present invention.
- FIG. 2 is a schematic diagram of deployment of a server software according to an embodiment of the present invention.
- FIG. 3 is a schematic flowchart of an embodiment of the present invention.
- FIG. 4 is a schematic diagram of a data downloading process according to an embodiment of the present invention.
- FIG. 5 is a schematic diagram of storage space division and storage according to an embodiment of the present invention.
- FIG. 6 is a schematic diagram of relocation according to an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a mapping metadata table according to an embodiment of the present invention.
- a program flow execution method of an intelligent terminal does not store a program package before the program is executed; the program package is stored and managed by the server, and the package includes a code segment according to the ELF file standard ( .code segment), read-only data segment (.constdata segment), uninitialized data segment (.bss segment), and readable/writable data segment (.data segment); intelligent terminal acquires program execution instruction, downloads package from server side The uninitialized data segment and the readable/writable data segment, and the code segment, and loaded into the local storage space, start the program execution, in the execution process, according to the program call request for the code segment, the read-only data segment data, the intelligent terminal Download the requested code segment, read-only data segment data from the server, and load it into the local storage space for the program to call.
- it is required to run an operating system on the smart terminal as a program.
- the hardware structure of the smart terminal is as shown in FIG. 1 , including a low power CPU, a storage module, a communication module, and a peripheral device.
- the storage module includes a flash memory and a memory
- the communication module includes a Bluetooth module and a Wifi (wireless transmission).
- the module, the GPRS (General Packet Radio Service) module, etc., the communication module may be one or more of the peripheral devices, including but not limited to GPS (Global Positioning System) positioning device, gyroscope, gravity sensing device, etc.
- the peripheral device may be One or more of them.
- Intelligent terminals include, but are not limited to, smart portable devices such as smart watches and smart bracelets or smart wearable devices.
- the server stores a package of a program that the smart terminal needs to run.
- the software deployment structure of the server is shown in Figure 2, including the server operating system, storage management, application management, and user interface.
- the server operating system can be a general-purpose operation for each household, such as a Windows operating system, a Linux operating system, or the like, or an Android operating system or an iOS operating system running on a handheld device.
- Storage management is responsible for managing the data stored locally on the server.
- Application management is responsible for managing applications running on smart terminals.
- the user interface is responsible for handling the interaction between the user and the server.
- the server can be a server, a PC, a laptop, a tablet or a smartphone.
- the flow execution process of the program of the present invention is specifically described by taking "Program A” as an example.
- the user selects “Program A” to start the operation, and sends a "Program A” execution instruction to the smart terminal operating system, and the user can select to send "Program A” to be started on the user operation interface of the intelligent terminal.
- Execution of the instruction can also send an execution instruction to the intelligent terminal through the network by selecting "Program A" to be started on the server side.
- the intelligent terminal acquires the execution instruction of "Program A", and estimates the required storage space size for "Program A”. When the free storage space size of the intelligent terminal is smaller than the estimated storage space size, the execution of the program is terminated, and the release program is occupied. Resources, otherwise the smart terminal allocates local storage space for the program.
- This storage space includes the storage space of the flash memory and the storage space in the memory.
- the intelligent terminal allocates a code segment storage area, a read-only data segment storage area, an uninitialized data segment storage area, and a readable/writable data segment storage area for "program A" in the flash memory, and allocates an uninitialized data segment storage area in the memory.
- the code segment storage is divided into a function unit and a unit, which are respectively used to store the function code and the control flow of the code segment. As shown in FIG. 5, the left picture shows the state before "Program A” is loaded into the storage space, and the right picture shows the state after "Program A” is loaded into the storage space.
- the uninitialized data segment storage area and the readable/writable data segment storage area may not be allocated in the flash memory, and the uninitialized data segment and the readable/writable data segment downloaded from the server are directly stored to the smart terminal.
- the smart terminal allocates a storage space for "Program A”, downloads the first part of the code segment from the server, and the complete uninitialized data segment and the readable/writable data segment according to a preset blocking method.
- the preset blocker The method can be divided according to the code rules of the code segment, such as according to functions and processes.
- the first portion of the code segment is simply the entry function portion of "Program A.”
- the first part can also be the first part of the other blocking method, or even the entire code segment.
- the intelligent terminal requests and downloads the complete uninitialized data segment and the readable/writable data segment, and the necessary code segments to the server, and loads the data into the local storage space.
- the necessary code segment is the code segment.
- the download is unsuccessful, the execution of "Program A" is ended and the storage space is released.
- Including transferring the uninitialized data segment and the readable/writable data segment stored in the flash memory into the memory, and the right image in FIG. 5 is the storage state after the uninitialized data segment and the readable/writable data segment are transferred to the memory, and Relocate the code snippet.
- the process of relocating is: collecting the physical address of the code segment storage area function unit, and modifying the relative address of the control flow function in the code segment storage area unit according to the physical address, and collecting the uninitialized data segment storage area. And reading and writing the physical address of the memory unit of the data segment storage area, and modifying the relative address of the control flow read/write instruction in the code segment storage area unit according to the physical address.
- the right picture of Figure 5 shows the storage state before relocation, the code segment unit stores the relative addresses
- Figure 6 shows the relocated storage state, and the relatives in the code segment storage area unit.
- the address is modified to the actual physical address, that is, the absolute address, according to the actual storage state.
- the execution of the program is started according to the entry function of "Program A".
- the smart terminal when the program starts, the smart terminal only needs to download part of the data of the package, and does not need to download the entire package, which greatly shortens the time for the program to wait for download, the startup speed is fast, and the storage space for the flash memory and the memory is low. .
- the smart terminal loads only the uninitialized data segment of "Program A” and the readable/writable data segment, and the first part of the code segment before "Program A” starts execution, therefore, in the "program During the execution of A", if the function accessed by the CPU is not loaded into the function segment of the code segment storage area, a data call request of the code segment will be issued, and the intelligent terminal will download the requested code segment from the server and store it in the flash memory. The code segment is stored in the memory area and relocated for CPU call.
- the smart terminal determines, by mapping the metadata table, whether the data accessed by the CPU is stored in the local flash memory, where the mapping metadata table includes a physical address, a file code, and a file offset;
- the mapping metadata table is sorted according to the physical address of the flash memory, and each piece of data corresponds to one piece of data of the local storage space.
- the CPU proposes a data access request, it includes a file code and a file offset of the file where the requested data is located.
- the mapping metadata table it can be determined whether the requested data is stored in the flash memory, and the data is directly supplied to the CPU. Access, otherwise, request the download from the server through the file code and file offset. Because the contents of the mapping metadata table need to be stored for a long time, the mapping metadata table is stored in the flash memory, and of course can also be stored in the memory and periodically refreshed to the flash memory or the server.
- the smart terminal when the data accessed by the CPU is not in the local flash memory, the smart terminal needs to apply for downloading data to the server.
- the intelligent terminal determines whether the data requested to be downloaded from the server is recorded in the transmission list, and then no longer requests the download from the server, waiting for the data to be downloaded, otherwise the data is sent to the server through the file code and file offset of the accessed data. Download the application and add the data to the transfer list to download the data from the server.
- the intelligent terminal waits for the data download to be completed, and the downloaded data is called by the CPU for access.
- the smart terminal when the execution of the program ends, the smart terminal will uninstall the program and release the occupied memory space and flash memory space.
- the smart terminal of the present invention does not store the application itself, but only needs to flow from the server to the local storage space and run according to the calling requirement when the application needs to be run.
- the intelligent terminal can use the program resources of the server almost unlimitedly, and the expandability of the smart terminal is greatly improved, the intelligent terminal can conveniently acquire a new operating system and an application program, and can reduce the application program to the intelligent terminal.
- Hardware requirements, especially the application's need for flash space and memory space, enable applications to run efficiently on smart devices with only small flash space and memory space.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
一种智能终端的程序流式执行方法,智能终端在程序执行前不存储所述程序的程序包;所述程序的程序包由服务端存储和管理,根据ELF文件标准,程序包包括代码段、只读数据段、未初始化数据段和可读/写数据段;智能终端获取程序执行指令,从服务端下载程序包的未初始化数据段和可读/写数据段,和代码段,并加载至本地存储空间,启动程序执行,在执行过程中,根据程序对代码段、只读数据段数据的调用请求,智能终端从服务端下载所请求的代码段、只读数据段数据,并加载至本地存储空间,供所述程序调用。该方法具有有效提高智能终端的扩展性,降低对硬件要求,实现应用程序在仅有较小闪存空间和内存空间的智能终端有效运行等优点。
Description
本发明涉及一种软件执行领域,尤其涉及一种智能终端的程序流式执行方法。
随着技术的不断进步,智能终端从手持设备到通用的可穿戴式设备也在不断发展。智能终端通常包括一个或多个低功耗CPU/MCU(Central Processing Unit,中央处理器/Micro Control Unit,微控单元),内存及周边设备。CPU/MCU是主要负责运行操作系统或设备的固件软件。智能终端通常配备有一个几千或几兆字节的闪存和一个几千字节的内存(RAM),在一般情况下,正在运行的操作系统或应用程序的变量必须存储在内存(RAM,Random Access Memory,随机存取存储器)中,而如图片、字体等资源数据通常存储在闪存中,以降低操作系统或应用程序对内存的依赖。
用户通过在智能终端加载操作系统或应用程序来实现智能终端某一功能上的应用,为了更多更好的实现智能终端的应用功能,用户往往需要在智能终端上安装许多个不同的应用程序,并且还需要不定时的更新操作系统和应用程序。而在现有技术中,智能终端的操作系统往往是以固件形式存储在闪存中,对操作系统的升级,往往需要通过第三方的程序模块,下载整个操作系统升级包,并擦除整个闪存中的数据内容,再将新的操作系统升级包写入到闪存中,如现有技术中的空间下载技术(OTA,Over-the-Air Technology)。虽然升级整个系统和应用程序可以让用户在智能终端上获得更多的服务,但升级过程可能需要很长的时间和稳定的网络。
在智能终端上存储大量的应用程序,对智能终端的存储空间具有很高的要求,随着应用程序的运行,智能终端上需要的存储空间也将会进一步增大,使智能终端变得更加臃肿。并且,随着操作系统和应用程序的功能越来越全面,操作系统和应用程序也越来越大,对智能终端的硬件设备也提出了越来越高的要求,特别是操作系统和应用程序对智能终端的内存空间的需求尤为突出。因此,一种既能够有效提高智能终端的扩展性,方便地获取新的操作系统和应用程序,又能够降低应用程序对智能终端硬件要求、实现应用程序在智能终端有效执行的方法具有显著的意义。
【发明内容】
本发明要解决的技术问题就在于:针对现有技术存在的技术问题,本发明提供一种既
能够有效提高智能终端的扩展性,方便地获取新的操作系统和应用程序,又能够降低应用程序对智能终端硬件要求、实现应用程序在智能终端有效执行智能终端的程序流式执行方法。
为解决上述技术问题,本发明提出的技术方案为:一种智能终端的程序流式执行方法,智能终端在程序执行前不存储有所述程序的程序包;所述程序的程序包由服务端存储和管理,根据ELF文件标准,所述程序包包括代码段(.code段)、只读数据段(.constdata段)、未初始化数据段(.bss段)和可读/写数据段(.data段);
所述智能终端获取程序执行指令,从服务器端下载所述程序包的未初始化数据段和可读/写数据段,和代码段,并加载至本地存储空间,启动程序执行,在执行过程中,根据程序对代码段、只读数据段数据的调用请求,智能终端从服务端下载所请求的代码段、只读数据段数据,并加载至本地存储空间,供所述程序调用。
作为本发明的进一步改进,所述未初始化数据段和可读/写数据段从服务器端下载,加载至智能终端的内存中;所述代码段、只读数据段从服务器端下载,加载至智能终端的闪存中。
作为本发明的进一步改进,所述程序包的代码段、只读数据段、未初始化数据段和可读/写数据段从服务端下载,均加载至智能终端的内存中。
作为本发明的进一步改进,在所述智能终端从服务器端下载所述可执行文件前,还包括智能终端为程序分配本地存储空间的步骤,当智能终端空闲的本地存储空间小于所述程序执行所需存储空间时,终止所述程序的执行,释放程序已占用的资源,否则智能终端为程序分配本地存储空间。
作为本发明的进一步改进,在所述启动程序执行前,智能终端仅下载所述可执行文件的未初始化数据段和可读/写数据段,以及按照预设的分块方法从服务端下载代码段的第一部分。
作为本发明的进一步改进,所述程序提出对代码段、只读数据段数据的调用请求时,判断所请求数据是否存储在本地存储空间中,是则直接将本地存储空间中的数据供程序调用,否则,智能终端从服务端下载所请求数据,并加载至本地存储空间,供程序调用。
作为本发明的进一步改进,所述智能终端将可执行文件的代码段数据加载至本地存储空间还包括重定位的步骤:所述智能终端根据代码段函数单元、未初始化数据段内存单元和可读/写数据段内存单元的绝对地址,将代码段制单元中的相对相址修改为绝对地址。
作为本发明的进一步改进,所述智能终端根据映射元数据表判断程序所请求的数据是否存储在本地存储空间。
作为本发明的进一步改进,所述映射元数据表包括物理地址、文件代码、和文件偏移;所述映射元数据表的每一条数据对应本地存储空间的一条数据。
作为本发明的进一步改进,所述智能终端通过传送列表管理向服务端下载的数据;所述智能终端判断向服务端申请下载的数据是否记载在所述传送列表中,是则不再向服务端提出下载申请,等待所述数据下载完成,否则向服务端提所述数据下载申请,将将该数据加入传送列表,从服务端下载所述数据。
与现有技术相比,本发明的优点在于:本发明能够有效提高智能终端的扩展性,方便地获取新的操作系统和应用程序,又能够降低应用程序对智能终端硬件要求,特别是应用程序对闪存空间和内存空间的需求,能够实现应用程序在仅有较小闪存空间和内存空间的智能终端有效运行。
图1为本发明实施例智能终端硬件结构示意图。
图2为本发明实施例服务端软件部署示意图。
图3为本发明实施例流程示意图。
图4为本发明实施例数据下载流程示意图。
图5为本发明实施例存储空间划分及存储示意图。
图6为本发明实施例重定位示意图。
图7为本发明实施例映射元数据表结构示意图。
以下结合说明书附图和具体优选的实施例对本发明作进一步描述,但并不因此而限制本发明的保护范围。
本实施例一种智能终端的程序流式执行方法,智能终端在程序执行前不存储有程序的程序包;程序的程序包由服务端存储和管理,根据ELF文件标准,程序包包括代码段(.code段)、只读数据段(.constdata段)、未初始化数据段(.bss段)和可读/写数据段(.data段);智能终端获取程序执行指令,从服务器端下载程序包的未初始化数据段和可读/写数据段,和代码段,并加载至本地存储空间,启动程序执行,在执行过程中,根据程序对代码段、只读数据段数据的调用请求,智能终端从服务端下载所请求的代码段、只读数据段数据,并加载至本地存储空间,供程序调用。在本实施例中,需要在智能终端上运行操作系统视为程序。
在本实施例中,智能终端的硬件结构如图1所示,包括低功率CPU、存储模块、通讯模块和外围设备,该存储模块包括闪存和内存,通讯模块包括蓝牙模块、Wifi(无线传输)
模块、GPRS(General Packet Radio Service)模块等,通讯模块可以是其中的一个或多个,外围设备包括但不限于GPS(Global Positioning System)定位设备、陀螺仪、重力感应设备等,外围设备可以是其中的一个或多个。智能终端包括但不限于智能手表、智能手环等智能便携设备或智能可穿戴设备。
在本实施例中,服务端存储有智能终端需要运行的程序的程序包。服务端的软件部署结构如图2所示,包括服务器操作系统、存储管理、应用管理和用户界面。服务器操作系统可以是通用的操作每户,如Windows操作系统、Linux操作系统等,或者是在手持设备上运行的Android操作系统或iOS操作系统。存储管理负责管理服务端本地存储的数据。应用管理负责管理在智能终端上运行的应用程序。用户界面负责处理用户和服务端之间的交互。服务端可以是服务器、PC机、便携式计算机、平板电脑或智能手机等。
在本实施例中,以“程序A”为例具体说明本发明程序的流式执行过程。如图3所示,用户选择要启动运行的“程序A”,向智能终端操作系统发送“程序A”执行指令,用户可以通过在智能终端的用户操作界面上选择要启动的“程序A”发送执行指令,也可以通过在服务端选择要启动的“程序A”,通过网络向智能终端发送执行指令。
智能终端获取“程序A”的执行指令,为“程序A”估算所需要的存储空间大小,当智能终端的空闲存储空间大小小于所估算的存储空间大小时,终止程序的执行,释放程序已占用的资源,否则智能终端为程序分配本地存储空间。该存储空间包括闪存的存储空间和内存中的存储空间。智能终端在闪存中为“程序A”分配代码段存储区、只读数据段存储区、未初始化数据段存储区和可读/写数据段存储区,并在内存为分配未初始化数据段存储区和可读/写数据段存储区,分别用来存储“程序A”的未初始化数据段和可读/写数据段。其中,代码段存储区分为函数单元和制单元,分别用来存储代码段的函数代码和控制流。如图5所示,左图为“程序A”加载至存储空间前的状态,右图为“程序A”加载至存储空间后的状态。需要说明的是,当然也可以不在闪存中分配未初始化数据段存储区和可读/写数据段存储区,直接将从服务端下载的未初始化数据段和可读/写数据段存储至智能终端在内存中所分配的未初始化数据段存储区和可读/写数据段存储区。或者,不在闪存中分配存储空间,而只在内存中为“程序A”分配代码段存储区、只读数据段存储区、未初始化数据段存储区和可读/写数据段存储区,智能终端直接将从服务端下载的代码段、只读数据段、未初始化数据段和可读/写数据段加载至内存中,当然,采用这种存储分配方式,需要占用较大的内存空间。
在本实施例中,智能终端为“程序A”分配好存储空间,按照预设的分块方法从服务端下载代码段的第一部分,以及完整的未初始化数据段和可读/写数据段。该预设的分块方
法可以是按照代码段的代码规律,如按照函数、过程进行划分分块。在本实施例中,该代码段的第一部分仅仅是“程序A”的入口函数部分。当然,该第一部分也可以是按照其它分块方法的第一部分,甚至是整个代码段。
智能终端向服务端请求并下载完整的未初始化数据段和可读/写数据段,以及必要的代码段,并加载至本地存储空间,在本实施例中,必要的代码段为代码段的第一部分,如下载不成功,则结束“程序A”的执行,并释放存储空间。包括将存储在闪存中的未初始化数据段和可读/写数据段转移至内存中,图5中的右图为未初始化数据段和可读/写数据段转移至内存后的存储状态,并对代码段进行重定位。在本实施例中,重定位的过程为:收集代码段存储区函数单元的物理地址,并根据该物理地址修改代码段存储区制单元中控制流函数的相对地址,收集未初始化数据段存储区和可读/写数据段存储区的内存单元物理地址,并根据该物理地址修改代码段存储区制单元中控制流读/写指令的相对地址。如图5和6所示,图5右图为重定位前的存储状态,代码段制单元中存储均为相对地址,图6为重定位后的存储状态,代码段存储区制单元中的相对地址按照实际存储状态修改为实际的物理地址,即绝对地址。在完成代码段重定位后,根据“程序A”的入口函数,启动该程序的执行。在本实施例中,程序启动时智能终端仅需要下载程序包的部分数据,而不需要下载整个程序包,大大缩短了程序等待下载的时间,启动速度快,对闪存和内存的存储空间要求低。
在本实施例中,由于在“程序A”启动执行前,智能终端只加载了“程序A”的未初始化数据段和可读/写数据段,以及代码段的第一部分,因此,在“程序A”的执行过程中,如果CPU访问的函数没有加载到代码段存储区的函数段,将会发出代码段的数据调用请求,智能终端将从服务端下载所请求的代码段,并存入闪存中的代码段存储区,并进行重定位,供CPU调用。如果CPU访问的只读数据段数据没有加载到只读数据段存储区,将会发出只读数据段的数据调用请求,智能终端将从服务端下载所请求的只读数据段,并存入闪存中的只读数据段存储区,供CPU调用。
在本实施例中,如图7所示,智能终端通过映射元数据表判断所CPU所访问的数据是否存储在本地闪存中,映射元数据表包括物理地址、文件代码、和文件偏移;该映射元数据表按照闪存的物理地址进行排序,每一条数据对应本地存储空间的一条数据。CPU提出数据访问请求时,包括有所请求数据所在文件的文件代码和文件偏移,通过该映射元数据表,可以判断所请求的数据时否存储在闪存中,是则直接将该数据供CPU访问,否则,通过该文件代码和文件偏移向服务端申请下载。因为映射元数据表中内容需要长期保存,映射元数据表存储在闪存中,当然也可以存储在内存中并周期性的刷新到闪存或服务端。
如图4所示,在本实施例中,当CPU所访问的数据不在本地闪存中时,智能终端需要向服务端申请下载数据。智能终端判断向服务端申请下载的数据是否记载在传送列表中,是则不再向服务端提出下载申请,等待数据下载完成,否则通过所访问数据的文件代码和文件偏移向服务端提数据下载申请,将将该数据加入传送列表,从服务端下载数据。智能终端等待数据下载完成,将所下载的数据供CPU访问调用。
在本实施例中,程序执行结束,智能终端将卸载该程序,释放所占用的内存空间和闪存空间。
本发明智能终端本身不存储应用程序,仅在需要运行应用程序时按调用需求从服务端流式的加载到本地存储空间,进行运行。通过本发明的方法,智能终端几乎可以无限制的使用服务端的程序资源,大大提高了智能终端的扩展性,智能终端能够方便地获取新的操作系统和应用程序,又能够降低应用程序对智能终端硬件要求,特别是应用程序对闪存空间和内存空间的需求,能够实现应用程序在仅有较小闪存空间和内存空间的智能终端有效运行。
上述只是本发明的较佳实施例,并非对本发明作任何形式上的限制。虽然本发明已以较佳实施例揭露如上,然而并非用以限定本发明。因此,凡是未脱离本发明技术方案的内容,依据本发明技术实质对以上实施例所做的任何简单修改、等同变化及修饰,均应落在本发明技术方案保护的范围内。
Claims (10)
- 一种智能终端的程序流式执行方法,其特征在于:智能终端在程序执行前不存储有所述程序的程序包;所述程序的程序包由服务端存储和管理,根据ELF文件标准,所述程序包包括代码段、只读数据段、未初始化数据段和可读/写数据段;所述智能终端获取程序执行指令,从服务器端下载所述程序包的未初始化数据段和可读/写数据段,和代码段,并加载至本地存储空间,启动程序执行,在执行过程中,根据程序对代码段、只读数据段数据的调用请求,智能终端从服务端下载所请求的代码段、只读数据段数据,并加载至本地存储空间,供所述程序调用。
- 根据权利要求1所述的智能终端的程序流式执行方法,其特征在于:所述未初始化数据段和可读/写数据段从服务器端下载,加载至智能终端的内存中;所述代码段、只读数据段从服务器端下载,加载至智能终端的闪存中。
- 根据权利要求1所述的智能终端的程序流式执行方法,其特征在于:所述程序包的代码段、只读数据段、未初始化数据段和可读/写数据段从服务端下载,均加载至智能终端的内存中。
- 根据权利要求2或3所述的智能终端的程序流式执行方法,其特征在于:在所述智能终端从服务器端下载所述可执行文件前,还包括智能终端为程序分配本地存储空间的步骤,当智能终端空闲的本地存储空间小于所述程序执行所需存储空间时,终止所述程序的执行,释放程序已占用的资源,否则智能终端为程序分配本地存储空间。
- 根据权利要求4所述的智能终端的程序流式执行方法,其特征在于:在所述启动程序执行前,智能终端仅下载所述可执行文件的未初始化数据段和可读/写数据段,以及按照预设的分块方法从服务端下载代码段的第一部分。
- 根据权利要求5所述的智能终端的程序流式执行方法,其特征在于:所述程序提出对代码段、只读数据段数据的调用请求时,判断所请求数据是否存储在本地存储空间中,是则直接将本地存储空间中的数据供程序调用,否则,智能终端从服务端下载所请求数据,并加载至本地存储空间,供程序调用。
- 根据权利要求6所述的智能终端的程序流式执行方法,其特征在于,所述智能终端将可执行文件的代码段数据加载至本地存储空间还包括重定位的步骤:所述智能终端根据代码段函数单元、未初始化数据段内存单元和可读/写数据段内存单元的绝对地址,将代码段制单元中的相对相址修改为绝对地址。
- 根据权利要求7所述的智能终端的程序流式执行方法,其特征在于:所述智能终端根据映射元数据表判断程序所请求的数据是否存储在本地存储空间。
- 根据权利要求8所述的智能终端的程序流式执行方法,其特征在于:所述映射元数据表包括物理地址、文件代码、和文件偏移;所述映射元数据表的每一条数据对应本地存储空间的一条数据。
- 根据权利要求9所述的智能终端的程序流式执行方法,其特征在于:所述智能终端通过传送列表管理向服务端下载的数据;所述智能终端判断向服务端申请下载的数据是否记载在所述传送列表中,是则不再向服务端提出下载申请,等待所述数据下载完成,否则向服务端提所述数据下载申请,将将该数据加入传送列表,从服务端下载所述数据。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US15/778,217 US10713091B2 (en) | 2016-01-20 | 2016-03-29 | Streaming program execution method of intelligent terminal |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610036352.1A CN105718287B (zh) | 2016-01-20 | 2016-01-20 | 一种智能终端的程序流式执行方法 |
| CN201610036352.1 | 2016-01-20 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017124637A1 true WO2017124637A1 (zh) | 2017-07-27 |
Family
ID=56147365
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/077608 Ceased WO2017124637A1 (zh) | 2016-01-20 | 2016-03-29 | 一种智能终端的程序流式执行方法 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US10713091B2 (zh) |
| CN (1) | CN105718287B (zh) |
| WO (1) | WO2017124637A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109901891A (zh) * | 2019-03-19 | 2019-06-18 | 北京智游网安科技有限公司 | 一种elf程序里添加数据的方法、存储介质及智能终端 |
Families Citing this family (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105718287B (zh) * | 2016-01-20 | 2018-11-13 | 中南大学 | 一种智能终端的程序流式执行方法 |
| CN106528196B (zh) * | 2016-09-23 | 2019-11-26 | 邵阳学院 | 智能设备的app加载方法及应用该方法的智能设备、系统 |
| CN107038056B (zh) * | 2017-05-19 | 2018-03-16 | 中南大学 | 基于安卓平台的流式计算模式调度方法 |
| CN107450960A (zh) * | 2017-09-18 | 2017-12-08 | 珠海亿智电子科技有限公司 | 一种对可执行elf文件重新链接和加载的方法 |
| CN107797820B (zh) * | 2017-11-13 | 2021-03-23 | 北京百度网讯科技有限公司 | 用于生成补丁的方法和装置 |
| CN108241516B (zh) * | 2018-02-09 | 2021-06-18 | 深圳科立讯通信有限公司 | 嵌入式系统程序加载方法、装置、计算机设备和存储介质 |
| CN110083469B (zh) * | 2019-05-11 | 2021-06-04 | 广东财经大学 | 一种异构硬件组织运行统一内核方法及系统 |
| CN113946411A (zh) * | 2020-07-15 | 2022-01-18 | 阿里巴巴集团控股有限公司 | 数据处理方法、装置、设备和存储介质 |
| CN112099799B (zh) * | 2020-09-21 | 2022-01-14 | 飞腾信息技术有限公司 | Numa感知的smp系统只读代码段多副本优化方法及系统 |
| CN114692213B (zh) * | 2020-12-30 | 2025-09-09 | 深圳Tcl新技术有限公司 | 数据防篡改方法、装置、智能终端及计算机可读存储介质 |
| CN112632113B (zh) * | 2020-12-31 | 2022-02-11 | 北京九章云极科技有限公司 | 一种算子管理方法和算子管理系统 |
| CN113411398B (zh) * | 2021-06-18 | 2022-02-18 | 全方位智能科技(南京)有限公司 | 一种基于大数据的文件清理写入及清理管理系统及方法 |
| CN113126975B (zh) * | 2021-06-21 | 2021-09-17 | 云账户技术(天津)有限公司 | 一种代码片段插件的实现方法及装置 |
| CN117971245B (zh) * | 2023-12-29 | 2025-03-14 | 摩尔线程智能科技(北京)股份有限公司 | 多智能设备控制系统及方法、电子设备和存储介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101604257A (zh) * | 2009-06-29 | 2009-12-16 | 北京航空航天大学 | 虚拟化软件的执行方法及装置 |
| CN103793257A (zh) * | 2014-03-07 | 2014-05-14 | 中南大学 | 一种Android程序的流式执行方法 |
| CN104158886A (zh) * | 2014-08-21 | 2014-11-19 | 中南大学 | 一种应用程序的流式执行方法 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US1007501A (en) * | 1910-09-10 | 1911-10-31 | Universal Paper Bottle Company | Milk-vending apparatus. |
| JP6345604B2 (ja) * | 2014-01-27 | 2018-06-20 | アラクサラネットワークス株式会社 | 通信装置、拡張機能の移動方法、及び通信システム |
| US9930046B2 (en) * | 2014-04-07 | 2018-03-27 | The Toronto-Dominion Bank | Systems and methods for providing information-technology assets in an open environment |
| US10025561B2 (en) * | 2015-02-03 | 2018-07-17 | Solvebot, Inc. | Automated software application generation and deployment |
| CN105718287B (zh) * | 2016-01-20 | 2018-11-13 | 中南大学 | 一种智能终端的程序流式执行方法 |
-
2016
- 2016-01-20 CN CN201610036352.1A patent/CN105718287B/zh active Active
- 2016-03-29 US US15/778,217 patent/US10713091B2/en active Active
- 2016-03-29 WO PCT/CN2016/077608 patent/WO2017124637A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101604257A (zh) * | 2009-06-29 | 2009-12-16 | 北京航空航天大学 | 虚拟化软件的执行方法及装置 |
| CN103793257A (zh) * | 2014-03-07 | 2014-05-14 | 中南大学 | 一种Android程序的流式执行方法 |
| CN104158886A (zh) * | 2014-08-21 | 2014-11-19 | 中南大学 | 一种应用程序的流式执行方法 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109901891A (zh) * | 2019-03-19 | 2019-06-18 | 北京智游网安科技有限公司 | 一种elf程序里添加数据的方法、存储介质及智能终端 |
| CN109901891B (zh) * | 2019-03-19 | 2022-06-14 | 北京智游网安科技有限公司 | 一种elf程序里添加数据的方法、存储介质及智能终端 |
Also Published As
| Publication number | Publication date |
|---|---|
| US10713091B2 (en) | 2020-07-14 |
| US20180349193A1 (en) | 2018-12-06 |
| CN105718287B (zh) | 2018-11-13 |
| CN105718287A (zh) | 2016-06-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105718287B (zh) | 一种智能终端的程序流式执行方法 | |
| US8813175B2 (en) | Multimodal computing device | |
| US11360884B2 (en) | Reserved memory in memory management system | |
| JP2017534107A (ja) | 動的コードデプロイメント及びバージョニング | |
| CN105955779B (zh) | 进程关闭方法及装置 | |
| JP2003114806A (ja) | Os更新方法及びセキュリティ制御方法並びにその実施装置 | |
| WO2012045238A1 (zh) | 一种移动设备上应用程序的启动方法及装置 | |
| CN103607428A (zh) | 一种访问共享内存的方法和装置 | |
| US20210055922A1 (en) | Hydration of applications | |
| WO2025112885A1 (zh) | 资源调整方法、装置、电子设备、存储介质及训练平台 | |
| US12293078B2 (en) | Storage space organization method and electronic device | |
| CN103513956B (zh) | 一种处理器处理数据的方法以及装置 | |
| TW201826102A (zh) | 應用運行方法及裝置 | |
| US9513928B2 (en) | Method of operating multiple operating systems and the electronic device thereof | |
| US10474512B1 (en) | Inter-process intra-application communications | |
| CN117591163B (zh) | 内核升级方法、装置、介质、芯片和电子设备 | |
| CN107783837A (zh) | 一种进行存储扩展的方法、装置及电子设备 | |
| CN106598475A (zh) | 一种实现分区切换的方法及装置 | |
| EP3977265B1 (en) | Automatic hydration of feature file batches | |
| CN106528196B (zh) | 智能设备的app加载方法及应用该方法的智能设备、系统 | |
| CN117742801A (zh) | 操作系统的启动方法及装置 | |
| EP4582945A1 (en) | Task scheduling method, and electronic apparatus | |
| KR100738419B1 (ko) | 위피 기반의 멀티 어플리케이션 실행을 위한 메모리 관리자가 구비된 스마트 폰 | |
| CN105426216A (zh) | 一种基于透明计算的智能终端软件更新方法 | |
| WO2025065686A1 (zh) | 一种应用启动方法及电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16885901 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 03/01/2019) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 16885901 Country of ref document: EP Kind code of ref document: A1 |