CN100378663C - Method, system and module for dynamically downloading application program to subscriber identity module - Google Patents
Method, system and module for dynamically downloading application program to subscriber identity module Download PDFInfo
- Publication number
- CN100378663C CN100378663C CNB2005100770375A CN200510077037A CN100378663C CN 100378663 C CN100378663 C CN 100378663C CN B2005100770375 A CNB2005100770375 A CN B2005100770375A CN 200510077037 A CN200510077037 A CN 200510077037A CN 100378663 C CN100378663 C CN 100378663C
- Authority
- CN
- China
- Prior art keywords
- program
- module
- data
- application
- code
- 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.)
- Active
Links
Images
Landscapes
- Stored Programmes (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Description
技术领域 technical field
本发明涉及智能卡的程序下载,更具体地,涉及用户识别模块的动态程序下载方法、系统及其支持该方法的用户识别模块。The present invention relates to the program downloading of the smart card, more specifically, to the dynamic program downloading method and system of the user identification module and the user identification module supporting the method.
背景技术 Background technique
空中下载技术(OTA)的出现使得SIM卡、UIM卡等用户识别模块能够从服务器动态下载最新的菜单,已成为一种为用户提供新的增值服务的重要手段。但是,一些增值服务的实现还需要在用户识别模块上运行相应的应用程序,目前还不能够实现应用程序到用户识别模块的动态下载,这对一些增值服务的推广带来了不便。The emergence of over-the-air technology (OTA) enables subscriber identification modules such as SIM cards and UIM cards to dynamically download the latest menus from servers, and has become an important means to provide users with new value-added services. However, the realization of some value-added services also needs to run the corresponding application program on the user identification module, and the dynamic download of the application program to the user identification module cannot be realized at present, which brings inconvenience to the promotion of some value-added services.
发明内容 Contents of the invention
本发明要解决的技术问题是提供一种将应用程序动态下载到用户识别模块的方法,可以将程序代码以机器代码的形式动态下载到用户识别模块,并在用户识别模块上调用、删除该程序。本发明还要提供一种实现该方法的系统和支持该方法的用户识别模块。The technical problem to be solved by the present invention is to provide a method for dynamically downloading the application program to the user identification module, which can dynamically download the program code to the user identification module in the form of machine code, and call and delete the program on the user identification module . The invention also provides a system for realizing the method and a subscriber identification module supporting the method.
为了解决上述技术问题,本发明提供了一种将应用程序动态下载到用户识别模块的方法,包括以下步骤:In order to solve the above technical problems, the present invention provides a method for dynamically downloading an application program to a subscriber identification module, comprising the following steps:
(a)应用业务服务器将要下载的应用程序的机器代码组成若干条数据,发送到用户识别模块;(a) the application service server forms several pieces of data with the machine code of the application program to be downloaded, and sends it to the user identification module;
(b)用户识别模块在收到所述应用程序的数据后,将其中的程序代码写入模块内的存储器,并保存程序标识和程序代码地址的信息;(b) After the user identification module receives the data of the application program, write the program code therein into the memory in the module, and save the program identification and the information of the program code address;
(c)要调用所述应用程序时,先根据程序标识得到该程序代码的起始地址,执行该程序。(c) When the application program is to be called, first obtain the starting address of the program code according to the program identification, and execute the program.
进一步地,上述方法还可具有以下特点:还包括步骤:(d)要删除所述应用程序时,将保存的与该程序相关的所述信息删除。Further, the above method may also have the following features: it also includes the step: (d) when the application program is to be deleted, delete the saved information related to the program.
进一步地,上述方法还可具有以下特点:步骤(a)中,所述应用业务服务器是通过无线方式将应用程序代码发送到所述用户识别模块的,或者,所述应用业务服务器是通过写卡终端处理模块采用写卡组件函数调用方式将应用程序代码发送到所述用户识别模块的。Further, the above method may also have the following features: in step (a), the application service server sends the application program code to the subscriber identification module in a wireless manner, or the application service server sends the application program code to the user identification module by writing The terminal processing module sends the application program code to the user identification module by calling the card writing component function.
进一步地,上述方法还可具有以下特点:所述应用业务服务器是通过短信通道以数据短信的方式将应用程序代码发送到所述用户识别模块的。Further, the above method may also have the following features: the application service server sends the application program code to the user identification module in the form of a data message through a message channel.
进一步地,上述方法还可具有以下特点:步骤(b)中,所述程序代码写入完成后,还调用程序代码的初始化函数入口,在操作系统中进行程序的注册。Furthermore, the above method may also have the following features: in step (b), after the program code is written, the initialization function entry of the program code is called to register the program in the operating system.
进一步地,上述方法还可具有以下特点:步骤(d)中,先在操作系统中进行要删除程序的反注册,再删除其相关信息。Further, the above method may also have the following features: in step (d), the program to be deleted is de-registered in the operating system first, and then its related information is deleted.
进一步地,上述方法还可具有以下特点:所述应用程序代码地址是用文件分配表中该程序的逻辑区间链表方式保存的,而该逻辑区间链表的首址与该程序标识的对应关系存储在文件注册表中,用户识别模块根据程序标识即可找到程序的逻辑区间链表的首址,进而算出程序代码的起始地址并找到该程序的逻辑区间链表。Further, the above method may also have the following features: the address of the application program code is stored in the form of a logical range linked list of the program in the file allocation table, and the corresponding relationship between the first address of the logical range linked list and the program identifier is stored in In the file registry, the user identification module can find the first address of the program's logical range linked list according to the program identification, and then calculate the starting address of the program code and find the program's logical range linked list.
进一步地,上述方法还可具有以下特点:在下载和删除程序时,还记录该程序下载及删除是否完成的状态信息,所述步骤(b)先清除未下载成功和未删除成功的程序,再判断是否有足够的剩余空间,如有,再将程序代码写入相应的存储位置,如空间不足,则中止下载,结束。Further, the above method can also have the following characteristics: when downloading and deleting a program, it also records the status information of whether the download and deletion of the program is completed, and the step (b) first clears the programs that have not been successfully downloaded and deleted, and then Judging whether there is enough remaining space, if so, then write the program code into the corresponding storage location, if the space is insufficient, stop the download and end.
进一步地,上述方法还可具有以下特点:所述程序代码是存储在存储器的一个可动态指定的逻辑分区中,在该分区写入数据时,将其置为数据态,而在下载结束后,将其置为程序态以便直接调用。Further, the above method may also have the following features: the program code is stored in a dynamically specified logical partition of the memory, and when data is written in the partition, it is set to the data state, and after the download is completed, Make it programmatic so that it can be called directly.
进一步地,上述方法还可具有以下特点:所述程序代码和文件分配表都存储在可动态指定的逻辑分区,在每次写入程序代码或改写文件分配表前,都将其对应的逻辑分区置为数据态,而在写入完成后,再将其对应的逻辑分区置为程序态。Further, the above method may also have the following characteristics: the program code and the file allocation table are stored in dynamically specified logical partitions, and before each program code is written or the file allocation table is rewritten, its corresponding logical partition Set it to the data state, and after the writing is completed, set its corresponding logical partition to the program state.
进一步地,上述方法还可具有以下特点:所述步骤(c)在调用应用程序之前,先保持当前程序运行的环境,而在调用结束后,再恢复调用前的程序环境。Furthermore, the above-mentioned method may also have the following characteristics: in the step (c), before invoking the application program, the environment in which the current program is running is maintained first, and after the invocation ends, the program environment before invocation is restored.
本发明提供的支持该方法的用户识别模块包括监控模块、存储模块,其特点是,还包括应用程序管理模块,其中:The user identification module supporting the method provided by the present invention includes a monitoring module and a storage module, and is characterized in that it also includes an application program management module, wherein:
所述监控模块,用于监控收到的数据,判断其是否是下载的应用程序的机器代码数据,如果是,交给应用程序管理模块处理;The monitoring module is used to monitor the received data to determine whether it is the machine code data of the downloaded application program, and if so, hand it over to the application program management module for processing;
所述存储模块,分为若干个逻辑分区,用于存储下载的应用程序的程序标识、程序代码地址信息以及程序代码的数据;The storage module is divided into several logical partitions, and is used to store the program identification, program code address information and program code data of the downloaded application program;
所述应用程序管理模块进一步包括:The application management module further includes:
下载控制单元,用于在收到下载的应用程序数据后,将其中的程序代码写入所述存储模块,并保存程序标识和程序代码的地址信息;The download control unit is used to write the program code in the storage module after receiving the downloaded application program data, and save the program identification and the address information of the program code;
调用控制单元,用于在要调用所述应用程序时,根据程序标识得到该程序代码的起始地址。The calling control unit is used to obtain the starting address of the program code according to the program identification when the application program is to be called.
进一步地,上述用户识别模块还可具有以下特点:所述应用程序管理模块进一步包括:删除控制单元,用于在要删除所述应用程序时,根据其程序标识找到保存的程序代码地址信息,将该程序相关的信息删除。Further, the above-mentioned user identification module may also have the following features: the application program management module further includes: a deletion control unit, configured to find the stored program code address information according to its program identification when the application program is to be deleted, and Information related to this program is deleted.
进一步地,上述用户识别模块还可具有以下特点:还包括一个存储管理模块,用于控制所述存储模块上逻辑分区的访问权限,在应用程序的下载、调用、删除过程中,需要写入程序代码数据时,将其所在分区置为数据态,而在要执行程序代码时,将其所在分区置为程序态。Further, the above-mentioned user identification module can also have the following characteristics: it also includes a storage management module, which is used to control the access rights of the logical partitions on the storage module, and it is necessary to write the program during the downloading, calling and deleting of the application When the code data is used, the partition where it is located is set to the data state, and when the program code is to be executed, the partition where it is located is set to the program state.
进一步地,上述用户识别模块还可具有以下特点:所述下载控制单元是将程序代码的地址信息以逻辑区间链表的方式保存在文件分配表中,将程序标识和对应的逻辑区间链表首址保存在文件注册表中,所述调用控制单元和删除控制单元根据程序标识找到其逻辑区间链表的首址,进而算出程序代码的起始地址和找到该程序的逻辑区间链表。Further, the above-mentioned user identification module may also have the following features: the download control unit stores the address information of the program code in the file allocation table in the form of a logical interval linked list, and saves the program identifier and the corresponding first address of the logical interval linked list In the file registration table, the call control unit and the deletion control unit find the first address of the logical interval linked list according to the program identification, and then calculate the starting address of the program code and find the logical interval linked list of the program.
进一步地,上述用户识别模块还可具有以下特点:所述下载控制单元还在程序代码写入完成后,在操作系统中进行该程序的注册;所述删除控制单元在删除该程序的信息前,先在操作系统中完成该程序的反注册。Further, the above-mentioned user identification module may also have the following features: the download control unit also registers the program in the operating system after the program code is written; the deletion control unit, before deleting the information of the program, Complete the anti-registration of the program in the operating system first.
本发明提供的实现程序动态下载到用户识别模块的系统包括应用业务服务器和与其通讯的用户识别模块,其中:The system provided by the present invention for realizing the dynamic download of programs to the user identification module includes an application service server and a user identification module communicating with it, wherein:
所述应用业务服务器包括应用业务数据管理模块和通讯处理模块,该应用业务数据管理模块用于保存应用程序的机器代码数据,在用户需要下载时,将程序代码组成若干条数据,交给所述通讯处理模块;所述通讯处理模块用于接收用户的下载申请,交给所述应用业务数据管理模块,并将组织好的应用程序代码数据发送到申请下载的所述用户识别模块;The application service server includes an application service data management module and a communication processing module. The application service data management module is used to save the machine code data of the application program. A communication processing module; the communication processing module is used to receive the user's download application, hand it over to the application business data management module, and send the organized application program code data to the user identification module applying for download;
所述用户识别模块进一步包括监控模块、存储模块和应用程序管理模块,其中:The user identification module further includes a monitoring module, a storage module and an application program management module, wherein:
所述监控模块用于监控收到的数据,判断其是否是下载的应用程序的机器代码数据,如果是,交给应用程序管理模块处理;The monitoring module is used to monitor the received data to determine whether it is the machine code data of the downloaded application program, and if so, hand it over to the application program management module for processing;
所述存储模块分为若干个逻辑分区,用于存储下载的应用程序的程序标识、程序代码地址信息以及程序代码的数据;The storage module is divided into several logical partitions for storing the program identification, program code address information and program code data of the downloaded application program;
所述应用程序管理模块进一步包括:下载控制单元,用于在剩余空间足够时,将收到的应用程序数据中的程序代码写入所述存储模块,并保存程序标识和程序代码的地址信息;调用控制单元,用于根据程序标识得到该程序代码的起始地址,执行该应用程序;删除控制单元,用于将保存的应用程序的相关信息删除。The application program management module further includes: a download control unit, configured to write the program code in the received application program data into the storage module when the remaining space is sufficient, and save the program identification and the address information of the program code; The calling control unit is used to obtain the starting address of the program code according to the program identification, and executes the application program; the deletion control unit is used to delete the stored relevant information of the application program.
进一步地,上述系统还可具有以下特点:所述通讯处理模块进一步包括接收单元和发送单元,所述接收单元用于接收从短消息网关发来的短信,识别出下载应用程序的申请,将用户手机号和要下载的应用程序信息通知给所述应用业务数据管理模块,所述发送单元用于将组织好的每条数据加上状态字,按照数据短信方式经短消息网关发送到用户识别模块。Further, the above-mentioned system can also have the following characteristics: the communication processing module further includes a receiving unit and a sending unit, the receiving unit is used to receive the short message sent from the short message gateway, recognize the application for downloading the application program, and send the user The mobile phone number and the application program information to be downloaded are notified to the application service data management module, and the sending unit is used to add the status word to each piece of data organized, and send it to the user identification module through the short message gateway according to the data short message mode .
进一步地,上述系统还可具有以下特点:还包括一个写卡终端处理模块,该模块采用写卡组件函数调用方式将应用程序代码传送到所述用户识别模块。Further, the above-mentioned system may also have the following features: it also includes a card writing terminal processing module, which uses a function calling method of the card writing component to transmit the application program code to the user identification module.
进一步地,上述系统还可具有以下特点:所述用户识别模块还包括一个存储管理模块,用于控制所述存储模块上逻辑分区的访问权限,在应用程序的下载、调用和删除过程中,需要写入程序代码数据时,将其所在分区置为数据态,而在要执行程序代码时,将其所在分区置为程序态。Further, the above system can also have the following features: the user identification module also includes a storage management module, which is used to control the access rights of the logical partitions on the storage module. When program code data is written, the partition where it is located is set to the data state, and when the program code is to be executed, the partition where it is located is set to the program state.
综上所述,采用本发明,可以将应用程序的机器代码动态下载到用户识别模块,并可实现调用和删除功能。而且,本发明下载到用户识别模块的内容是不需要解释执行的机器代码数据,调用时只需找到程序入口即可直接调用,不需要进一步的解释性工作,运行速度很快。而且下载的程序不仅能作为系统需要维护的数据,还可以作为底层操作系统的扩充。To sum up, by adopting the present invention, the machine code of the application program can be dynamically downloaded to the user identification module, and the function of calling and deleting can be realized. Moreover, the content downloaded to the user identification module in the present invention is the machine code data that does not need to be interpreted and executed. When calling, it only needs to find the program entry to call directly, without further explaining work, and the running speed is very fast. Moreover, the downloaded program can not only be used as the data that the system needs to maintain, but also can be used as the expansion of the underlying operating system.
进一步地,通过对存储区的动态指定,可以使程序代码所在分区在写入数据时置为数据态,而在执行时置为程序态,用简单的硬件设计来实现应用程序的下载和调用。Furthermore, through the dynamic designation of the storage area, the partition where the program code is located can be set to the data state when writing data, and set to the program state when executing, and the download and call of the application program can be realized with a simple hardware design.
附图说明 Description of drawings
图1是本发明实施例实现程序动态下载到用户识别模块的系统图。Fig. 1 is a system diagram for realizing the dynamic downloading of programs to the subscriber identification module according to the embodiment of the present invention.
图2是本发明实施例用户识别模块的结构框图。Fig. 2 is a structural block diagram of the user identification module of the embodiment of the present invention.
图3是本发明实施例方法下载及程序代码存储的流程图。Fig. 3 is a flowchart of method downloading and program code storage in an embodiment of the present invention.
图4是本发明实施例方法调用已下载程序的流程图。Fig. 4 is a flowchart of calling a downloaded program by a method according to an embodiment of the present invention.
图5是本发明实施例方法删除下载程序的流程图。Fig. 5 is a flowchart of a method for deleting a download program according to an embodiment of the present invention.
具体实施方式 Detailed ways
第一实施例first embodiment
本实施例实现应用程序动态下载到用户识别模块的方法所基于的系统如图1所示,由应用业务服务器,以及通过短信通道与该服务器交互的SIM卡(由手机完成短信的透传)组成。In this embodiment, the system based on the method for dynamically downloading the application program to the subscriber identification module is as shown in Figure 1, and is composed of an application service server and a SIM card interacting with the server through a short message channel (the transparent transmission of the short message is completed by the mobile phone) .
应用业务服务器上的主要相关模块包括:The main related modules on the application business server include:
应用业务管理模块,用于新应用业务的开发和管理,系统管理以及SIM卡信息维护等功能。The application service management module is used for the development and management of new application services, system management, and SIM card information maintenance.
应用业务数据管理模块,用于保存应用程序的机器代码数据,在收到用户申请后,将数据按规定格式组织成若干条数据交给通讯处理模块发送,每条数据的内容包括:数据总大小、数据总条数、本条数据索引值、本条数据内容、本条数据长度和本条数据在总数据中的偏移。The application business data management module is used to save the machine code data of the application program. After receiving the application from the user, organize the data into several pieces of data according to the specified format and send them to the communication processing module. The content of each piece of data includes: the total size of the data , the total number of data items, the index value of this item of data, the content of this item of data, the length of this item of data, and the offset of this item of data in the total data.
通讯处理模块,用于完成应用业务服务器与短消息网关之间的数据接收、数据分流和数据发送等功能。其进一步包括接收单元,用于接收从短消息网关发来的短信,识别出下载应用程序的申请,将用户手机号和要下载的应用程序信息通知给应用业务数据管理模块;以及发送单元,用于将组织好的每条数据加上状态字,按照数据短信方式经短消息网关发送到SIM卡。The communication processing module is used to complete functions such as data reception, data distribution and data transmission between the application service server and the short message gateway. It further includes a receiving unit, used to receive the short message sent from the short message gateway, recognize the application for downloading the application program, and notify the application service data management module of the user's mobile phone number and the application program information to be downloaded; and the sending unit, with Add the status word to each piece of organized data, and send it to the SIM card through the short message gateway in the form of a data short message.
本实施例支持动态程序下载的SIM卡采用一种具有多个逻辑分区并可控制访问权限的IC智能卡(可参考本申请人的专利申请:03137511.1),该SIM卡进一步包括监控模块、应用程序管理模块、存储模块,以及位于应用程序管理模块和存储模块之间的存储管理模块,如图2所示。The SIM card that this embodiment supports dynamic program downloading adopts a kind of IC smart card (can refer to the applicant's patent application: 03137511.1) that has a plurality of logical partitions and can control access authority, and this SIM card further includes monitoring module, application program management module, a storage module, and a storage management module located between the application program management module and the storage module, as shown in FIG. 2 .
监控模块,用于监控从手机透传的短信,根据短信中的状态字识别出是应用程序的下载数据后,交给应用程序管理模块处理;The monitoring module is used to monitor the short message transparently transmitted from the mobile phone, and after identifying the download data of the application program according to the status word in the short message, it is handed over to the application program management module for processing;
应用程序管理模块进一步包括下载控制单元、调用控制单元和删除控制单元,其中:The application program management module further includes a download control unit, a call control unit and a deletion control unit, wherein:
下载控制单元,用于在收到短信方式的下载数据后,判断是否有足够的剩余空间,如有,将数据逐条写入到相应的存储位置,并保存程序标识、程序代码起始地址等信息,写入完成后在系统中进行程序注册,并建立该程序代码的逻辑区间链表。The download control unit is used to judge whether there is enough remaining space after receiving the downloaded data in the form of SMS, and if so, write the data to the corresponding storage location one by one, and save information such as the program identification and the starting address of the program code After the writing is completed, the program is registered in the system, and a logical interval linked list of the program code is established.
调用控制单元,用于根据程序标识在文件注册表中找到相应记录,获得该程序的逻辑区间链表首址,然后根据该地址计算该程序代码的起始地址,修改程序指针,然后执行该程序。The calling control unit is used to find the corresponding record in the file registration table according to the program identification, obtain the first address of the logical interval linked list of the program, then calculate the starting address of the program code according to the address, modify the program pointer, and then execute the program.
删除控制单元,用于先进行要删除程序的反注册,根据其程序标识在文件注册表中找到相应记录,根据该记录指定的逻辑区间链表首址清空文件分配区对应的链表信息,最后从注册表中删除该记录。The deletion control unit is used to perform the anti-registration of the program to be deleted first, find the corresponding record in the file registry according to its program identification, clear the linked list information corresponding to the file allocation area according to the first address of the logical interval linked list specified by the record, and finally delete it from the registration Delete the record from the table.
存储模块包含可以根据应用程序管理模块在下载、调用、删除中要执行的操作,控制这些分区的访问权限,需要在某区写入数据时将该区置为数据态(可读写),而在要执行某区的程序代码时将其转换为程序态(可读)。The storage module contains the operations that can be performed in downloading, calling, and deleting according to the application management module, and controls the access rights of these partitions. When writing data in a certain area, it is necessary to set the area to the data state (readable and writable), while When the program code of a certain area is to be executed, it is converted into a program state (readable).
为了实现应用程序的管理,该存储模块中的文件系统包括文件注册表、文件分配表和程序代码。与普通智能卡不同的是,在程序下载和调用过程中,文件分配表和程序代码所在的逻辑分区会有数据态和程序态的转换,而文件注册表区所在逻辑分区则始终作为数据区。In order to realize the management of the application program, the file system in the storage module includes a file registry, a file allocation table and program codes. Different from ordinary smart cards, in the process of program download and calling, the logical partition where the file allocation table and program code are located will have a data state and program state conversion, while the logical partition where the file registry area is always used as a data area.
文件分配表用于存储应用程序代码的逻辑区间链表,程序代码的存储通过逻辑区间链表寻址方式保存,以实现代码数据的动态增加和删除。The file allocation table is used to store the logical interval linked list of the application code, and the storage of the program code is saved through the addressing mode of the logical interval linked list, so as to realize the dynamic addition and deletion of code data.
文件注册表用于存储包含程序代码与逻辑区间链表首址对应关系、下载和删除流程的状态等信息。其结构如下所示:The file registry is used to store information including the corresponding relationship between the program code and the first address of the logical interval linked list, the status of the download and delete process, and the like. Its structure is as follows:
其中,程序标识为三个字节,是与其它程序区分的标志。在下载流程中,程序状态为1表示开始下载,状态2表下载完成。在删除流程中,程序状态2表示未开始删除,状态1表示开始删除但未删除完成,删除完成以后,将清除注册表中相应的记录。逻辑区间链表首址记录程序数据在文件分配表中建立的链表的首址。知道了程序的标识通过注册表就可以找到程序的逻辑区间链表,即计算出程序数据的存放地址。Among them, the program identification is three bytes, which is a sign to distinguish it from other programs. In the downloading process, a program status of 1 indicates that the download is started, and a status of 2 indicates that the download is completed. In the deletion process, the program status 2 means that the deletion has not started, and the status 1 means that the deletion has started but has not been completed. After the deletion is completed, the corresponding record in the registry will be cleared. The first address of the logical range linked list records the first address of the linked list established by the program data in the file allocation table. Knowing the identification of the program, the logical interval linked list of the program can be found through the registry, that is, the storage address of the program data can be calculated.
本实施例方法包括下载及程序代码存储流程、代码调用流程以及程序代码删除流程三个方面。下载时是通过短消息通道实现的。The method of this embodiment includes three aspects: downloading and program code storage process, code calling process and program code deletion process. The downloading is realized through the short message channel.
如图3所示,下载及程序代码存储流程包括以下步骤:As shown in Figure 3, the process of downloading and program code storage includes the following steps:
步骤110,应用业务服务器收到下载请求后,将程序代码按规定格式打包成数据短信并加上状态字,然后通过短消息通道发送到SIM卡;Step 110, after receiving the download request, the application service server packs the program code into a data short message according to a prescribed format and adds a status word, and then sends it to the SIM card through the short message channel;
步骤120,SIM卡收到数据短信并根据所述状态字识别出是下载的程序代码后,先判断该短信包含的是否为第一条下载数据(根据其索引值即可判断),如果是,执行下一步,否则执行步骤170;Step 120, after the SIM card receives the data note and recognizes that it is the downloaded program code according to the status word, it is first judged whether the note contains is the first download data (can be judged according to its index value), if yes, Execute the next step, otherwise execute step 170;
步骤130,查找程序注册表中的记录,如果有状态为1的记录,执行步骤140,如果没有状态为1的记录,执行步骤150;Step 130, search for the record in the program registry, if there is a record with status 1, execute step 140, if there is no record with status 1, execute step 150;
步骤140,先将文件分配表所在分区置为数据态,根据所述记录中的逻辑区间链表首址将对应程序在文件分配表中的空间清除,然后将文件分配表所在分区置为程序态,并将文件注册表中的所述记录删除;Step 140, first set the partition where the file allocation table is in the data state, clear the space of the corresponding program in the file allocation table according to the first address of the logical interval linked list in the record, and then set the partition where the file allocation table is in the program state, and delete said record in the file registry;
步骤130和140用于在查找空间之前,先清除未下载成功和未删除成功的程序。因为这些程序可能因为掉电的原因没有执行成功下载和删除流程,但是还占用文件分配表中的空间,所以在查找空间之前将这些无用的程序删除,以充分利用存储空间。Steps 130 and 140 are used to clear programs that have not been successfully downloaded or deleted before searching for space. Because these programs may not be successfully downloaded and deleted due to power failure, but still occupy space in the file allocation table, delete these useless programs before searching for space to make full use of storage space.
步骤150,判断SIM卡中剩余空间是否大于程序代码存储所需的空间,如大于,执行下一步,否则中断下载流程,结束;Step 150, judging whether the remaining space in the SIM card is greater than the space required for program code storage, if greater, execute the next step, otherwise interrupt the download process and end;
步骤160,将程序代码所在分区置为数据态,将第一条数据的内容写入到剩余空间的开始位置,成功后在注册表中添加一条记录,写入该程序的程序标识和逻辑链表的首地址,程序状态记为1,返回步骤120;Step 160, set the partition where the program code is located in the data state, write the content of the first piece of data to the start position of the remaining space, add a record in the registry after success, write the program identification of the program and the logical linked list The first address, the program state is recorded as 1, and returns to step 120;
步骤170,每次写入数据前,将程序代码所在分区置为数据态,根据短信数据中的偏移及长度将该条数据的内容写到数据空间的相应位置(即找到的空闲簇),写入后将程序代码所在分区置为程序态;Step 170, before writing data at every turn, the partition where the program code is located is set to the data state, and the content of this piece of data is written to the corresponding position of the data space (i.e. the free cluster found) according to the offset and the length in the short message data, After writing, the partition where the program code is located is set to the program state;
步骤180,根据当前短信索引及短信总条数判断数据是否全部下载完成,如未下载完成,返回步骤120,否则,执行下一步;Step 180, judging whether all the data has been downloaded according to the current short message index and the total number of short messages, if not, return to step 120, otherwise, perform the next step;
步骤190,调用程序代码数据的初始化函数入口,进行程序的注册,如在系统中注册程序运行需要的文件,内存变量等,调用结束后将文件分配表所在分区置为数据态;Step 190, calling the initialization function entry of the program code data, and registering the program, such as registering the files needed for program operation in the system, memory variables, etc., after the call is completed, the partition where the file allocation table is located is set to a data state;
步骤200,查找注册表,将程序状态从1修改为2,并在文件分配表中建立该应用程序代码数据的逻辑区间链表,将文件分配表所在分区置为程序态,结束。Step 200, search the registry, change the program state from 1 to 2, and create a logical interval linked list of the application program code data in the file allocation table, set the partition where the file allocation table is in the program state, and end.
上述步骤中,步骤190是可选的。另外,文件分配表和程序代码所在的逻辑分区可以相同,也可以不同。只要保证在写入时将要写入的分区改为数据态,而在下载完成之后将程序代码所在分区改为程序态以供调用就可以了。Among the above steps, step 190 is optional. In addition, the logical partitions where the file allocation table and the program code are located may be the same or different. Just ensure that the partition to be written is changed to the data state when writing, and after the download is completed, the partition where the program code is located is changed to the program state for calling.
由于程序代码在下载完成后被置为程序态。所以如果知道程序数据的起址就可以直接运行。如图4所示,已下载程序的调用流程包括以下步骤:Because the program code is placed into the program state after the download is completed. So if you know the starting address of the program data, you can run it directly. As shown in Figure 4, the calling process of the downloaded program includes the following steps:
步骤210,要调用已下载程序时,SIM先保存程序运行的环境(如,堆栈信息、中断等等);
步骤220,根据程序标识在注册表状态为2的记录中查找到相应记录,获得该程序的逻辑区间链表首址;
步骤230,根据逻辑区间链表首址计算程序数据区的起始地址,开始执行该已下载的程序;
步骤240,调用结束后,恢复保存的程序运行环境。
程序的删除过程与下载的过程相反,如图5所示,删除已下载程序的流程包括以下步骤:The process of deleting a program is opposite to that of downloading, as shown in Figure 5, the process of deleting a downloaded program includes the following steps:
步骤310,调用要删除程序代码数据的释放函数入口,进行反注册过程,完成后继续下一步;
步骤320,根据要删除程序的标识在注册表状态为2的记录中查找相应的记录,找到后将该程序的状态由2改为1;
步骤330,修改文件分配表所在分区置为数据态,然后根据所述记录指定的逻辑区间链表首址,清空文件分配区对应的链表信息;
步骤340,修改文件分配表所在分区置为程序态,然后将该程序对应的记录从注册表中删除。
第二实施例second embodiment
不同于第一实施例从空中通道的下载,本实施例SIM卡是通过写卡终端处理模块从应用业务服务器下载数据的,如图1的虚线部分。系统中将该写卡终端处理模块与应用业务服务器的应用业务数据管理模块相连,应用业务数据管理模块也是将应用程序的数据打包,可以用第一实施例的格式,然后发给写卡终端处理模块。Different from the downloading from the air channel in the first embodiment, the SIM card in this embodiment downloads data from the application service server through the card writing terminal processing module, as shown in the dotted line in FIG. 1 . In the system, the card writing terminal processing module is connected with the application business data management module of the application business server, and the application business data management module also packs the data of the application program, which can use the format of the first embodiment, and then send it to the card writing terminal for processing module.
写卡终端处理模块,用于完成服务器与SIM卡间的数据传输,采用写卡组件函数调用方式,数据的重传、超时等问题由该模块处理,超时重发次数、等待时间,由服务器作为参数传给写卡组件。采用这种方式可以去掉短信通道中许多安全性和防重传的机制,多传输一些程序的数据,传输速度更快。The card writing terminal processing module is used to complete the data transmission between the server and the SIM card. It adopts the card writing component function calling method. Data retransmission, timeout and other issues are handled by this module. Parameters are passed to the card writing component. In this way, many security and anti-retransmission mechanisms in the SMS channel can be removed, more program data can be transmitted, and the transmission speed is faster.
本实施例SIM卡中的相关模块也包括监控模块、应用程序管理模块和存储模块。与第一实施例相比没有存储管理模块,即不区分程序区和数据区。只要能找到程序代码的数据,同样可以执行应用程序。这种存储方式需要硬件能够在任何位置运行程序数据或者能在内存中运行程序,从而在实现上比较复杂,而且需要在访问时区别操作的类型,相对成本比较高。The relevant modules in the SIM card in this embodiment also include a monitoring module, an application program management module and a storage module. Compared with the first embodiment, there is no storage management module, that is, no distinction is made between the program area and the data area. As long as the data of the program code can be found, the application program can also be executed. This storage method requires the hardware to be able to run program data at any location or to run programs in memory, so the implementation is more complicated, and the type of operation needs to be distinguished during access, which is relatively expensive.
监控模块的功能与第一实施例相同,应用程序管理模块所要完成的基本功能也相同,只是在本实施例中,应用程序是通过索引文件方式存储的。索引包括:程序标识和文件的标识,根据程序标识在注册表找到文件的标识。再根据文件标识,通过文件系统找到文件地址,读取文件内容。文件的内容即是程序数据,即每个程序的数据组成不同的文件保存起来。相应地,本实施例的应用程序管理模块包括:The function of the monitoring module is the same as that of the first embodiment, and the basic functions to be completed by the application program management module are also the same, except that in this embodiment, the application program is stored in the form of an index file. The index includes: a program identifier and a file identifier, and the file identifier is found in the registry according to the program identifier. Then according to the file identification, the file address is found through the file system, and the file content is read. The content of the file is the program data, that is, the data of each program is stored in different files. Correspondingly, the application program management module of this embodiment includes:
下载控制单元,用于在收到写卡组件函数调用方式的下载数据后,判断是否有足够的剩余空间,如有,根据数据中记录的程序数据的总长度创建文件,并将相应数据写入文件中的相应位置,写入完成以后在系统中进行程序的注册,记录程序标识与文件标识。The download control unit is used to judge whether there is enough remaining space after receiving the download data of the card writing component function call mode, and if so, create a file according to the total length of the program data recorded in the data, and write the corresponding data The corresponding position in the file, after the writing is completed, the program is registered in the system, and the program ID and file ID are recorded.
调用控制单元,用于根据程序标识在文件注册表中找到相应记录,获得保存该程序数据文件的标识,并根据此标识通过文件管理系统读取文件的内容,此时的文件内容即是程序数据,直接执行此程序即可。Call the control unit to find the corresponding record in the file registry according to the program identification, obtain the identification of the program data file, and read the content of the file through the file management system according to the identification. At this time, the content of the file is the program data , just execute this program directly.
删除控制单元,用于先进行要删除程序的反注册,根据其程序标识在文件注册表中找到相应记录,根据该记录指定的文件标识删除保存程序数据的文件,最后从注册表中删除该记录。The deletion control unit is used to unregister the program to be deleted first, find the corresponding record in the file registry according to its program identifier, delete the file saving the program data according to the file identifier specified by the record, and finally delete the record from the registry .
本实施例的下载及程序代码存储流程如下:用户识别模块收到写卡组件函数调用方式的下载数据后,判断是否有足够的剩余空间,如有,根据数据中记录的程序数据的总长度创建文件,并将相应数据写入文件中的相应位置,写入完成以后在系统中进行程序的注册,记录程序标识与文件标识。The download and program code storage process of the present embodiment are as follows: After the user identification module receives the download data of the card writing component function call mode, it is judged whether there is enough remaining space, and if there is, it is created according to the total length of the program data recorded in the data file, and write the corresponding data into the corresponding position in the file. After the writing is completed, the program is registered in the system, and the program ID and file ID are recorded.
代码调用流程如下:要调用已下载的应用程序时,先保存程序运行的环境;根据程序标识在文件注册表中找到该程序数据文件的标识;根据此标识通过文件管理系统读取文件的内容,即程序数据,然后修改程序指针,执行该程序;调用结束后,再恢复保存的程序运行环境。The code calling process is as follows: when calling a downloaded application program, first save the running environment of the program; find the program data file ID in the file registry according to the program ID; read the content of the file through the file management system according to the ID, That is, the program data, and then modify the program pointer to execute the program; after the call is completed, restore the saved program operating environment.
程序代码删除流程如下:根据删除程序的标识在文件注册表中找到相应记录;根据该记录指定的文件标识删除保存程序数据的文件;最后从注册表中删除该程序的记录。The program code deletion process is as follows: find the corresponding record in the file registry according to the identifier of the deleted program; delete the file saving the program data according to the file identifier specified by the record; finally delete the record of the program from the registry.
第一实施例和第二实施例的一些技术手段是可以组合的,例如,在又一实施例中,可以采用簇链方式来对应用程序代码寻址,但在下载时并不进行数据态和程序态的转换。又如,在第二实施例的注册表中也可以加入程序状态的信息,并在查找剩余空间之前先清除未下载成功和未删除成功的程序。Some technical means of the first embodiment and the second embodiment can be combined. For example, in another embodiment, the cluster chain method can be used to address the application code, but the data status and Program state conversion. As another example, program status information may also be added to the registry in the second embodiment, and programs that have not been successfully downloaded or deleted are cleared before finding the remaining space.
综上所述,采用本发明,可以将应用程序的机器代码动态下载到用户识别模块,并实现调用和删除功能。而且,本发明下载到用户识别模块的内容是不需要解释执行的机器代码数据,调用时只需找到程序入口即可直接调用,不需要进一步的解释性工作,运行速度很快。而且下载的程序不仅能作为系统需要维护的数据,还可以作为底层操作系统的扩充。To sum up, by adopting the present invention, the machine code of the application program can be dynamically downloaded to the user identification module, and the function of calling and deleting can be realized. Moreover, the content downloaded to the user identification module in the present invention is machine code data that does not need to be interpreted and executed. When calling, it only needs to find the program entry to call directly, without further explaining work, and the running speed is very fast. Moreover, the downloaded program can not only be used as the data that the system needs to maintain, but also can be used as the expansion of the underlying operating system.
本发明可以应用于SIM、UIM等各种用户识别模块中。The present invention can be applied to various subscriber identification modules such as SIM and UIM.
Claims (20)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005100770375A CN100378663C (en) | 2005-06-15 | 2005-06-15 | Method, system and module for dynamically downloading application program to subscriber identity module |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CNB2005100770375A CN100378663C (en) | 2005-06-15 | 2005-06-15 | Method, system and module for dynamically downloading application program to subscriber identity module |
Publications (2)
Publication Number | Publication Date |
---|---|
CN1687899A CN1687899A (en) | 2005-10-26 |
CN100378663C true CN100378663C (en) | 2008-04-02 |
Family
ID=35305940
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CNB2005100770375A Active CN100378663C (en) | 2005-06-15 | 2005-06-15 | Method, system and module for dynamically downloading application program to subscriber identity module |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN100378663C (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101111032B (en) * | 2007-08-31 | 2010-12-29 | 中兴通讯股份有限公司 | Method and system for downloading software |
CN101588642A (en) * | 2008-05-21 | 2009-11-25 | 广州盛华信息技术有限公司 | Subscriber identity model and handheld device |
CN101771680B (en) * | 2008-12-29 | 2013-03-13 | 中国移动通信集团公司 | Method for writing data to smart card, system and remote writing-card terminal |
US8538480B2 (en) | 2010-03-30 | 2013-09-17 | Qualcomm Incorporated | Methods and apparatus for device applet management on smart cards |
CN103309758B (en) * | 2012-03-15 | 2016-01-27 | 中国移动通信集团公司 | A kind of mthods, systems and devices blocking application and download |
CN106371884B (en) * | 2016-09-18 | 2019-12-20 | 时瑞科技(深圳)有限公司 | Universal embedded loading application system and method |
CN108334282B (en) * | 2017-12-28 | 2021-07-09 | 宁德时代新能源科技股份有限公司 | Method and device for downloading program file of automobile electronic control unit |
CN108376080A (en) * | 2018-05-28 | 2018-08-07 | 郑州悉知信息科技股份有限公司 | A kind of method for updating program and device |
CN112379911B (en) * | 2020-11-10 | 2022-11-11 | 杭州万高科技股份有限公司 | Firmware module registration information processing method and system, storage medium and smart phone |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000031997A1 (en) * | 1998-11-20 | 2000-06-02 | Sonera Oyj | Method and system in a telecommunication system and subscriber identity module |
CN1281194A (en) * | 2000-08-23 | 2001-01-24 | 大唐电信科技股份有限公司微电子分公司 | Implementation method for downloading dynamic e-commerce menu on the basis of mobile telephone with short message service |
CN1345154A (en) * | 2001-11-08 | 2002-04-17 | 大唐微电子技术有限公司 | Air download method of increment business of user identifying module |
CN1348298A (en) * | 2001-11-27 | 2002-05-08 | 协马(北京)信息技术有限公司 | Implementation method and system for radio value-adding business based on short message service |
-
2005
- 2005-06-15 CN CNB2005100770375A patent/CN100378663C/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2000031997A1 (en) * | 1998-11-20 | 2000-06-02 | Sonera Oyj | Method and system in a telecommunication system and subscriber identity module |
CN1281194A (en) * | 2000-08-23 | 2001-01-24 | 大唐电信科技股份有限公司微电子分公司 | Implementation method for downloading dynamic e-commerce menu on the basis of mobile telephone with short message service |
CN1345154A (en) * | 2001-11-08 | 2002-04-17 | 大唐微电子技术有限公司 | Air download method of increment business of user identifying module |
CN1348298A (en) * | 2001-11-27 | 2002-05-08 | 协马(北京)信息技术有限公司 | Implementation method and system for radio value-adding business based on short message service |
Non-Patent Citations (3)
Title |
---|
OTA技术在手机卡菜单更新中的应用研究. 张岩,高立新.邮电设计技术,第1卷. 2004 * |
基于短消息的OTA技术及其测试. 周鹏.电术网技术,第11卷. 2004 * |
空中下载服务器的通用性研究. 范春晚,绉俊伟,王骥,孙宝文.微型机与应用,第4卷. 2004 * |
Also Published As
Publication number | Publication date |
---|---|
CN1687899A (en) | 2005-10-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109033360B (en) | Data query method, device, server and storage medium | |
CN103607428B (en) | A kind of method and apparatus for accessing shared drive | |
CN109542964B (en) | Data calling method and data calling system | |
CN103458004B (en) | Internet of things equipment CAMEL-Subscription-Information variation and equipment | |
CN111095199B (en) | Application loading method and terminal equipment | |
CN103874051A (en) | Internet of Things preset resource processing method and device | |
CN106326499B (en) | A kind of data processing method and device | |
CN100378663C (en) | Method, system and module for dynamically downloading application program to subscriber identity module | |
CN109842621A (en) | A kind of method and terminal reducing token storage quantity | |
CN110688201B (en) | Log management method and related equipment | |
CN113014510A (en) | Data caching method and device in distributed test of inertial navigation system | |
CN108228476B (en) | Data acquisition method and device | |
CN101510156B (en) | Information system resource recovery method and device | |
CN109246280B (en) | Address book cloud processing method and device, computer equipment and readable storage medium | |
CN108228842B (en) | Docker mirror image library file storage method, terminal, device and storage medium | |
CN101404797B (en) | Storage method, storage management apparatus and storage system for long and short messages | |
CN109857553A (en) | EMS memory management process and device | |
US7778660B2 (en) | Mobile communications terminal, information transmitting system and information receiving method | |
CN111078233B (en) | Application promotion realization method, device, equipment and storage medium | |
CN101997977A (en) | Method and device for enabling mobile terminal and smart card to be compatible with different network systems | |
KR100943779B1 (en) | How to Access a Contact Card of a Mobile Terminal from Another Mobile Terminal | |
CN112422995A (en) | System for reducing flow cost and working method | |
CN113342270A (en) | Volume unloading method and device and electronic equipment | |
CN100383738C (en) | Programme dynamic loading device and method for portable terminal | |
CN112887958A (en) | Data storage method, storage medium and terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
EE01 | Entry into force of recordation of patent licensing contract |
Application publication date: 20051026 Assignee: Beijing Datang Smart Card Co., Ltd. Assignor: Datang Microelectronics Technology Co., Ltd. Contract record no.: 2016110000008 Denomination of invention: Method, system and module for dynamic downloading of applied programe to user identification Granted publication date: 20080402 License type: Common License Record date: 20160422 |
|
LICC | Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model |