Search Images Maps Play YouTube News Gmail Drive More »
Sign in
Screen reader users: click this link for accessible mode. Accessible mode has the same essential features but works better with your reader.


  1. Advanced Patent Search
Publication numberCN1659548 A
Publication typeApplication
Application numberCN 03812644
PCT numberPCT/US2003/020050
Publication date24 Aug 2005
Filing date25 Jun 2003
Priority date17 Jul 2002
Also published asCA2491731A1, CA2491731C, CN100428228C, EP1522031A2, EP1522031B1, US6941310, US20040015504, WO2004010305A2, WO2004010305A3
Publication number03812644.3, CN 03812644, CN 1659548 A, CN 1659548A, CN-A-1659548, CN03812644, CN03812644.3, CN1659548 A, CN1659548A, PCT/2003/20050, PCT/US/2003/020050, PCT/US/2003/20050, PCT/US/3/020050, PCT/US/3/20050, PCT/US2003/020050, PCT/US2003/20050, PCT/US2003020050, PCT/US200320050, PCT/US3/020050, PCT/US3/20050, PCT/US3020050, PCT/US320050
InventorsR阿哈德, J蒋, O科伯威, R普拉卡萨, S瑞曼
Export CitationBiBTeX, EndNote, RefMan
External Links: SIPO, Espacenet
System and method for caching data for a mobile application
CN 1659548 A
Abstract  translated from Chinese
一种缓存表包括一组访问参数和一组数据列。 Of the cache table includes a set of access parameters and a set of data columns. 缓存表的一个或多个实例存储在移动计算设备上。 A cache table or more instances stored in the mobile computing device. 每个实例包括自变量(访问参数的独特的一组值)和结果集(数据列的一组值)。 Each instance includes an argument (a set of values unique access parameters) and the result set (a set of values data column). 这样,在结果集中的每个结果包括自变量和相应的列值。 Thus, including the arguments and the corresponding column values in the result set for each result. 缓存的结果集有指定的有效期,其在变成无效之后可能是可用的或可能是不可用的。 Cached result set has a specified validity period, which became invalid after may be available or may be unavailable. 可以使用有效的缓存数据而不管是否有可用的到数据源(例如,数据或应用服务器)的连接。 You can use a valid cached data regardless of whether there is available to the data source (for example, data or application server) connections. 如果没有可用的到数据源的连接,无效数据则可以使用一段时间。 If no connection to the data source, invalid data can be used for some time. 可以从数据源选择性地更新缓存表中的数据,而不用同步整个的本地数据库。 You can selectively update data cache table from the data source, rather than to synchronize the entire local database.
Claims(44)  translated from Chinese
1.一种便于在用不连续的可用通信链路连接到数据源的移动计算设备上缓存来自数据源的数据的方法,包括:在移动计算设备上的数据库中配置缓存表,其中所述缓存表包括:访问参数,包括在数据源上的数据集的第一组列;结果列,包括与数据集的第一组列不同的数据集的第二组列;在数据库内产生所述缓存表的一个或多个实例,其中每一个所述缓存表的实例包括一组行,其中每一个所述行包括:自变量,所述自变量包括访问参数的每一列的值;和结果集,包括结果列的每一列的值,其中,在一组行中的每一行包括相同的自变量。 An easy to cache data from a data source with a discontinuous in the available communication link to the data source, mobile computing devices, comprising: a mobile computing device configured on the database cache table in which the cache Table include: access parameters, including the data source data set first set of columns; the results are shown, including a first set of columns of different data sets and data set of the second set of columns; creating the cache tables in a database One or more instances where each instance of the cache table includes a set of rows, wherein each of said line comprising: argument, since the value of each column of the variables include access parameters; and the result set, including The results are given values for each column, where each row in a set of rows comprises the same arguments.
2.如权利要求1所述的方法,进一步包括:对于每一个所述缓存表的实例,存储一个或多个参数,用于确定所述缓存表实例的所述结果集是否可以用于数据操作。 2. The method of claim 1, further comprising: for each instance of the cache table stores one or more parameters, for determining whether the result set of the cache table can be used for data manipulation examples .
3.如权利要求2所述的方法,其中所述参数包括表示何时从数据源接收到所述结果集的响应日期。 The method as claimed in claim 2, wherein the parameters include indicates when a response is received from the data source to the date of the result set.
4.如权利要求2所述的方法,其中所述参数包括表示何时在数据源最后修改所述结果集的最后修改日期。 4. The method of claim 2, wherein the parameters comprise a data source indicates when the last modification date of the last modification of the result set.
5.如权利要求2所述的方法,其中所述参数包括被配置以表示在其期间所述结果集是有效的第一个时段的使用期限参数;其中所述结果集在所述第一个时段的末尾变成无效的。 5. The method of claim 2, wherein said parameter includes being configured to indicate the results during its lifetime parameter set is valid first period; wherein the result of said first set the end of the period become invalid.
6.如权利要求5所述的方法,其中如果所述结果集是有效的,则所述结果集用于所述数据操作,而不管不连续的可用通信链路是否是可用的。 6. The method of claim 5, wherein if the result set is valid, then the result set of data for the operation, regardless of discontinuous available communication link is available.
7.如权利要求5所述的方法,其中只有当所述结果集是无效时,从数据源检索所述结果集的替换结果集。 7. The method of claim 5, wherein only when the result set is invalid, from the data source to retrieve the result set to replace the result set.
8.如权利要求5所述的方法,其中只有当所述结果集是无效时,从数据源检索所述结果集的更新。 8. claim wherein only when the result set is invalid, from the data source to retrieve the result set updating method according to claim 5,.
9.如权利要求5所述的方法,其中所述参数包括被配置以表示跟在所述第一个时段之后的第二个时段的失时效参数,在第二个时段期间所述结果集是可用的;和其中所述结果集在所述第二个时段的末尾变成失时效的。 9. The method according to the claim, wherein the parameter includes being configured to represent the parameters with stale after the first period of the second period, during the second period of the result set available; and wherein the result set at the end of the second period become stale in.
10.如权利要求9所述的方法,其中如果所述结果集是可用的并且不连续的可用通信链路是不可用的,则所述结果集被用于所述数据操作。 10. The method of claim 9, wherein if the result set is available and not available continuous communications link is unavailable, then the result set is used for the data operation.
11.如权利要求9所述的方法,进一步包括:接收涉及第一个缓存表实例的第一个数据操作,和如果:(a)所述第一个缓存表实例的所述结果集是有效的;或(b)所述第一个缓存表实例的所述结果集是无效的并且:(1)所述第一个缓存表实例的所述结果集是可用的;和(2)不连续的可用通信链路是不可用的;则使用所述第一个缓存表实例的所述结果集。 11. The method of claim 9, further comprising: receiving the first data relates to the first operation example of the cache table, and if: the result set (a) the first instance of a cache table is valid ; or the result set (b) of the first cache table instance is invalid and: the (1) the first instance of a cache table result set is available; and (2) are not continuous available communication link is unavailable; the result set using the cache table first instance.
12.如权利要求11所述的方法,进一步包括:只有当所述第一个缓存表实例的所述结果集是无效时,为所述第一个缓存表实例的所述结果集检索更新。 12. A method as claimed in claim 11, further comprising: Only when the result set is the first instance of a cache table is invalid, as the first instance of a cache table update the result set retrieval.
13.如权利要求11所述的方法,进一步包括:只有当所述第一个缓存表实例的所述结果集是无效时,为所述第一个缓存表实例的所述结果集检索替换结果集。 13. A method as claimed in claim 11, further comprising: Only when the result set is the first instance of a cache table is invalid, as the first instance of a cache table to replace the result set retrieval results set.
14.如权利要求11所述的方法,进一步包括:如果:所述第一个缓存表实例的所述结果集是无效的;所述第一个缓存表实例的所述结果集是失时效的;且不连续的可用通信链路是不可用的,则显示错误。 14. The method of claim 11, further comprising: if: the first instance of the result set caching table is invalid; the first table of the result set caching is stale instances of ; and discontinuous available communication link is unavailable, an error is displayed.
15.如权利要求1所述的方法,其中所述数据集是数据库表和视图中的一个。 15. The method of claim 1, wherein the data sets are database tables and views in one.
16.一种存储指令的计算机可读存储介质,当所存指令由计算机执行时,引起计算机执行便于在用不连续的可用通信链路连接到数据源的移动计算设备上缓存来自数据源的数据的方法,该方法包括:在移动计算设备上的数据库中配置缓存表,其中所述缓存表包括:访问参数,包括在数据源上的数据集的第一组列;结果列,包括与数据集的第一组列不同的数据集的第二组列;在数据库内产生所述缓存表的一个或多个实例,其中每一个所述缓存表的实例包括一组行,其中每一个所述行包括:自变量,所述自变量包括访问参数的每一列的值;和结果集,包括结果列的每一列的值,其中,在一组行中的每一行包括相同的自变量。 16. A computer-readable storage medium storing instructions that, when executed by a computer stored, causing a computer to execute the move with discontinuous available communication link to the data source computing device to buffer data from the data source to facilitate the , the method comprising: a computing device configured on the database cache table in Mobile, where the cache table include: access parameters, including source data set on a first set of columns; results are presented, including data collection The first set of columns in the second group of columns of different data sets; generating one or more instances of the cache table in the database, where each instance of the cache table includes a set of rows, wherein each of said line comprises : argument, the argument includes access parameter values of each column; and the result set, including the value of each column of the result columns, where each row in a set of rows comprises the same arguments.
17.一种便于在不连续地连接到数据服务器的移动计算设备上缓存数据的方法,该方法包括:识别在数据服务器上的一个或多个逻辑数据表;对于每一个逻辑数据表,维持表数据处理器,其被配置以提供从移动计算设备到逻辑表的访问;在数据服务器上接收来自移动计算设备的自变量,其中自变量包括第一逻辑表的一个或多个列的值;识别第一逻辑表的一组行,其中该组行中的每一行包含所述自变量;过滤该组行,其中所述过滤包括:排除自上次从移动计算设备接收自变量以来还没有被修改的任何行;和从行中去掉与所述自变量相对应的一个或多个列;和把过滤的一组行返回到移动计算设备,响应所述自变量。 17. A method of facilitating on a non-continuously connected to a data server cache data mobile computing device, the method comprising: identifying data server on one or more logical data tables; for each logical data tables, maintain table data processor, which is configured to provide a computing device from a mobile to access the logical table; receiving arguments from the mobile computing device on the data server, which includes the value of the argument one or more columns of the first logical table; identifying a set of rows of the first logic table, wherein the set of rows each row contains the argument; filtering the set of rows, wherein the filter comprises: Exclude since the last calculation from the mobile device has not been modified since receiving arguments Any row; and remove the independent variable corresponding to one or more columns from the row; and a set of filtering the return to the mobile computing device in response to the argument.
18.一种存储指令的计算机可读存储介质,当所存指令由计算机执行时,引起计算机执行一种便于在不连续地连接到数据服务器的移动计算设备上缓存数据的方法,该方法包括:识别在数据服务器上的一个或多个逻辑数据表;对于每一个逻辑数据表,维持表数据处理器,其被配置以提供从移动计算设备到逻辑表的访问;在数据服务器上接收来自移动计算设备的自变量,其中自变量包括第一逻辑表的一个或多个列的值;识别第一逻辑表的一组行,其中该组行中的每一行包含所述自变量;过滤该组行,其中所述过滤包括:排除自上次从移动计算设备接收自变量以来还没有被修改的任何行;和从行中去掉与所述自变量相对应的一个或多个列;和把过滤的一组行返回到移动计算设备,响应所述自变量。 18. A computer-readable storage medium storing instructions that when executed by a computer stored, causing a computer to perform a method on a non-continuously connected to a data server mobile computing device to facilitate data cache, the method comprising: identifying on the data server to one or more logical data tables; for each logical data tables, maintain table data processor is configured to provide a computing from mobile devices to access the logical table; receiving mobile computing devices from the data server The argument, which argument includes the value of one or more columns in a first logical table; identifying a first logical table a set of rows, wherein the set of rows in each row contains the argument; filtering the set of rows, wherein the filter comprises: Exclude any rows since the last since the mobile computing device receives the argument has not been modified; and remove one or more columns with the corresponding argument from the line; and the filter of a set of rows returned to the mobile computing device in response to the argument.
19.一种在移动计算设备上缓存数据的方法,其中移动计算设备通过不连续的可用无线链路可连接到数据源,该方法包括:接收涉及在移动计算设备上缓存的第一组数据的第一个操作;确定所述第一组数据是否是有效的;如果所述第一组数据是无效的,确定所述不连续的可用无线链路是否是可用的;如果所述第一组数据是无效的并且所述不连续的可用无线链路是不可用的,确定所述第一组数据是否是可用的;和只有当:所述第一组数据是无效的;和所述不连续的可用无线链路是可用的时候,从数据源检索用于所述第一组数据的更新。 19. A method of calculating the cached data in a mobile device, wherein the mobile computing device discontinuous available wireless link to connect to a data source, the method comprising: receiving in a mobile computing device a first set of data cache The first operation; determining whether the first set of data is valid; if the first set of data is invalid, determining the discontinuous available radio link is available; if the first set of data is invalid and the non-contiguous free wireless link is unavailable, determining whether the first set of data is available; and only when: the first set of data is invalid; and the discontinuous It can be used when the wireless link is available, retrieving a first set of data from the data source for the updating.
20.如权利要求19所述的方法,进一步包括:确定所述第一组数据是否由第一事务处理锁定;其中所述第一个操作是由所述第一事务处理发起的。 20. The method of claim 19, further comprising: determining whether the first set of data is locked by the first transaction; wherein said first operation is initiated by the first transaction.
21.如权利要求19所述的方法,进一步包括:确定活动游标是否由第一事务处理在所述第一组数据上打开;其中所述第一个操作是由第一事务处理发起的。 21. The method of claim 19, further comprising: determining whether to process the first active cursors transaction open on the first set of data; wherein the first operation is initiated by the first transaction.
22.如权利要求19所述的方法,其中确定所述第一组数据是否是有效的包括:访问与所述第一组数据相关联的有效性参数,其中所述有效性参数被配置以表示所述第一组数据变为无效时的第一时间;和比较所述第一个操作的时间和所述第一时间;其中所述第一组数据在所述第一时间之前是有效的。 22. The method of claim 19, wherein said first set of data to determine whether it is valid comprises: accessing the validity of the parameters associated with the first set of data, wherein the parameter is configured to indicate the validity of The first set of data becomes invalid when the first time; and comparing the first operation time and the first time; wherein the first set of data prior to the first time to be effective.
23.如权利要求22所述的方法,其中确定所述第一组数据是否是可用的包括:访问与所述第一组数据相关联的失时效参数,其中所述失时效参数被配置以表示在所述第一时间之后的当所述第一组数据变为失时效时的第二时间;比较所述第一个操作的时间和所述第二时间;其中所述第一组数据在所述第一时间与所述第二时间之间是可用的。 23. The method of claim 22, wherein determining whether the first set of data is available include: stale Parameter access with the first set of data associated with the stale arguments which are configured to represent When the first time after the first set of data becomes stale when the second time; the time comparing the first operation and the second time; wherein the first set of data in the between said first time and said second period of time is available.
24.如权利要求19所述的方法,进一步包括,在所述接收第一个操作之前:在移动计算设备上配置用于缓存数据的缓存表,数据包括所述第一组数据,其中所述缓存表由:包括在数据源上的数据集的第一组列的一组访问参数;和该数据集的第二组列来定义。 24. The method of claim 19, further comprising, prior to said receiving the first operation: the mobile computing device configured to cache data in the cache table, the data comprising a first set of data, wherein said cache table consists of: on the data source including data set of the first set of columns in a set of access parameters; and a second set of columns in the data set defined.
25.如权利要求24所述的方法,进一步包括,在所述接收第一个操作之前:产生所述缓存表的一个或多个实例,其中每一个所述缓存表的实例包括:自变量,包括所述访问参数组的独特的一组值;和结果集,包括所述第二组列的值,其中,所述第一组数据包括第一个缓存表实例的第一个结果集。 25. The method of claim 24, further comprising, prior to said receiving first operation: generating a table of said cache or more instances, wherein each instance of the cache table include: independent variables, including a unique set of values the access parameter group; and the result set, including a second set of column values, wherein the first set of data including the first result set cache table first instance.
26.如权利要求19所述的方法,进一步包括:如果:所述第一组数据是有效的;或所述第一组数据是无效的,并且所述不连续的可用无线链路是不可用的且所述第一组数据是可用的,则所述第一组数据用于所述第一个操作。 26. The method of claim 19, further comprising: if: the first set of data is valid; or the first set of data is invalid, and the available discontinuous radio link is unavailable and said first set of data is available, then the first set of data for the first operation.
27.一种存储指令的计算机可读存储介质,当指令由计算机执行时,引起计算机执行一种在移动计算设备上缓存数据的方法,其中移动计算设备通过不连续的可用无线链路可连接到数据源,该方法包括:接收涉及在移动计算设备上缓存的第一组数据的第一个操作;确定所述第一组数据是否是有效的;如果所述第一组数据是无效的,确定所述不连续的可用无线链路是否是可用的;如果所述第一组数据是无效的并且所述不连续的可用无线链路是不可用的,确定所述第一组数据是否是可用的;和只有当:所述第一组数据是无效的;和所述不连续的可用无线链路是可用的时候,从数据源检索所述第一组数据的更新。 27. A computer-readable storage medium storing instructions that, when executed by a computer, cause the computer to execute a data cache on a mobile computing device, wherein the mobile computing device via a wireless link available discontinuity can be connected to data source, the method comprising: receiving a first operation involving the mobile computing device of a first set of data cache; determining whether the first set of data is valid; if the first set of data is not valid, determine the non-contiguous free wireless link is available; if the first set of data is invalid and the non-contiguous free wireless link is unavailable, determining whether the first set of data is available ; and only when: the first set of data is invalid; and the non-contiguous free wireless link is available, the update from the data source to retrieve the first set of data.
28.一种用于在移动设备上缓存数据的数据库,该数据库包括:一个缓存表,由:与通过无线通信连接可访问的数据源的第一组属性相对应的一组访问参数;和该数据源的第二组属性定义;其中该数据库通过无线通信连接不连续地连接到中央数据源;和所述缓存表的一个或多个实例,其中每个所述缓存表的实例包括:自变量,所述自变量包括所述访问参数的独特的一组值;和结果集,包括所述第二组属性的值;和对于每一个所述缓存表的实例,用于确定在其期间所述结果集在移动设备上是可用的时段的信息。 28. A method for database on a mobile device cached data, the database includes: a cache table by: a first set of attributes and connections can be accessed via wireless communication data source corresponding set of access parameters; and the The second set of properties defining the data source; wherein the database connection is not continuously connected to the central data source via wireless communication; and one of the cache table or more instances where each instance is the cache table include: Argument the argument includes a unique set of parameter values of the access; and the result set, including the value of the second set of attributes; and for each instance of the cache table for determining during which the the result set of information on mobile devices is available period.
29.如权利要求28所述的数据库,其中,在其期间所述结果集是可用的时段包括:在其期间所述结果集是有效的第一时段。 29. The database according to claim 28, wherein said set of results is available during its period comprising: the result set is valid during its first period.
30.如权利要求29所述的数据库,其中,所述数据库被配置以在所述第一时段期间不从中央数据源检索所述结果集。 30. The database according to claim 29, wherein the database is configured to not retrieved from the central data source during the first period of the result set.
31.如权利要求29所述的数据库,其中,在其期间所述结果集是可用的所述时段进一步包括:在其期间所述结果集是无效的但还没有失时效的第二时段;其中所述第二时段紧接着第一时段。 31. The database according to claim 29, wherein the result of the period during which the set is available further comprises: during which the result set is invalid, but not beneath the second aging period; wherein followed by the second period the first period.
32.如权利要求31所述的数据库,其中所述结果集在所述第二时段之后是不可由数据库事务处理使用的,除非:所述结果集被该数据库事务处理锁定;或该数据库事务处理有在所述结果集上打开的活动游标。 Or the database transaction processing; the result set is the database transaction locks: 32. The database of claim 31, wherein the result set after the second period is not used by the database transaction processing, unless There on the result set of activities open cursors.
33.如权利要求28所述的数据库,其中所述信息包括:被配置以表示何时所述结果集变为无效的第一参数;和被配置以表示何时所述结果集变为失时效的第二参数。 33. The database according to claim 28, wherein the information comprises: a first parameter is configured to indicate when the result set becomes invalid; and configured to indicate when the result set becomes stale a second parameter.
34.如权利要求28所述的数据库,进一步包括:被配置以在把操作发送到数据源之前在所述一个或多个缓存表实例上存储操作的队列;其中,当通过无线通信连接不可访问数据源时,所述操作存储在所述队列中。 34. The database of claim 28, further comprising: means configured to queue before sending operations to the data source on the one or more cache table instance storage operation; wherein, when the connection is not accessible by wireless communication When a data source, the operation is stored in the queue.
35.一种用于在通过无线链路可连接到中央数据源的移动计算设备上缓存数据的系统,包括:被配置以选择性地相对于中央数据源以联机模式或脱机模式操作的数据库;在该数据库内,由:一组对应于数据源的第一组属性的访问参数;和中央数据源的第二组属性定义的缓存表,在该数据库内,所述缓存表的一个或多个实例,其中所述缓存表的实例包括:自变量,包括所述访问参数中每一个的值;和一组结果,其中每一个所述结果包括数据源的所述第二组属性中每一个的值;和对于每一个所述缓存表的实例,用于确定所述结果集是否是可用的信息。 35. A system for computing devices cached data in a mobile can be connected via a wireless link to a central data sources, including: configured to selectively with respect to the central data source database in online mode or offline mode of operation ; in the database by: a set of access parameters correspond to the first set of attributes data source; and a central data source a second set of attributes defined cache table in the database, the cache of a table or instance, the instance wherein the cache table comprises: independent variables, including the values of each of the access parameters; and a set of results, wherein each of said data source comprises the result of each of the second set of properties values; and for each instance of the cache table for determining whether the result set is available information.
36.如权利要求35所述的系统,其中用于所述第一缓存表实例的第一结果集的所述信息包括:响应日期参数,其被配置以表示何时从数据源向数据库最后一次提供所述第一结果集;最后修改日期参数,其被配置以表示所述第一结果集何时在数据源上最后一次被修改;使用期限参数,其被配置以表示在其期间所述第一结果集是有效的第一时段,其中如果所述第一结果集是有效的,则所述结第一果组是可用的;和失时效参数,其被配置以表示在所述第一时段期满时开始的第二时段,在第二时段期间所述第一结果集可能是可用的。 36. The system of claim 35, wherein the first cache table information for the first instance of the result set comprises: responsive date parameter, which is configured to indicate when the data from the source database to the last The results provide the first set; the last modified date parameter, which is configured to represent the first result set when it was last modified in the data source; life parameters, which are configured to indicate during which the first a result set is effective the first period, wherein if the first result set is valid, then the bear first fruit set is available; and stale parameters configured to represent in the first period the start of the second period expires, during the second period of the first result set may be available.
37.如权利要求36所述的系统,其中:涉及第一缓存表实例的第一个操作在时间O被接收;所述第一时段在时间V结束;所述第二时段在时间U结束;和如果:O早于V,或O晚于V,O早于U,且所述数据库是相对于数据源以脱机模式操作的,则所述结果集对于所述第一个操作是可用的。 37. The system of claim 36, wherein: a first cache table relates to the first example of the operation is received in time O; the end of the first period of time V; the second time period at the end of the U; and if: O earlier in V, or if O later than the V, O early in U, and the database is relative to the data source to the offline mode of operation, then the result set to the first operation is available .
38.如权利要求35所述的系统,其中,只有当:所述第一结果集不存在于数据库中;或所述第一结果集存在于数据库中,但是不可用时,所述数据库相对于中央数据源以联机模式操作以接收第一缓存表实例的第一结果集。 38. The system of claim 35, wherein only when: the first result set does not exist in the database; or the first result set exists in the database, but is unavailable, the database relative to the center Online mode data source to the first result set to receive the first cache table instance.
39.如权利要求35所述的系统,其中;如果所述第一缓存表实例的第一结果集是有效的,所述数据库在涉及所述第一缓存表实例的操作过程中以脱机模式操作,而不管到中央数据源的无线链路是否是可用的。 39. The system of claim 35, wherein; the first cache table if the first example of the result set is effective, during operation of the database relates to the first cache table instance in offline mode operation, and regardless of whether the central data source to the radio link is available.
40.一种用于在移动计算设备上缓存数据的系统,其中移动计算设备被配置用于不连续地连接到中央数据源,该系统包括:缓存表,被配置以在移动计算设备上缓存来自中央数据源的数据;在所述缓存表中的一个或多个项,每一个所述项包括来自中央数据源的一组数据;有效性参数,对于在所述缓存表中的每一个项,用于确定在其期间所述数据组是有效的时段;可用性参数,对于在所述缓存表中的每一个项,用于确定在其期间所述数据组是有效的所述时段之后所述数据组是否可用;和通信模块,被配置以不连续地连接移动计算设备到中央数据源。 40. A computing device cache data systems in mobile, where mobile computing device is configured to not continuously connected to the central data source, the system comprising: a cache table is configured to cache from the mobile computing device Data center data sources; one or more items in the cache table, each of the items include a set of data from the central data source; the effectiveness of parameters, each for a term in the cache table, means for determining during which the data set is a valid period; availability parameters, in the cache table for each item, for determining during which the data set is valid after the period of the data group is available; and a communication module configured to discontinuously connect the mobile computing device to a central data source.
41.如权利要求40所述的系统,其中所述有效性参数被配置以识别所述数据组变为无效时的第一时间;其中,在所述第一时间以前,所述数据组被用于涉及所述缓存表项目的操作,而不管移动计算设备是否连接到中央数据源。 41. The system of claim 40, wherein the validity of the parameters being configured to identify the first data set becomes invalid; and wherein, at the first time before the data set is used It relates to the operation of the cache table entry, regardless of the mobile computing device is connected to a central data source.
42.如权利要求42所述的系统,其中所述可用性参数被配置以识别所述数据组变为失时效时的第二时间;其中,在所述第一时间之后和所述第二时间之前,只有当移动计算设备没有连接到中央数据源时,所述数据组被用于涉及所述缓存表项目的操作。 Wherein, after said first time and said second time before; 42. The system of claim 42, wherein said availability parameter is configured to identify the second time data set becomes stale when Only when the mobile computing device is not connected to a central data source, the data set is used to operate the cache table relates to items.
43.如权利要求40所述的系统,其中所述通信模块被配置以为了每次一个缓存表项操作的最大值把移动计算设备连接到中央数据源。 43. The system according to claim 40, wherein the communication module is configured that each time a cache entry operation to the maximum value of the mobile computing device connected to a central data source.
44.如权利要求43所述的系统,其中对于涉及有效的缓存表项目的操作,移动计算设备不连接到中央数据源。 44. The system according to claim 43, wherein the operation involves an effective cache table entries, the mobile computing device is not connected to a central data source.
Description  translated from Chinese
为移动应用缓存数据的系统和方法 A system and method for mobile application cache data

技术领域 Technical Field

本发明涉及计算机系统领域。 The present invention relates to the field of computer systems. 更特别地,本发明提供用于在移动设备上缓存数据的系统和方法。 More particularly, the present invention provides a system and method for caching data on the mobile device used.

背景技术 Background

在移动设备上(例如膝上型计算机、个人数字助理、移动电话)运行的应用通常已经被设计用于联机使用或者脱机使用。 On mobile devices (such as laptop computers, personal digital assistants, mobile phone) running applications typically have been designed for use online or offline. 两种类型的移动应用倾向于使用浏览器的某种形式与用户交互。 Two types of mobile applications tend to use some form of browser and user interaction. 联机应用喜欢连续访问企业服务器(例如,中央数据库服务器)。 Online applications like continuous access to enterprise servers (for example, a central database server). 相反,脱机应用操作与企业服务器有最少的或者没有接触。 Instead, offline application operations and enterprise servers have minimal or no contact.

更特别地,只要需要,联机移动应用就能访问企业服务器上的数据,从而可能不需要在本地存储数据。 More specifically, as long as necessary, on-line mobile application can access data on the server, which may not need to store data locally in. 然而,由于联机移动应用的“总是连接的”的特性,连接费用(例如,用于无线发射时间)相当高。 However, due to the nature "always connected" online mobile applications, connection charges (for example, for wireless transmission time) is quite high.

同样,联机移动应用通常要忍受无法预测的等待时间。 Similarly, online mobile applications often have to endure unpredictable waiting time. 当联机应用向服务器发送请求时,除了在服务器上的任何拥塞外,响应时间还取决于移动设备的无线网络的使用水平。 When the online application sends a request to the server, in addition to any congestion on the server, the response time also depends on the level of the mobile device's wireless network. 此外,取决于无线网络的范围,联机应用的使用可能受地域限制,且在一些位置可能是被禁止的(例如,飞机、医院)。 In addition, depending on the wireless network using a range of online applications may be subject to geographical restrictions, and in some locations may be prohibited (such as aircraft, hospitals).

更进一步,联机移动应用经常访问成组的数据,例如,整个网页、数据表等等。 Furthermore, online access mobile applications often grouped data, for example, the entire page, data tables, and so on. 当数据项需要替换时,可能替换整个数据集而不是仅仅替换一个项。 When a data item needs to be replaced, the entire data set may replace rather than merely replace an item. 这会效率低且增加操作应用的成本。 This will increase the efficiency and lower the cost of operating the application.

移动应用倾向于访问成组数据(例如,整个网页)的一个原因是数据紧紧地与数据显示相结合。 Mobile applications tend to access a set of data (for example, the entire page) One reason is data tightly integrated with data. 特别地,当为移动应用拷贝或下载数据到客户设备上时,每个数据集合(例如,表、一组数据库的行或者字段)典型地在将在显示该数据集合的页面内传送。 In particular, when the mobile application copy or download the data to the client device, each data set (eg, tables, rows, or a set of database fields) is typically within the page will display the data set transfer. 这样,除了能在那个网页内显示,数据不能在客户端显示。 Thus, in addition can be displayed within the web page, the data can not be displayed on the client. 因为每个数据组或者集合可能用完整的显示页面存储,并且除了它们封装的数据以外许多页面可能是一样的,所以可能浪费在客户端上的许多存储空间。 Since each data set or a set of possible display pages with complete storage, and in addition they encapsulate many pages of data may be the same, it may waste a lot of storage space on the client.

与联机应用形成对比,脱机移动应用不喜欢连续访问由企业服务器保持的数据。 In contrast with the online application, offline mobile applications do not like continuous access to data held by the enterprise server. 来自企业服务器的一些数据(例如,瞬像)可以拷贝到或者复制到移动设备上。 Some data from the enterprise server (for example, snapshots) can be copied to or copied to a mobile device. 虽然脱机应用可能总是可用的(例如,当从服务器脱机时),但它不总是有最新的数据,而且它只能访问拷贝给它的数据。 Although applications may always available offline (for example, when the server is offline), but it does not always have the most current data, and it can be accessed only copy data to it.

使用数据瞬像的脱机移动应用通常要求不时的或者定期的(例如,每天一次)把它存储的脱机数据与企业服务器同步。 Snapshot data offline using mobile applications often require from time to time or on a regular basis (for example, once a day) to offline data it stores and enterprise server synchronization. 同步的频率通常与在移动设备上访问或修改数据项的频率无关。 Synchronization frequency is usually nothing to do with the frequency of access or modify data items on a mobile device. 因此,可能使用失时效的数据在移动设备上执行许多事务处理或操作。 Therefore, the use of stale data may perform many transactions or operations on mobile devices. 同步可能引起高的开销,因为要经常交换大量的数据——即使是还没有改变的且不需要刷新的数据。 Synchronization may cause high overhead because often exchange large amounts of data - even if has not changed and does not need to refresh the data. 例如,即使在网页内只有一个数据项需要更新,也可能下载或者交换整个网页或者网页组。 For example, even if only one data item needs to be updated in the web page, it may be downloaded or exchange the entire page or set of pages.

由于数据同步不频繁,所以脱机移动应用不适合用于高度动态的数据。 Since the data synchronization is not frequent, so not suitable for off-line mobile application highly dynamic data. 此外,脱机移动应用经常需要保持所有由应用做的数据更改的事务日志,以便于同步。 Additionally, the offline mobile applications often need to keep all the transaction log data changes made by the application in order to synchronize.

通常,用于移动应用的存储在移动设备上的企业数据可能有不同的寿命。 Typically, enterprise mobile applications for storing data on a mobile device may have a different life. 一些数据点或项可能是长时期有效的(例如,产品描述、地址);其它数据点或项可能在仅仅相对短时期之后无效(例如,股票报价、货币兑换比率)。 Some of the data points or items may be prolonged and effective (for example, product description, address); other data points or items may after only a relatively short period of time is not valid (for example, stock quotes, currency exchange rate). 典型地不配置现有的移动应用和客户数据库来识别或考虑下载数据的寿命。 Typically, you do not configure existing mobile applications and customer databases to identify or consider life download data.

此外,那些尝试为用户提供重要功能的移动客户应用倾向于需要强有力的软件和/或硬件配置(例如,Java虚拟机、HTTP监听器、服务引擎)。 In addition, those who attempt to provide users with mobile client applications tend to require important features powerful software and / or hardware configuration (for example, Java virtual machine, HTTP listener service engine). 这样的需要避免了例如个人数字助理(PDA)或者智能电话一样的更小的、限制更多的客户设备的使用,也增加了客户操作的开销。 This avoids the need for such as a personal digital assistant (PDA) or a smart phone as a smaller, more limited use of the client device, the client also increases the cost of operation.


在本发明的一个实施例中,提供用于细粒度缓存数据的系统和方法,这些数据由在移动(例如,无线)设备上执行的应用使用,移动设备被配置用于第三代无线网络或其它企业网络。 In one embodiment of the present invention to provide a system and method for fine-grained cache data, the data from the mobile (eg, wireless) applications using mobile devices to perform on the device is configured for third-generation wireless network, or Other enterprise networks. 在这个实施例中,设备不需要总是访问数据的中央源或主源(例如,数据、网络或应用服务器)并且能在联机或脱机模式下使用缓存的数据。 In this embodiment, the device need not always access the data of the central source or primary sources (for example, data, network, or application server) and can use the cached data in online or offline mode. 在设备和数据源之间的传统的同步操作是不必要的,因为在移动设备上缓存的数据在需要的时候可以被选择地刷新。 Traditional synchronization between the device and the data source is not necessary, because the cached data on a mobile device when needed can be selectively refreshed. 因此,获得两种操作模式的好处(例如,刷新的数据、可接受的连接成本)。 Therefore, to obtain the benefits of two modes of operation (for example, refresh the data, acceptable connection costs).

在本发明的实施例中,数据在缓存表中缓存,缓存表被实现为移动设备的本地DBMS(数据库管理系统)的一部分。 In an embodiment of the present invention, the data in the cache table cache, cache is implemented as part of the local mobile device DBMS (database management system). 在这个实施例中,缓存表的内容在要求时从服务器检索并根据与内容相关联的缓存控制指令进行本地缓存。 In this embodiment, the contents of the cache table when the requirements of the local cache retrieved from the server and control instructions associated with the content based on the cache. 缓存表的列(或属性)的子集被指定为缓存表的“访问参数”。 Columns (or attributes) of a subset of the cache table is "Access Parameters" cache table is designated. 为了从缓存表检索数据,为访问参数中的每一个提供一个值。 To retrieve data from the cache table, provide a value for each parameter access. 这些值构成用于缓存表的一个实例的自变量。 These values constitute an argument for an instance of the cache table. 如果那些自变量值的行(或多个行)不在本地数据库中或者已经过期,DBMS会与相应的服务器联系以检索并缓存这些行。 Row (or rows) are not in the local database or has expired and if the value of those arguments, DBMS will contact to retrieve and cache the row with the corresponding server.

例如,如果缓存表被配置成报告关于不同仓库位置的库存数字,响应指定的零件号,缓存表的列可以包括零件号、仓库号、存储在相应仓库中的零件的数量。 For example, if the cache is configured to report on different warehouse locations inventories in response to specific part numbers, a column cache table may include part number, warehouse number, parts stored in the warehouse of the corresponding number. 被提供作为查询部分的零件号可以是缓存表的访问参数。 Is provided as part of the query parameter part number can be accessed cache table. 对于每一个唯一的零件号,缓存表的单独实例包括报告存储在每个仓库中的零件数量的一组行(结果集)。 For a single instance of each unique part number, cache table, including the number of parts of a set of rows (result set) reports stored in each warehouse.

在本发明的实施例中,通过在缓存表内封装数据缓存策略,数据缓存与应用逻辑分离。 In an embodiment of the present invention, by encapsulating data caching strategy in the cache table, the data cache and application logic separation. 这使应用开发者不需要把缓存策略编码成应用逻辑的一部分,并允许数据库管理者定义缓存策略。 This allows application developers do not need to be encoded into a part of the cache policy application logic and allow database administrators to define cache policies.

在本发明的另一个实施例中,提供了一种算法以定义缓存表的数据和事务型语义,其方式与数据库事务处理的ACID(原子性、一致性、孤立性和持久性)特性是一致的。 In another embodiment of the present invention, there is provided a method to cache table data definition and transactional semantics, ACID way as database transaction processing (atomicity, consistency, isolation and durability) properties are consistent a. 特别地,存储在缓存表中的数据有相关联的有效期,该有效期可以由数据来源的数据源指定。 In particular, the data stored in the cache table has an associated validity, the validity period can be specified by data source data source. 数据也可以有相关联的缓存控制信息,如果没有可用的到服务器的连接,该信息指出在变为无效之后数据是否可以使用和可以使用多久。 Data can also have the cache associated with the control information, if there is no available connection to the server, the information indicates whether the data can be used and can be used long after becomes invalid. 当本地数据库的操作影响缓存表时,应用该算法以确定是否使用缓存数据或是否尝试从数据源刷新数据。 When the operation of the local impact of the database cache table, the application of the algorithm to determine whether to use cached data or whether to try to refresh the data from the data source. 该算法可能考虑是否有可用的到数据源的连接、数据是否被同一个或者另一个事务处理锁定、数据是否是无效的、当数据无效时,相关联的缓存控制信息是否允许使用数据等等。 The algorithm may consider whether there is available to connect to the data source, the data is the same whether one or another transaction locks, whether the data is valid, when data is invalid, the cache control information associated with whether to allow the use of data and so on.

例证性地,本发明的实施例使移动设备和应用能够脱机访问本地数据并且在需要时选择性地刷新特定数据(例如,缓存表结果集)。 Illustrative, embodiments of the present invention enables mobile devices and applications to access local data offline and when you need to selectively refresh specific data (for example, cache table result set). 因此,连接成本(例如,到数据源)和对失时效数据的使用减到最少。 Therefore, the connection cost (for example, to the data source) and use of stale data is minimized. 由于缓存表是一个表,所有的移动数据库应用不必在应用逻辑中写额外的代码就能得到由缓存表提供的益处。 Since the cache table is a table, all the mobile database applications without having to write additional code in the application logic will be able to get the benefits provided by the cache table.

附图说明 Brief Description

图1是描述适合实现本发明实施例的移动计算环境的框图。 FIG. 1 is a block diagram of a mobile computing environment suitable for implementing an embodiment of the present invention.

图2是依照本发明实施例被配置在移动计算设备上缓存数据的客户设备框图。 FIG. 2 is configured on a mobile computing device data cache block diagram of a client device according to the present invention.

图3A-B包括图示依照本发明实施例的使用和刷新缓存表的一个方法的流程图。 Figures 3A-B comprises the use of the illustrated embodiment of the present invention and in accordance with a flow chart of a method of refreshing the cache table.

图4描述依照本发明实施例的配备有智能客户代理的移动客户设备。 Figure 4 depicts in accordance with an embodiment of the present invention have a smart client proxy mobile client devices.

图5A是演示依照本发明实施例在智能客户代理内操作分配器以处理请求页面的方法的流程图。 5A is a demonstration of a dispenser in accordance with an embodiment of the present invention a method to process the request page to a flowchart of operation of the smart client proxy.

图5B-C包括演示依照本发明实施例的脚本引擎可以在智能客户代理内组合页面的方法的流程图。 Figure 5B-C includes a flowchart Demonstration of pages that can be combined according to the script engine embodiment of the present invention within the smart client agent.

图6描述根据本发明一个实施例的缓存表。 According to the present invention, FIG 6 depicts an embodiment of a cache table.

图7-11演示根据本发明的一个实施例用于在操作缓存表的客户设备与和缓存表相关联的数据源之间通信的例证性形式。 Figure 7-11 demonstrates, according to one embodiment of the present invention is used in the exemplary form of communication between the operator and the client device cache table and data source associated cache table.


以下的描述使得本领域任何技术人员能够制造和使用本发明,且随后的描述是在本发明的特定应用和它们需要的环境下提供的。 The following description makes any person skilled in the art to make and use the invention, and the following description is in the specific application of the present invention and the environment they need to provide. 对公开实施例的各种修改对本领域技术人员来说很明显,且在不偏离本发明范围的情况下,这里定义的一般原理可以应用到其它实施例和应用中。 Various modifications of the disclosed embodiments of the skilled person is very obvious, and without departing from the scope of the present invention, the general principles defined herein may be applied to other embodiments and applications. 因此本发明并不打算限于显示出的实施例,而是与这里公开的原理和特征一致的最宽范围一致。 Therefore, the present invention is not intended to be limited to showing the embodiment, but the principles disclosed herein and consistent features the widest scope consistent.

在其中执行本发明当前实施例的程序环境结合了通用目的的计算机或者专用目的的设备例如移动计算机、PDA(个人数字助理)、电话等等。 In the implementation of the present invention, wherein an embodiment of the current program environment, or a combination of special purpose computer equipment such as a mobile computer, PDA (personal digital assistant), phone, etc. General purpose. 为了清楚,可以忽略对这种设备(例如,处理器、存储器、数据存储器、显示器)的详细描述。 For clarity, a detailed description of such devices (for example, a processor, memory, data storage, display) can be ignored.

也应该理解可以使用多种技术实现本发明的方法。 It should also be understood that a variety of techniques may be used to achieve methods of the invention. 例如,这里描述的方法可以在计算机系统上执行的软件中实现,或者在利用微处理器或其它特别设计的应用特定的集成电路、可编程逻辑设备的组合或它们的各种组合的硬件中实现。 For example, the software method described here can be executed on a computer system implemented, or implemented using a microprocessor or other specially designed application-specific integrated circuit, a combination of programmable logic devices, or various combinations of their hardware . 特别地,这里描述的方法可以通过驻留在适合的计算机可读介质上的一系列计算机可执行指令来实现。 In particular, the method described here can reside in a suitable computer-readable medium on a series of computer-executable instructions. 适合的计算机可读介质可以包括易失的(例如RAM)和/或永久的(例如ROM、磁盘)存储器、载波和传输介质(例如,铜线、同轴电缆、光纤介质)。 Suitable computer readable media may include volatile (e.g., RAM) and / or permanent (e.g., ROM, disk) storage, and carrier wave transmission media (e.g., copper wire, coaxial cable, fiber optic media). 典型的载波可以表现为沿着局域网、例如因特网一样的可公开访问的网络或者其它通信链路传导数字数据流的电的、电磁的或光信号形式。 A typical carrier can be expressed along the LAN, for example, or optical signals in the form of Internet-like network or other publicly accessible communications link digital data stream of electrical conduction of electromagnetic.

引言在本发明的一个实施例中,提供一种系统和方法用于在移动设备上细粒度缓存在该设备上执行的应用所使用的数据。 Introduction In one embodiment of the present invention, there is provided a system and method for fine-grained cache data on a mobile device used by the application executing on the device. 在这个实施例中,应用数据存储在包括一个或多个缓存表的数据库(例如DBMS)中,缓存表被配置以监控缓存数据的有效性和/或可用性。 In this embodiment, the application data stored in the database includes one or more of cache tables (such as DBMS), the cache is configured validity and / or availability to monitor the cached data.

在这个实施例中,缓存表不仅缓存一个或多个数据行,而且存储描述数据的有效性、在哪儿或怎样得到数据的新鲜拷贝等等的缓存控制信息,或者与这种缓存控制信息相关联。 In this embodiment, the cache table not only one or more rows of data cache, and the effectiveness of storing description data, where or how to get a fresh copy of the data cache control information, etc., or the information associated with this cache control . 当应用访问缓存表时,本地DBMS检查想要的数据,如果数据仍然有效,就提供服务。 When the application to access the cache table, checking local DBMS desired data, if the data is still valid, the provision of services. 如果缓存的数据不再有效,如果有可用的到服务器的连接,本地DBMS就从服务器请求更新的数据。 If the cached data is no longer valid, if there is an available connection to the server, the local DBMS to request updated data from the server. 为了更新单个(无效的)数据行不是检索一大组的数据,而是可能仅仅检索那个行。 To update a single (invalid) data line does not retrieve the data of a large group, but could only retrieve the rows.

在本发明的实施例中,缓存表是那些在需要时能从数据源(例如,企业服务器、数据库服务器、web服务器、应用服务器)检索到并存储在本地(例如,移动的)设备上的数据的数据库表。 In an embodiment of the present invention, the cache table is needed from those in the data source (for example, enterprise servers, database servers, web servers, application servers) and retrieved (eg, mobile) data stored locally on the device The database table. 在服务器与设备之间的通信可以使用任何适合的协议,例如HTTP(超文本传输协议)、SOAP(简单对象访问协议)、WAP(无线访问协议)等等。 In the communication between the server and the device may use any suitable protocol, such as HTTP (hypertext transfer protocol), SOAP (Simple Object Access Protocol), WAP (Wireless Access Protocol) and so on. 容纳数据源的服务器可以被配置执行CGI(公共网关接口)程序、小服务程序(servlet)、applet、Java方法或其它模块以实现与这里描述的缓存表说明相关联的接口。 Server to accommodate the data source can be configured to perform CGI (common gateway interface) program, servlet (servlet), applet, Java methods, or other modules to achieve cache table described here indicates that the interface is associated.

在本发明的一个实施例中,缓存表与数据库编程模式兼容,以便移动应用能通过例如ODBC(开放式数据库互接)或JDBC(Java数据库互接)这样的标准接口访问缓存的数据。 In one embodiment of the present invention, the cache table is compatible with the database programming model for mobile applications, for example through the ODBC (Open Database Connectivity) or JDBC (Java Database Connectivity) standard interfaces such access cached data. 因而能使用通常的数据库模型和接口来写使用缓存表的本地数据库的移动应用。 Which you can use the usual database models and interfaces to write applications using mobile cache table of the local database. 数据库通过它的缓存表管理数据的有效性、为无效数据检索更新等等。 Database cache table by the effectiveness of its management data, invalid data retrieval updates, and more. 缓存表的数据和事务型语义可以被设计成遵循工业标准事务型语义。 Cache table data and transactional semantics can be designed to follow the industry standard transactional semantics.

因为移动设备不可能总是有效地与企业服务器(或其它中央的/主要的数据源)通信,并且因为数据检索能被限定到仅仅那些无效的数据项,所以连接成本能保持相对的低。 Because not always effectively with a server (or other central / primary data source) communication, and because the data can be limited to only those retrieved invalid data item, so the connection can be kept relatively low cost mobile devices. 由于那些必须访问服务器的访问数量有限,所以由不可预测的等待时间引起的不稳定性能的问题更少了。 Because those who have access to the server to access a limited number, so less waiting time by the unpredictable performance of instability problems.

在本发明的另一个实施例中,提供智能客户代理用于增强在移动计算设备(例如,个人数字助理(PDA)、膝上型电脑或笔记本电脑、智能电话)上执行的脱机应用的操作。 In another embodiment of the present invention, there is provided a smart client proxy for operating enhanced mobile computing devices (for example, a personal digital assistant (PDA), a laptop or notebook computers, smart phones) on the implementation of offline applications . 在这个实施例中,客户代理通过选择性地进行联机访问和把应用内容与该内容的显示格式分开来增强脱机应用的操作。 In this embodiment, the client agent online access and the application content and display format of the content to enhance the operation of off-line applications separately by selectively. 通过把数据(例如,缓存表、瞬像或规则的数据库表)和应用页面的显示描述或格式分开存储可以把内容和显示格式分开。 By the data (for example, a database table cache table, snapshots or rule) display description or page formats and applications can be stored separately from the content and format are displayed separately. 当脱机应用需要页面时,客户代理从存储在本地数据库中的显示描述和数据重建应用页面。 When the application requires pages offline, the client agent from the display description and data reconstruction pages are stored in a local database. 客户代理可以联机去检索易失的数据和/或失时效的数据;客户代理也可以帮助客户瞬像与服务器同步。 Customer agents can go online to retrieve volatile data and / or stale data; client agent can also help customers Snapshot synchronized with the server. 此外,客户代理可以使服务器把信息推进到客户缓存表或数据库(例如,使用推进式监听器)并且也可以支持与客户应用的基于语音的交互。 In addition, customers can make a proxy server to advance information to the client cache table or database (for example, using a push-listeners) and can also interact with the client application to support voice-based.

图1描述可以实现本发明实施例的示例性的移动计算/通信环境。 Figure 1 depicts an embodiment of the present invention may be implemented exemplary mobile computing / communications environment. 在这个实施例中,通过直接的无线链路130和/或可能包括因特网的网络140可以访问企业服务器150,因此移动设备102a-102d的用户直接地或通过一系列的通信链路访问服务器150。 In this embodiment, through direct radio link 130 and / or network 140 may include the Internet can access the enterprise server 150, the mobile device 102a-102d of the user, either directly or through a series of communications link 150 to access the server. 用户的移动设备可以是膝上型电脑或者其它的便携计算机、PDA、电话、双向寻呼机或其它设备。 The user's mobile device may be a laptop computer or other portable computer, PDA, telephone, two-way pagers, or other device.

在本发明的一个实施例中,除了所有缓存表以外,客户数据库或DBMS还可以包括一个或多个服务器数据的瞬像。 In one embodiment of the present invention, in addition to all the cache table, customer databases or DBMS may also include one or more server snapshots of data. 在这个实施例中,缓存表存储可能从任何地方(例如,客户、任何远程服务器或其它系统)产生的数据,连同存储关于数据有效性的信息。 In this embodiment, the data store may cache table from anywhere (e.g., client, or any other remote server system) to produce, together with information on the effectiveness of the stored data. 瞬像存储来自服务器或者其它明确同步于服务器的来源的数据。 Snapshot storage data from the server or other clear sources synchronized to the server. 示例性地,当脱机时瞬像数据可以始终是可用的,而依赖于数据的有效性,缓存表可以或者不可以脱机使用。 Example, when the offline instant image data can always be available, and rely on the validity of the data, the cache table may or may not be used offline. 最后,规则的数据库表可以用于存储由客户产生的和/或仅仅由客户使用的数据。 Finally, the rules of the database table can be used to store generated by the client and / or data for use only by the client.

缓存表概念图2是适合用本发明实施例实现的移动客户设备的框图。 Cache table conceptual block diagram of Figure 2 is for example a mobile client device implemented by the present invention. 设备200包括移动应用210、数据库220和通信模块230。 Apparatus 200 includes 210 mobile applications, databases, communication modules 220 and 230.

移动应用210是使用或利用存储在数据库220中的数据的应用。 210 is a mobile application or by the application using the data stored in the database 220. 数据库220可以被配置成存储由应用210使用的任何类型的数据(例如,文本的、数字的、图形的、视频的)。 Database 220 may be configured to store any type of data used by the application 210 (e.g., text, numbers, graphics, and video). 数据库220包括一个或多个用于缓存数据的缓存表,例如缓存表222。 Database 220 includes one or more cache table for caching data, for example, the cache table 222. 数据库220也包括相关联的缓存控制信息224。 Database 220 also includes a cache 224 associated with the control information. 下面提供关于缓存表和缓存控制信息的进一步详述。 The following table provides further detail cache and cache control information about.

通信模块230被配置成访问那些存储缓存在数据库220中的数据的当前或主要版本的服务器或数据源。 Communication module 230 is configured to access data that is stored in a database cache of 220 current or major version of the server or data source. 因此,如以下所描述的,为了下载新的数据、刷新的数据、对缓存数据的更新等等,数据库220可以通过通信模块230定期访问服务器。 Thus, as described below, to download new data, refresh the data, cached data updates, etc., the database 220 through the communication module 230 may periodically access the server. 通信模块230可以由数据库直接操作,或者数据库可以通过应用210、操作系统或其它实体来访问通信模块230。 The communication module 230 can operate directly from the database, or a database application 210 by the operating system or other entities to access the communication module 230. 这样,除了可以连接到数据库220以外或者不连接到数据库220,通信模块230也可以连接到移动应用210上。 Thus, in addition to the database 220 may be connected or not connected to the outside of the database 220, the communication module 230 may also be connected to the mobile application 210.

在这里描述的本发明的实施例中,数据库220是由Oracle公司提供的DBMS(数据库管理系统)产品,例如Oracle 9i Lite。 In an embodiment of the present invention described herein, the database 220 is provided by Oracle company DBMS (database management system) products, such as Oracle 9i Lite.

在本发明的实施例中,缓存表特征可以以<S,C,O,P>形式的四元组表示。 In an embodiment of the present invention, the cache table features may & lt; S, C, O, P & gt; in the form of four-tuple. 在这个形式中,S定义缓存表的模式或结构,C定义缓存表上的约束,O表示一组支持的操作,P表示用于更新或检索缓存表内容的一组协议(例如,当移动设备连接到或间歇地连接到数据源时)。 In this form, S-defined pattern or structure of the cache table constraint C custom cache table, O for a set of supported operating, P is a set of protocols for updating or retrieving cached table of contents (for example, when a mobile device connected or intermittently connected to a data source).

缓存表模式在本发明的一个实施例中,缓存表的模式S由三种事件定义:缓存表的名称、描述缓存表结构的列定义的列表和访问参数列表。 Cache table schema in one embodiment of the present invention, the cache table's schema S is defined by three events: the name of the cache table column definitions describe cache table structure and access a list of the argument list. 缓存表名称可以遵守SQL(结构化查询语言)数据库的表命名惯例。 Cache table names can comply table SQL (Structured Query Language) database naming conventions.

列定义包括标识符和相关联的数据类型。 Column data type definition includes an identifier and an associated. 每一个标识符与缓存表的列名相对应,并可遵循列命名的惯例。 Each identifier column names and corresponding cache table, and follow the column naming convention. 访问参数列表是缓存表的列标识符子集的有序列表。 Access parameter list is an ordered list of column identifiers subset cache table.

因为缓存表模式S描述缓存表的结构,它也可以定义缓存表的每一个实例的结构。 S because the cache table schema describing the structure of the cache table, it can also define the structure of each instance of the cache table. 在本发明的这个实施例中,缓存表实例包括那些对于访问参数的访问参数列有相同值的缓存表的所有行。 In this embodiment of the invention, examples of which include cache table access parameters for all those rows of access parameters listed cache table of the same value. 自变量包括值的列表——缓存表的每个参数有一个值。 Arguments include a list of values - cache table has a value for each parameter. 这样,一个实例是有相同自变量的缓存表的一组行。 In this way, an example is a group of the same line buffer table arguments.

缓存表实例的结果集包括该实例的一组行,每行包括那些不在访问参数中的列的列表。 A set of rows result set caching table instance includes the instance, each row including a list of those not accessing parameters column. 换句话说,结果集是在缓存表的非访问参数列上的缓存表实例的投影。 In other words, the result set is a projection cache table instances on non-access parameters column cache of tables. 缓存表的特定实例可以由后面跟着相应自变量值的缓存表名称来表示。 Specific examples may be followed by a cache table behind the name of the appropriate cache table to represent the value of the argument.

图6描述根据本发明一个实施例的示例性的缓存表。 6 depicts an exemplary cache table in accordance with one embodiment of the present invention. Inventory(库存)缓存表600包括3个列:Part#(零件#)602、Warehouse#(仓库#)604和QOH(现有的数量)606。 Inventory (stock) cache table 600 includes three columns: Part # (Part #) 602, Warehouse # (Warehouse #) 604 and QOH (existing quantity) 606. 在这个缓存表中,访问参数仅仅包括零件#602。 In the cache table access parameters include only part # 602. 这样,显示了两个自变量:值1234和9876。 This shows two arguments: the value of 1234 and 9876.

基于两个自变量,显示了库存缓存器的两个实例。 Based on two independent variables shows two examples of inventory buffers. 一个实例包括有零件#1234的三行,另一个实例包括有零件#9876的两行。 One example includes three lines have part # 1234, another example includes parts # 9876 of two lines. 不是访问参数部分的缓存表600的列构成两个实例结果集。 Cache table column is not part of the 600 access parameters constituting two instances of the result set.

在本发明的这个实施例中,示例性的缓存表可以根据以下的SQL(结构化查询语言)句法来定义:<create cache table>::=CREATE CACHE TABLE<表名>(<列列表> In this embodiment of the invention, an exemplary cache table can be defined according to the following SQL (Structured Query Language) syntax: & lt; create cache table & gt; :: = CREATE CACHE TABLE & lt; table & gt; (& lt; column list & gt;

[,<约束>][,ACCESS PARAMETERS(<访问参数列表>)])USING<内容说明>Where<access parameter list>::=<访问参数名>[{,<访问参数>}...]使用这个示例性的SQL句法,样本缓存表可以如下定义:CREATE CACHE TABLE Inventory [, & Lt; constraint & gt;] [, ACCESS PARAMETERS (& lt; access parameter list & gt;)]) USING & lt; Description & gt; Where & lt; access parameter list & gt; :: = & lt; access parameter name & gt; [{, & lt; access parameter & gt;} ...] use the example of SQL syntax, sample cache table can be defined as follows: CREATE CACHE TABLE Inventory

(part# char(4),warehouse char(8),qty number(10)),PRIMARY KEY(part#,warehouse),ACCESS PARAMETERS(part#))USING Inventory TDP TYPE updateable AT MyCompanyDS;该示例性缓存表的模式S是“Inventory(part# char(4),warehousechar(8),qty number(10))”。 (Part # char (4), warehouse char (8), qty number (10)), PRIMARY KEY (part #, warehouse), ACCESS PARAMETERS (part #)) USING Inventory TDP TYPE updateable AT MyCompanyDS; the exemplary cache table Mode S is "Inventory (part # char (4), warehousechar (8), qty number (10))". 指定一个访问参数:part#。 Specify an access parameters: part #. 该缓存表的结果集包括一组行,这些行中的每一行包含两列:仓库标识符和存储在仓库中的指定零件的数量。 The results set the cache table comprises a set of lines, which each row contains two columns: the number of parts in the warehouse specified identifier and warehouse storage. 随后的从属部分更详细地描述这个样本缓存表定义的部分。 Part of this sample cache table definition of the subsequent dependent part is described in more detail.

通常缓存表T的模式可以写为T(a1,,r1...rn),这里T是缓存表的名称,a1,...am是访问参数列表,r1...rn是缓存表的结果集的列。 Typically cache table T model can be written as T (a1, ... am, r1 ... rn), where T is the name of the cache table, a1, ... am accessing parameter list, r1 ... rn is columns in the result set table cache. 这样,样本缓存表可以表示为:Inventory(part#,warehouse,qty)缓存表的实例可以写为T(v1,...,vm),这里vi是访问参数ai的值。 Thus, the sample cache table can be expressed as: Inventory (part #, warehouse, qty) instance cache table can be written as T (v1, ..., vm), where vi is access parameter values of ai. 在这个实例中,元组<v1,...,vm>构成特定缓存表实例的自变量,相应结果集的每一行是<r1,...,rn>的形式。 Form; in this example, tuples & lt; v1, ..., vm & gt; cache table arguments constitute specific instances, each row corresponding result set is & lt; r1, ..., rn & gt. 结果集的每一行可以被认为是单独的结果。 Each row of the result set can be considered a separate result. 在这里术语“缓存表”可以用于指有特殊结构(模式)的缓存表,或那个缓存表的实例。 Here the term "cache table" can be used to refer to the special structure (mode) of the cache table, or instances of that cache table.

缓存表的一组实例可以称为缓存表的“扩展”。 A set of instances cache table cache table can be called "extended." 缓存表的扩展被定义成包括存储在本地数据库或DBMS中的缓存表的所有实例。 Extended cache table is defined as all instances include cache tables stored in a local database or the DBMS's. 缓存表T的扩展可以写为E(T)。 Cache table T extensions can be written as E (T).

对于缓存表,关于其扩展的每一行定义两个谓词:“isValid(是有效的)”和“isUsable(是可用的)”。 For cache table, each row on its expansion define two predicates: "isValid (is effective)" and "isUsable (is available)." 如下面进一步描述的,“isValid”谓词可以用于确定行是否是有效的(例如,在查询执行的时候),而“isUsable”可以用于确定行是否是可用的。 As further described below, "isValid" predicate can be used to determine whether the line is valid (for example, in the query execution time), and "isUsable" can be used to determine whether the line is available. 示例性地,如果行是有效的,那么它是可用的,但是如果行是无效的,它可能是可用的或可能是不可用的。 Example, if the line is valid, then it is available, but if the line is valid, it may be available or may be unavailable.

在本发明的一个实施例中,缓存表可以以多种方式用于SQL语句中。 In one embodiment of the present invention, the cache table can be used in various ways SQL statements. 单独对缓存表名称的引用(例如,Inventory)可以解释为对缓存表扩展的引用。 Single reference (for example, Inventory) cache table name can be interpreted as a reference to the cache table extension. 这样,SQL语句“Select*from Inventory”将返回当前存储在本地数据库的缓存表Inventory的所有实例的所有结果集的所有行。 Thus, SQL statements, "Select * from Inventory" will return all rows are currently stored in the result set for all instances of all local database cache table in the Inventory. 本地DBMS可能不检查行的有效性和可用性,也不做任何刷新缓存表实例的尝试。 Local DBMS may not check the validity and availability of the line, do not attempt to refresh the cache table in any instance. 例证性的,这个类型的引用可能被限定于查询,可能对于更新是不可用的。 Illustrative of this type of reference may be limited to a query, it may be unavailable for updates. 可以认为它是缓存表的“脏读(dirty read)”。 It can be considered a "dirty read (dirty read)" Cache table.

对包括一整组访问参数的自变量值(例如,常数)的缓存表的引用将返回缓存表的一个实例。 References to include a whole set of access parameters of the argument value (for example, constant) cache table will return an instance of the cache table. 这样,语句Select*from Inventory('P123')将返回关于零件号'P123'的“零件#”、“仓库”和“数量”数据的表。 Thus, the statement Select * from Inventory ('P123') will return on part numbers 'P123' is "part #", "warehouse" and "quantity" of data tables. 有了这个类型的引用,如果需要,本地DBMS将使用以下描述的图3A和3B中示出的流程图来刷新实例。 With this type of reference, if necessary, local DBMS will be described below using Fig. 3A and 3B shows a flowchart to refresh instances.

在SQL句子内的对缓存表的另一个引用可能在自变量中包括至少一个变量。 SQL sentence in another cache table references may include at least one variable in the argument. 如果该引用(例如,在查询中)是有效的(例如,值能受变量的束缚),这个类型的引用返回缓存表的一个或多个实例。 If the reference (for example, in the query) is valid (for example, the value can be bound variables), refer to this type of return the cached table of one or more instances. 这样,语句Select p#,partName,warehouse,qty From part P,Inventory(Pp#)能用于获得零件表中零件号的库存的结果集。 Thus, the statement Select p #, partName, warehouse, qty From part P, Inventory (Pp #) can be used to obtain the parts list part number inventory result set. 如果没有值能受变量的约束,则认为查询是无效的。 If the constraint can be affected by variables has no value, then that query is invalid. 用这种类型的引用,如果需要,本地DBMS将使用图3A和3B中示出的流程图来刷新实例。 With this type of reference, if necessary, we will use local DBMS and 3B flow chart shown in FIG. 3A to refresh instances.

前述的例子演示缓存表访问参数是怎样能受到另一个表的列或表达式的限制的,包括另一个缓存表的结果集。 The foregoing examples demonstrate how the cache table access parameters can be limited by the column or expression of another table, including the results set another cache table. 例证性地,缓存表列的完全有限制的列的详细说明可以使用缓存表名称的别名。 Illustratively, the cache table column fully detailed description of the columns can be used to limit the cache table alias name. 如下面的:SELECT Pp#,P.pname,Inv.qtyFROM P,Inventory(Pp#)InvWHERE Inv.qty>100约束在本发明的实施例中,可以在任何缓存表扩展(例如,一组缓存表实例)上定义约束。 Such as the following: SELECT Pp #, P.pname, Inv.qtyFROM P, Inventory (Pp #) InvWHERE Inv.qty> 100 constraint in the embodiment of the present invention may table extensions (for example, a set of cache tables in any cache Examples of defined constraint). 因此缓存表的列列表能用于定义缓存表上的约束。 Therefore, the cache table column list can be used to constrain the custom cache table. 例如,主关键字或外关键字的约束可以在缓存表的列定义中定义(例如,如果它们是单一的属性关键字),或者可以在缓存表定义的约束部分中的Primary Key(主关键字)或Foreign Key(外关键字)子句中定义。 For example, the primary key or the foreign key constraint can be defined in the primary key column definition table cache (for example, if they are single attribute keyword), or may be part of the cache table constraints defined in the Primary Key (in ) or Foreign Key (foreign keys) are defined in clause.

上述定义的样本库存(Inventory)缓存表包括一个约束,由part#(零件#)和warehouse(仓库)组成的主关键字。 Sample inventory defined above (Inventory) cache table includes a constraint by part # (Part #) and warehouse (warehouse) consisting of the primary key. 这意味着对于指定的part#,结果集可以包括许多行或者结果,但是在结果集中不会有两行有相同的仓库值。 This means that for a given part #, the result set may include a plurality of rows or the result, but there will not be two rows in the result set have the same warehouse value.

当定义缓存表的约束C时,有几种选择。 When defining cache table constraints C, there are several options. 例如,单一的主关键字可以定义为所有访问参数的组合或者可以定义为所有访问参数和一些结果集标识符的组合。 For example, a single primary key can be defined as a combination of access to all parameters, or access may be defined as a combination of all parameters and some of the results set identifier. 例证性地,如果库存缓存表的访问参数'part#'被定义为该缓存表的主关键字,那么为'part#'的特定值返回的数据能包含至多一个单行。 Illustratively, if inventory access parameters cache table 'part #' is defined as the primary key table cache, then the 'part #' of particular value returned data can contain up to a single line. 相反地,如果主关键字被定义为'part#'和'warehouse'的组合,那么能为'part#'的给定值返回多个行。 Conversely, if the primary key is defined as 'part #' and 'warehouse' combination, then be able to 'part #' setpoint return multiple rows. 但是对于'part#'的每一个值,'warehouse'的值将是唯一的。 But for 'part #' of each value, 'warehouse' values will be unique.

对于在本发明的一个实施例中的每一个缓存表,非空系统约束是自动为每一个访问参数定义的。 In one embodiment of the present invention, each of a cache table, the system constraint is non-empty for each automatically defined access parameters. 附加的约束可以在缓存表的扩展上定义。 Additional constraints can be defined on extended cache table. 只要从数据源接收到结果集和从这些约束构造实例,DBMS就将基于这些约束执行数据完整性检查。 As long as the data received from the source to the result set and from the structure examples of these constraints, DBMS based on these constraints will perform data integrity checks. 完整性约束也可以用于最优化缓存表的存储。 Integrity constraints can also be used to optimize the storage cache table. 例如,如上所述的,如果在缓存表的任何(或所有)访问参数上定义主关键字,那么每一个结果集将至多包含关于自变量的一行,且缓存表的扩展可以存储在一个物理的表中。 For example, as described above, if the definition of the primary key on any (or all) of the cache table access parameters, then each result set will contain no more than about one line arguments, and extended cache table can be stored in a physical table.

概念地,对缓存表T的约束是在E(T)上定义的约束。 Conceptually, the constraints of the cache table T is in E (T) defined constraints. 在本发明的实施例中,如果主关键字被定义在缓存表的任何(或所有)访问参数上,则DBMS可以在单一的物理表中存储E(T)。 In an embodiment of the present invention, if the primary key is defined on any (or all) of the access parameters cache table, the DBMS can store E (T) in a single physical table. 所有在那个缓存表上定义的约束可以认为是关于E(T)的约束。 All constraints on that cache table definition can be thought of constraint on E (T) is.

示例性地,刷新缓存表实例包括从数据源的相应TDP(表数据处理器——在下面描述)检索实例的结果集、为每一个结果从自变量产生行、和把行插入E(T)。 Illustratively, the cache is refreshed from the data source tables and examples include the appropriate TDP (table data processor - described below) to retrieve the result set examples for each result row from the argument, and the row is inserted E (T) . 为了在E(T)上的插入、删除和更新操作,约束检查可以以正规的方式进行。 To insert in E (T) on, delete, and update operations, constraint checks can be formal manner.

当缓存表有引用主关键字的外关键字时,该主关键字包括另一个缓存表的全部自变量,DBMS可以通过在第二个缓存表实例上打开游标来检查外关键字约束。 When the cache table has foreign key references the primary key, the primary key included all arguments another cache table, DBMS can open a cursor on the second cache table instances to check foreign key constraints. 如果该实例存在并且是有效的或锁定的,那么认为约束是满足条件的。 If the instance exists and is valid or locked, so that the constraints are satisfied conditions. 如果该实例不存在或是无效的,那么DBMS将设法从数据源检索或刷新结果集。 If the instance does not exist or is ineffective, then the DBMS will try to retrieve or refresh the result set from the data source. 如果数据源返回结果,则它是被缓存的并认为约束是满足条件的。 If the data source returns a result, it is cached and that the constraints are satisfied conditions. 如果没有到数据源的连接,则报告错误。 If there is no connection to the data source, an error is reported.

操作在本发明的实施例中,为缓存表支持的操作O可以在缓存表定义的“Using(使用)”子句中定义。 Operation in the embodiment of the present invention, the cache table supported operating O in the cache table definition of "Using (use)" as defined in clause. 例证性地,Using子句可以指定:数据源的名称、表数据处理器(TDP)的名称和TDP的类型。 Illustratively, Using clause can specify: name of the data source table data processor (TDP) TDP's name and type.

缓存器操作的执行存在于服务器上或者在容纳数据源并且移动应用可定期访问的其它位置上。 Perform buffer operations exist on the server or in another location to accommodate the data source and the mobile application can be accessed on a regular basis. 当相应操作在缓存表上执行时由本地DBMS调用该执行。 When the corresponding operation is performed on the cache table to call the execution by the local DBMS. 作为选择,一些操作执行可以存在于移动设备上。 Alternatively, some of the operations performed may be present on mobile device.

在本发明的一个实施例中,缓存表形成的Using子句部分可以使用以下的SQL句法:USING<表数据处理器名称> In one embodiment of the present invention, the cache table Using clause forming part can use the following SQL syntax: USING & lt; table data processor name & gt;

TYPE{read-only|updateable|insertable|deletable(只读|可更新的|可插入的|可删除的)}AT<数据源名称> TYPE {read-only | updateable | insertable | deletable (Read Only | updatable | Pluggable | removable)} AT & lt; data source name & gt;

在本发明的这个实施例中,支持两种类型的TDP:只读的和可修改的。 In this embodiment of the invention, it supports two types of TDP: read-only and can be modified. 可修改的TDP可以是可插入的、可删除的和可更新的组合。 Modifiable TDP may be inserted, deleted and combinations can be updated. 可插入的TDP允许把行插入到缓存表扩展内并实现在行插入到了缓存表实例内以后DBMS将调用的插入方法。 Pluggable TDP allow the row is inserted into the cache tables extend and realize the line is inserted to the method that will be called later in the DBMS cache table instances. 相似地,可删除的TDP实现删除方法并允许从缓存表中删除行,可更新的TDP实现更新方法并允许更新行(例如,改变列的值)。 Similarly, you can delete the TDP implement deletion method and allows the table to delete rows from the cache, TDP renewable realize update method and allow the update line (for example, changing the value of the column). 如上所述,TDP建模那些能在缓存表上执行的操作。 As described above, TDP modeling operations that can be performed on the cache table.

例证性地,只读TDP只实现“选择”方法,其采用自变量(即缓存表访问参数的一组值)并返回包括结果集的一组行。 Illustratively, read TDP only achieved "choice" method, which uses the argument (that is, a set of values in the cache table access parameters) and returns a set of rows including the result set. 可能使用的协议在随后的部分中描述。 Protocols that may be used are described in the following section.

相反,取决于在相应Using子句中声明的TDP的类型,可修改的TDP必须实现“插入”、“删除”和/或“更新”方法以及“选择”方法。 Instead, depending on the respective type Using clause declared TDP of TDP must be modified to achieve "insert", "delete" and / or "Update" method, and "select" method. 在本发明的实施例中,当客户设备或者应用尝试更新缓存表时,本地数据库首先确定内容是否仍然有效(如以下描述的)。 In an embodiment of the present invention, when the client device or application attempts to update the cache table, the local database first determine whether the content is still valid (as described below). 如果有效,则更新内容并调用在TDP上的相应方法,如果该方法返回失败,则更新退回到在该操作开始之前的点。 If valid, the updated content and a corresponding method on the TDP call, if the method returns a failure, the update back to the point before the operation began. 如果内容是无效的,则数据库向TDP发送请求(例如,插入、删除、更新)并指示应返回新的结果集。 If the content is not valid, the database sends a request to the TDP (for example, insert, delete, update) and instructions should return the new set of results.

“数据源名称”字段指的是可以从本地数据库分离的数据源。 "Data Source Name" field means that can be isolated from the local database data sources. 数据源被配置成向本地DBMS提供足够的信息以使DBMS能理解该源的容量和协议。 The data source is configured to provide sufficient information to enable the local DBMS to DBMS to understand the capacity of the source and protocol. 数据源也可以指定缓存表实例的结果集的有效期和/或可用性周期。 The validity and / or availability period data sources can specify the cache table instance of the result set. 例证性地,数据源可以包括web服务器、应用服务器、数据库服务器或其它源。 Illustratively, the data source may include web servers, application servers, database servers, or other sources.

数据源可以实现一个或多个TDP,每一个TDP提供一个或多个方法以便于在代表缓存表的数据源上的操作。 Data source may implement one or more of TDP, each TDP provides one or more methods in order to operate on behalf of the cache table of data sources. 在本发明的这个实施例中,当由客户DBMS调用时,每个TDP负责提供缓存表实例的结果集。 In this embodiment of the invention, when the DBMS called by the client, TDP is responsible for providing for each result set caching table instance. TDP可以实现执行插入、删除、更新和/或其它操作的逻辑。 TDP can insert, delete, update, and / or logic other operations.

与上面描述的样本缓存表形成(缓存表“Inventory”)相关联,数据源可以使用以下的扩展SQL句法来定义:<create data source>::=CREATE DATA SOURCE<数据源名称> Sample cache table described above is formed (cache table "Inventory") associated with the data source can use the following extended SQL syntax to define: & lt; create data source & gt; :: = CREATE DATA SOURCE & lt; data source name & gt;

TYPE<类型名称>PROTOCOL<协议名称> TYPE & lt; type name & gt; PROTOCOL & lt; protocol name & gt;

[<认证>]<目的地> [& Lt; Certification & gt;] & lt; destination & gt;

where<类型名称>::=local|basic|auch|database<协议名称>::=omc|http|https|SOAP<认证>::={USING|USER}{CURRENT USER|<用户名>}{IDENTIFIED BY|PASSWORD}<密码> where & lt; type name & gt; :: = local | basic | auch | database & lt; protocol name & gt; :: = omc | http | https | SOAP & lt; Certification & gt; :: = {USING | USER} {CURRENT USER | & lt; user Name & gt;} {IDENTIFIED BY | PASSWORD} & lt; password & gt;

<目的地>::=AT<URI> & Lt; destination & gt; :: = AT & lt; URI & gt;

在数据库模式中“数据源名称”字段将是唯一的。 In the database schema, "Data Source Name" field will be unique.

数据源TYPE字段定义数据源的能力(例如,本地的、基本的、认证、数据库)。 Data source TYPE field defines the data source capabilities (for example, local, basic, certified database).

例证性地,“本地”数据源可以是在客户(移动)设备上实现的数据服务器,可以用于访问PIM(个人信息管理)数据库、电子邮件、地址簿等等。 Illustratively, the "local" data source can be on the client (mobile) devices to achieve data server can be used to access PIM (Personal Information Management) database, e-mail, address book and more. 本地DBMS可以为指定的客户设备预载本地数据源。 Local DBMS can specify client device preloaded local data sources. 在这个实施例中,用于本地数据源的协议(在上述“协议名称”字段中指定)是OMC(Oracle移动客户)。 In this embodiment, the protocol for local data source (specified in the above-mentioned "Protocol Name" field) is the OMC (Oracle Mobile Client).

“基本”数据源是能接受http、web服务请求或相似请求的简单数据源。 "Basic" data source is able to accept http, web service requests or similar simple data sources request. 它通常是较少会话(session-less)服务器,可能不认证请求器和支持事务处理。 It is usually less conversation (session-less) server, may not support authentication requests and transaction processing. 因此,对于基本的数据源可以忽略<认证>子句。 Thus, the basic data source can be ignored & lt; Authentication & gt; clause.

在这个实施例中,“认证”数据源是需要客户认证的数据源(例如,客户必须登陆并获得会话对象)。 In this embodiment, a "certification" Data source is required client authentication data source (for example, customers must log in and get the session object). 认证数据源的<认证>子句提供用于登陆数据源的用户名和密码。 Data origin authentication & lt; Certification & gt; clause provides for login data source user name and password. 提供认证数据源的服务器将支持登陆和注销方法,登陆方法将返回会话对象。 Provides data origin authentication server will support login and logout methods, landing method returns the session object.

“数据库”数据源是可以支持例如“beginTransaction(开始处理)”、“prepareToCommit(准备提交)”、“commit(提交)”和“rollback(回退)”的数据库操作的认证数据源。 "Database" data source can support such as "beginTransaction (start processing)", "prepareToCommit (ready to commit)", "commit (commit)" and "rollback (rollback)" authentication data source database operations. 如果服务器容纳至少一个支持缓存表更新(例如,在缓存表内的行的插入、删除或更新)的TDP,则数据源可能是事务型的。 If the server is to receive at least one support cache table update (for example, in the cache table row insert, delete or update) the TDP, the data source may be transactional.

与上面举例说明的缓存表形成有关,在缓存表形成的Using子句中被标识的数据源MyCompanyDS可以定义如下:CREATE DATA SOURCE MyCompanyDSTYPE basic PROTOCOL httpAT'';协议在本发明的实施例中,用于在本地DBMS与数据源或TDP之间通信的协议在缓存表四元组的P部分定义。 Embodiments of the present invention Agreement; CREATE DATA SOURCE MyCompanyDSTYPE basic PROTOCOL httpAT' / DS ': relevant, data sources MyCompanyDS Using clause formed in the cache table identified can be defined as described above is formed, for example cache table Examples for P part of the definition in the cache table quads in the protocol for communication between local DBMS and data source or the TDP. 特别地,P识别一个或多个协议(例如,SOAP、HTTP等等)、附加的XML标记或在来自数据源或TDP的响应中使用的其它设计(例如,HTML标记)。 In particular, P identifying one or more protocol (e.g., SOAP, HTTP, etc.), additional XML tags or other design (e.g., HTML tags) used in the response from the data source or TDP.

客户DBMS可以使用支持的协议中的任何一个与数据源通信。 Any of the communication between the client DBMS can be used to support the agreement with the data. 不管使用什么协议,在本发明的一个实施例中客户DBMS可以与数据源交换表1的任何或所有的数据项。 No matter what protocol to use, in one embodiment of the present invention, the customer can DBMS table any or all of the data item 1 exchange with the data source.

表1 Table 1

如果使用的协议是HTTP,缓存表实例的自变量可以作为POST方法的部分在XML文件中发送。 If the protocol used is the independent variable HTTP, cache table instances can be sent in XML documents as part of the POST method. 选择方法的结果可以是包含报头和正文的XML(可扩展标识语言)文件。 Select methods can be included headers and body XML (Extensible Markup Language) files. 报头可以包含缓存控制信息,正文可以包含构成结果集的一组行。 Cache-Control header can contain information, text constitute the result set can contain a set of rows. 例证性地,正文可以根据OMC缓存表结果集格式被编码为XML文件,或者它可以编码为更紧凑的OracleLite CSV(逗号分隔值)文件。 Illustratively, the text can be set according to the results of OMC cache table format is encoded as an XML file, or it can be encoded as more compact OracleLite CSV (comma-separated values) file.

插入和删除方法可以接受自变量(例如,一组访问参数值)和表示那些客户想要插入缓存表或以前插入缓存表的单行的一列值。 Insert and delete methods can accept arguments (for example, a set of access parameters) and represent clients who want to insert previously inserted buffer cache table or a table column values a single row. 更新方法可以采用自变量和表示一个旧行的一列值以及表示更新的另一列。 Update method can be used from a list of variables and represent the value of a row of old and represents another column updates. 使用HTTP POST方法,用于所有方法的所有数据作为XML文件被发送。 Use HTTP POST method, all methods for all data to be sent as an XML file.

在本发明的一个实施例中,请求格式是HTTP POST请求,使用的URL是数据源的URL。 In one embodiment of the present invention, the request format is HTTP POST request, URL using the URL data source. 用户代理串是“Oracle Lite”。 User Agent string is "Oracle Lite". 那么,例如获得自变量'p123'的Inventory缓存表实例的HTTP请求可以如下:POST\r\n content-length:...\r\nUser-Agent:Oracle Lite \r\n... So, for example, get the argument 'p123' of HTTP Inventory cache table instances can request as follows: POSThttp: // \ r \ n content-length: ... \ r \ nUser-Agent: Oracle Lite \ r \ n ...

\r\n\r\n...... \ R \ n \ r \ n ......

<x:CACHETABLEREQUEST op=“select”TDP=“InventoryTDP”> & Lt; x: CACHETABLEREQUEST op = "select" TDP = "InventoryTDP" & gt;

<! & Lt ;! --Handle multiple instances--> --Handle Multiple instances - & gt;

<x:INSTANCE> & Lt; x: INSTANCE & gt;

<x:ARG> & Lt; x: ARG & gt;

<PART#>P123</PART#> & Lt; PART # & gt; P123 & lt; / PART # & gt;

</x:ARG> & Lt; / x: ARG & gt;

</x:INSTANCE> & Lt; / x: INSTANCE & gt;


请求报头可以包含一些附加的信息。 Request header can contain additional information. 例如If-Modified-Since。 Such as If-Modified-Since.

对请求的响应是包含报头和正文的XML文件。 Response to a request that contains the header and body of XML documents. 响应的格式在附录B中描述。 Response format is described in Appendix B.

在本发明实施例中的响应的报头可以包含任意的或所有的以下的信息:响应日期(Response Date)——根据数据源时钟的3 HTTP格式(例如,RFC1123)的响应的日期;最后的修改(Last-Modified)——在数据源上最后修改数据时的日期(也是以HTTP日期格式);期满(或期满日期(Expires or Expiration Date))——在此之前数据应被认为是有效的日期;使用期限(Time-To-Live)——有多长时间能认为数据是有效的,以秒表示;失时效(Staleness)——大于零的整数,表示如果没有到刷新结果集的网络连接失时效的(期满的)结果集是否能使用和能使用多久。 In response header example embodiment of the present invention may contain any or all of the following information: Response Date (Response Date) - According to the data source clock 3 HTTP format (for example, RFC1123) the date of the response; last changed (Last-Modified) - date of the last modification of data on the data source (which is also the date format in HTTP); expiration (or expiration date (Expires or Expiration Date)) - Before this data should be considered valid date; life (Time-To-Live) - How long can the data be considered valid, expressed in seconds; stale (Staleness) - an integer greater than zero, indicating that if there is no network to refresh the result set connection of stale (expired) result set is able to use and can be used for how long. 失时效值1是默认的,表示失时效的结果集根本不能使用。 Stale value of 1 is the default, it indicates stale result sets can not be used. 如果失时效值是n,则表示该失时效的结果集能使用直到n倍的使用期限值。 If stale value is n, it indicates that the stale result sets can use up to n times the period of use value.

如表1中描述的,图7-11演示能用于客户设备与数据源之间通信的XML文件的样本格式。 As described in Table 1, Figure 7-11 can be used to demonstrate a sample XML file format communication between the client device and the data source.

图7A-B演示样本响应文件格式702、704。 Figure 7A-B 702,704 demo sample response file format. 每一个格式包括报头和正文。 Each format includes a header and a body. 报头可以包括服务器标志、客户标志、缓存器信息(例如,最后修改日期、期满、使用期限、失时效)、TDP名称、结果集的自变量、缓存表模式、日期格式等等。 Header may include a server flag, customer logo, the buffer information (for example, last modification date, the expiration period of use, loss of aging), TDP name, results from variable set, cache mode, date format and so on. 正文包含一个或多个行组,这些行组中的每一个可以识别行组格式、动作(例如,替换、插入、删除、更新)、分隔器字符等等。 The body contains one or more groups of rows, these rows in each group can identify line group format, actions (for example, replace, insert, delete, update), the separator character, and so on. 响应格式702的正文是XML格式,而响应格式704的正文是CSV格式。 Text 702 response format is XML format, and the response format is CSV format text 704.

图8演示样本选择请求文件800。 Figure 8 illustrates sample selection request file 800. 图9演示样本插入请求文件900。 Figure 9 illustrates a sample insert request file 900. 图10演示样本删除请求文件1000。 Figure 10 demonstrates sample file deletion request 1000. 图11演示样本更新请求文件1100。 Figure 11 demonstrates sample file update request 1100.

缓存表操作如上所述,在本发明的一个实施例中,当客户应用发起涉及缓存表的操作(例如查询)时,本地数据库或DBMS确定有指定访问参数组的缓存表实例是否已经被缓存和是否仍然有效。 Cache table operations described above, in one embodiment of the present invention, when a client application initiates involve cache table operations (such as queries), the local database or DBMS determine whether the cache table access parameters specified group instances have been cached and It is still valid. 如果是,缓存的结果集可以用于操作。 If so, the cached result set can be used to operate. 否则,如上面刚刚说明的,为了检索结果集,数据库将调用在TDP上为缓存表定义的选择方法。 Otherwise, as just described above, in order to retrieve the result set, the database will be called on TDP selection method for the cache table definition. 来自TDP的响应可以包括报头,它包含在前面的小节中提及的任何或所有的缓存控制参数。 Response from TDP may include a header, which contains any or all of the cache control parameters mentioned in the previous section.

图3A-B包括演示根据本发明的一个实施例用于确定是否更新、检索或刷新缓存表实例的算法的流程图。 Figure 3A-B flowchart algorithm including a demonstration in accordance with one embodiment of the present invention is used to determine whether to update, retrieve or refresh the cache table instance. 在这个算法中,当前日期指的是在客户机器上的当前日期/时间。 In this algorithm, referring to the current date on the client machine's current date / time.

在图3A-B的算法中,如果在期满(例如,由使用期限或期满日期参数定义的)之前被使用,缓存表的缓存实例可以被认为是“有效的”。 In the algorithm of FIG. 3A-B, if at expiration (for example, by the use period or expiration date parameters defined) before it is used, the cache instance cache table can be considered "valid." 如果(1)实例是“有效的”,(2)它由事务处理锁定,或(3)如果该实例已经期满,但是在它失时效(如从失时效参数计算的)之前正在被使用(因为到数据源的通信链路是不可用的),则可以认为该实例对于事务处理是“可用的”。 If (1) Examples are "active", (2) it is locked by the transaction, or (3) if the instance has expired, but it is stale (as calculated from the stale arguments) before being used ( Because the communication link to the data source is not available), it can be considered that the transaction is for instance "available." 更正式地:可用的=有效的OR锁定的OR(没有到数据源的连接AND(响应日期+(使用期限*失时效)>=当前日期))在状态300中,操作(例如,查询)由本地数据库或DBMS(数据库管理系统)接收。 More formally: Available = effectively locked OR OR (AND no connection to the data source (response date + (stale life *)> = current date)) in a state 300, the operation (for example, a query) by the local database or DBMS (database management system) receiver. 该操作涉及到数据库被配置存储的一个或多个缓存表实例。 The operation involves the database is configured to store one or more cache table instances.

在状态302中,DBMS确定这是否是涉及被提供作为操作部分的自变量的第一个操作。 In state 302, DBMS determine whether this is related to the operation is supplied argument as part of the first operation. 更通常地,DBMS可以确定它是否有对应于自变量的结果集,而不管结果集是否是有效的、可用的、失时效的、或处于其它某个状态。 More generally, DBMS can determine if it has a corresponding set of independent variables on the results, regardless of whether the result set is effective, available, stale or in some other state. 如果这是关于这个自变量的第一个操作(例如,数据库不包含与该自变量相关联的结果集),则这个图示的方法在状态304继续;否则,该方法前进到状态310。 If this is the first operation on this argument (for example, the database does not contain the results set associated with the argument), then the method shown in state 304 continues; otherwise, the method proceeds to state 310.

在状态304,DBMS向数据源发出请求,请求被指向与缓存表相关联的表数据处理器,以获得与自变量相对应的结果集。 In state 304, DBMS issued a request to a data source, the request is directed to the cache associated with the table of table data processor, in order to obtain independent variable corresponding result set.

在状态306,在DBMS中为结果集产生新的缓存表实例,且新的缓存表实例被用于满足操作。 In state 306, in the DBMS cache table to generate new examples of the result set, and a new cache instances are used to meet the operating table. 示例性地,缓存报头可以存储在客户设备上。 Illustratively, cache headers can be stored on the client device. 然后该方法结束。 The method then ends. 如果不能接通数据源以获得结果集(例如,在状态304),则由数据库来显示错误。 If the data source is not turned on in order to obtain a result set (e.g., state 304), then the database to display an error.

在状态310中,关于自变量的以前的结果集位于缓存表中,DBMS确定目前它是否由当前的事务处理锁定。 In state 310, on the argument of the previous set of results in the cache table, DBMS to determine whether it is currently locked by the current transaction. 在本发明的这个实施例中,如果当前事务处理的事务处理隔离级是“可重复读取的(RepeatableRead)”或“可连续的(Serializable)”(这将导致结果集被锁定),DBMS将不会为当前的事务处理刷新结果集。 In this embodiment of the invention, if the current transaction isolation level transaction is "repeatable read (RepeatableRead)" or "continuous (Serializable)" (which would lead to a result set is locked), DBMS will It does not refresh the result set for the current transaction. 如果当前的事务处理已经锁定结果集,则图示的方法前进到状态316。 If the current transaction has locked the result set, the method proceeds to state 316 illustrated.

否则,在状态312中,DBMS确定当前的事务处理在缓存的结果集上是否有活动的游标。 Otherwise, the state 312, DBMS determine whether there is activity on the current transaction in the result set cursor cache. 在本发明的这个实施例中,如果当前事务处理的事务处理隔离级是“提交了读取(Read Committed)”(这将导致活动的游标和没有锁定),DBMS将不更新结果集,以便提供读取的连贯性和游标的稳定性。 In this embodiment of the invention, if the current transaction isolation level transaction is "submitted a read (Read Committed)" (which will lead the activities of the cursor and is not locked), DBMS result set will not be updated in order to provide read consistency and stability of the cursor. 如果当前的事务处理有在结果集上打开的活动游标,该方法前进到状态316。 If the current transaction has on the activities of the cursor result set to open, the method proceeds to state 316.

否则,在状态314中,DBMS确定缓存的结果集是否有效。 Otherwise, the state 314, DBMS determine the cached result set is valid. 如上所详述的,如果还没有超过结果集的使用期限参数或期满日期(例如,响应日期+使用期限>=当前日期),则可以认为结果集是有效的。 As detailed above, if it does not exceed the period of use, or the expiry date of the result set parameters (for example, in response to date + lifetime> = current date), it can be considered the result set it is valid. 如果缓存的结果集不是有效的,图示的方法在状态316继续;否则,该方法前进到状态322。 If the cached result set is not valid, the method illustrated in the state 316 continues; otherwise, the method proceeds to state 322.

在状态316,DBMS确定到与缓存表相关联的数据源(例如TDP)的连接是否可用,如果连接是可用的,则方法前进到状态324。 In state 316, DBMS determine the cache table associated with the data source (such as TDP) connection is available, if the connection is available, the method proceeds to state 324.

在状态318,没有可用的到数据源的连接,且知道缓存的结果集是无效的,这样数据库确定结果集是否是可用的或失时效的。 In state 318, not available for connection to a data source, and know the cached result set is invalid, so the database to determine whether the result set is available or loss of aging. 例证性地,如果(响应日期+(使用期限*失时效)<当前日期),则可以认为结果集是失时效的。 Illustratively, if (response date + (Life * stale) <current date), it can be considered the result set is stale. 如果缓存的数据还不是失时效的,那么该方法继续到状态322。 If the cached data is not stale, then the method continues to state 322.

否则,缓存的结果集是无效的和失时效的,且没有可用的到能刷新缓存表实例的数据源的连接。 Otherwise, the cached result set is invalid and stale, and not available to be able to refresh the data source connection cache table instance. 因此,在状态320中DBMS显示错误,该方法结束。 Therefore, an error in the state 320 DBMS, the method ends.

在状态322中,DBMS中存在的结果集用于满足当前的操作。 In state 322, the result of the presence of DBMS set to meet the current operation. 然后程序结束。 Then the program ends.

在状态324中,已经认为目前缓存的结果集是无效的,但是到数据源的连接是可用的,那么请求刷新操作。 In state 324, the result has been that the current cache set is invalid, but the connection to the data source is available, then the request refresh operation. 例证性地,刷新请求可以包括反映以前的结果集刷新的最后修改日期的If-Modified-Since报头。 Illustratively, the refresh request may include reflect If-Modified-Since header set refresh previous results last modified date. 如果不能从最后的刷新或更新得到最后修改日期值,那么使用响应日期作为代替。 If you can not get the last modified date values from the last refresh or update, then use the response date instead.

在状态326中,DBMS确定是否在对请求的响应中接收了任何更新。 In state 326, DBMS to determine whether any updates received in response to the request. 例证性地,如果TDP(通过数据源)发现自从结果集最后一次被提供到本地DBMS之后还没有更新结果集,那么将不发送更新。 Illustratively, then if TDP (via data source) found the result set since the last time it was provided to the local DBMS result set has not been updated, it will not send updates. 如果接收了任何的更新,则图示的方法进入状态330。 If you receive any update, the method illustrated enters state 330.

否则,没有接收到更新,这样在状态328中缓存控制信息被适当地更新,且缓存的结果集被用于当前的操作。 Otherwise, it does not receive the update, so that the state of the cache control information 328 is appropriately updated, and cached result set is used for the current operation. 例证性地,和响应一起接收到的任何缓存控制信息将被用于更新或重写存在的缓存控制信息。 Any cache control information illustrative manner, and together with the response received will be used to update or overwrite existing cache control information. 该方法然后结束。 The method then ends.

在状态330中,DBMS确定缓存的结果集当前是否由另一个事务处理使用。 In state 330, DBMS cache result sets determine whether the current use by another transaction.

在状态332中,正在使用结果集,这样DBMS拷贝该结果集并把该拷贝标记为该结果集最近的版本。 In state 332, the result set is being used, so that a copy of the DBMS and the result set for the result set to the copy mark the latest version. 除了最近的版本,其他拷贝可以被标记成当事务处理停止使用它们时被删除。 In addition to the most recent version, the other copy can be marked as a transaction stop using them when it is removed.

然后,在状态324中,DBMS根据从数据源接收的更新来更新结果集,并把更新的结果集用于当前操作。 Then, in the state 324, DBMS data received from the source Update to update the result set, and the updated set of results for the current operation. 然后该图示的方法结束。 Then the end of the method of the illustration.

在本发明的一个实施例中,本地时钟与服务器(数据源)时钟的同步是个问题,本地日期值可以计算并用于代替响应日期。 In one embodiment of the present invention, the local clock and the server (data source) clock synchronization is a problem, the local date value can be calculated and used instead of the response date. 响应日期和期满日期也可以用于计算使用期限值(如果不包括在响应中)。 Response date and expiration date may also be used to calculate the lifetime value (if not included in the response).

只读缓存表在本发明的一个实施例中,当查询或其它的缓存表操作仅仅通过名称(例如,没有自变量)引用缓存表T时,游标在E(T)(即缓存表的扩展)上打开。 Table in a read-only cache embodiment of the present invention, when a query or other cache table operation only by name (for example, no arguments) referral cache table T, the cursor in E (T) (ie extended cache table) On open. 游标在E(T)内的每个实例的最近版本中迭代,而不考虑实例是否是可用的。 Recent versions of each iteration cursor instance in E (T) inside, regardless of whether an instance is available. 本地DBMS不会尝试刷新或锁定实例。 Local DBMS does not attempt to refresh or locked instance. 然而如果某个其它的事务处理在E(T)内的实例上打开游标,则可以刷新E(T)内的实例。 However, if some other transaction to open a cursor on an instance within (T) E, you can refresh Examples E (T) inside. 应该记得更新操作必须提供自变量,因此将不会单独通过名称引用缓存表。 You should remember that the update operation must provide arguments, and so will not separate cache table referenced by name.

当查询引用特定的缓存表实例时,例如T(v1,...,vm),这里每个vi是常数,DBMS将检查该实例是否是可用的。 When a query references a specific instance cache table, such as T (v1, ..., vm), where each vi is a constant, DBMS will check whether the instance is available. 如果是,则在该实例上打开游标;如果不是,DBMS将设法刷新它。 If it is, open the cursor on that instance; if not, DBMS will try to refresh it. 如果没有可用的到必要的数据源的连接,则可能返回错误。 If no connection to the necessary data source, it may return an error.

在本发明的实施例中,如果向高速缓存器发出查询的事务处理处于“提交了读取”的隔离级,且该查询包括自变量,则不会有锁定应用到受影响的缓存表实例。 In an embodiment of the present invention, if the query is issued to the cache in a transaction "Submit a read" isolation level, and the query includes the argument, there will be no lock is applied to the affected cache table instance. 如果事务处理处于“可重复读取”的隔离级,则读取锁被应用到实例。 If the transaction is in the "repeatable read" isolation level, the read lock is applied to the instance. 如果事务处理处于“可连续的”隔离级,则读取锁可能应用到实例和E(T)。 If the transaction is in the "continuous" separate class, the read lock may be applied to instances and E (T).

如果指定的事务处理关闭在缓存表上的游标然后再打开它,那么刷新策略可能取决于事务处理的隔离级。 If the specified transaction close the cursor in the cache table and then open it, then refresh strategy may depend on the transaction isolation level. 例证性地,如果事务处理的隔离级是提交了读取,那么如果高速缓存器在游标被重新打开之前变得不可用则将刷新缓存的内容。 Illustratively, if the transaction isolation level is presented to read, then the cache if becomes unavailable until the cursor is reopened will refresh the cached content. 如果事务处理级是可重复读取或者是可连续的(读取锁应用到实例),那么相同的内容可以用于重新打开的游标,不管该内容是否已经期满。 If the transaction level is repeatable read or be continuous (read lock is applied to an instance), so the same content can be used to re-open cursors, regardless of whether the content has expired.

对于缓存表T,不同的实例可以有不同的有效期。 For cache table T, different instances can have different validity. 例如,缓存表实例T1(v1,...,vm)的有效期可能是一小时,而缓存表T2(u1,...,um)的有效期可能是三十分钟。 For example, the cache table instances T1 (v1, ..., vm) may be valid for one hour, while the cache table T2 (u1, ..., um) is valid may be thirty minutes. 在这个例子中,(v1,...,vm)和(u1,...,um)是自变量。 In this case, (v1, ..., vm) and (u1, ..., um) is the independent variable. 例证性地,实例的有效期由从其获得结果集的数据源来设置。 Illustratively valid instance from the data source from which to obtain the result set to set. 客户DBMS可能不刷新那些仍然有效的缓存表内容。 DBMS customers who may not flush the cache table content is still valid.

在本发明的实施例中,本地DBMS产生关于结果集有效期的ClosedWorld(关闭世界)假设,如果缓存表内容仍然有效,将不会刷新任何缓存表内容(结果集)。 In an embodiment of the present invention, the local DBMS result set generated on the validity of ClosedWorld (closed world) is assumed, if the cache table content is still valid, it will not refresh any cached table contents (result set). 也假定在刷新过程中从数据源获得的任何内容包括已经在数据源提交的数据。 Also assume anything in the refresh process to obtain data from the data source includes the data source has been submitted.

可更新的缓存表对于可更新的缓存表,在本发明的一个实施例中,每次只有一个事务处理可以更新缓存表实例。 Updatable cache tables for updatable cache table, in one embodiment of the present invention, only one transaction can update the cache table instance. 在这个实施例中,写锁被应用到可更新的缓存表实例。 In this embodiment, the write lock is applied to the updatable cache table instance.

当事务处理更新可更新的缓存表实例时,如果该缓存表实例仍然有效或已经被这个事务处理锁定,则更新首先应用到结果集。 When a transaction updates updatable cache table instance, if the cache table instance is still valid or has been locked in this transaction, the update first applied to the result set. 然后在数据源调用TDP的相应的更新方法。 TDP corresponding update method then invokes the data source. 例证性地,如果该方法失败则更新失败。 Illustratively, if the method fails, the update fails.

如果当更新缓存表实例时没有到数据源的连接是可用的,则报告错误。 If no connection to update the cache table when the instance data sources are available, an error is reported. 如果在更新的应用过程中有任何错误,DBMS将回退在数据源的事务处理。 If there are any errors in the updated application process, DBMS will roll back the transaction at the data source.

缓存表T的实例是用于查询的读取连贯性、游标的稳定性的单元,且在这个实施例中缓存表T是能够为可更新缓存表的并发控制锁定的最小目标。 Examples cache table T is used to query read consistency, cursor stability unit, and in this case the minimum target cache table T is able to be updated cache table locking concurrency control implementation. 正式地,缓存表实例是E(T)的子集,其中在子集中的所有行有相同的自变量:T(v1,...,vm)≡{x|x∈NE(T)∧x.a1=v1∧...∧}当且仅当在由响应日期和使用期限之和表示的时期结束之前在该实例上打开的游标被打开,那么缓存表实例在这个实施例中是有效的:IsValid(T(v1,...,vm))(ResponseDate(T(v1,...,vm))+Time-To-Live(T(v1,...,vm)))>=CurrentDate当且仅当如果缓存表实例的结果集是(1)有效的,(2)为了更新由事务处理锁定,或者(3)当游标在实例上打开时,没有可用的到数据源的连接,且实例还没有通过它的失时效界限,则缓存表实例的结果集在这个实施例中是可用的:IsUsable(T(v1,...,vm))IsValid(T(v1,...,vm))∨hasLock(T(v1,...,vm))∨(-isReachable(DataSource(T))∧ResponxeDate(T(v1,...vm))+ Officially, the cache table example is E (T) of the subset of the subset of all rows with the same argument: T (v1, ..., vm) ≡ {x | x∈NE (T) ∧x .a1 = v1∧ ... ∧ = vm} iff response before the end of the period by the date and duration of use and presentation open on that instance the cursor is opened, then the cache table instance in this embodiment Examples are effective: IsValid (T (v1, ..., vm))  (ResponseDate (T (v1, ..., vm)) + Time-To-Live (T (v1, ..., vm )))> = CurrentDate iff cache table if the result set is an example of (1) a valid, (2) In order to update locked by the transaction, or (3) when the cursor is opened on the instance, is not available to connected data sources, and examples are not stale by its limit, the cached results set the table instance in this embodiment are available: IsUsable (T (v1, ..., vm)) IsValid (T ( v1, ..., vm)) ∨hasLock (T (v1, ..., vm)) ∨ (-isReachable (DataSource (T)) ∧ResponxeDate (T (v1, ... vm)) +

(Time-to-Live(T(v1,...,vm))*Staleness(T(v1,...vm))))>=CurrentDate)在本发明的实施例中,只要游标位于实例的行上,实例就不能被修改。 (Time-to-Live (T (v1, ..., vm)) * Staleness (T (v1, ... vm))))> = CurrentDate) In an embodiment of the present invention, as long as the cursor is positioned instance On the line, the instance can not be modified. 如果另一个事务处理尝试打开在相同的实例上游标,本地DBMS将从数据源中检索关于那个实例的结果集并产生新的实例。 If another transaction tries to open a cursor on the same instance, local DBMS retrieved from the data source on the example of the result set and create a new instance. 新的实例变成实例的最近版本,当它们的游标移动时所有其它的版本将被清除。 The new instance becomes the latest version of the instance, when their cursor move all other versions will be cleared.

智能客户代理在本发明的一个实施例中,提供智能客户代理用于方便移动客户设备上的脱机操作或移动应用。 Smart Client Agent in an embodiment of the present invention, there is provided a smart client proxy for easy offline or mobile applications mobile client device. 更特别地,在这个实施例中,客户代理增强了移动应用的一个或多个特征,例如,与用户的语音交互、把数据从服务器推进到客户、和选择性的联机访问远端数据(即,存储在除客户端以外的地方的数据)。 More specifically, in this embodiment, the client agent enhances one or more features for mobile applications, such as voice interaction with the user, the data from the server to the client advance, and selective online access remote data (ie, The data stored in place other than the client's).

客户代理也可以使得将要显示给用户的内容与显示内容的格式相分离。 Customer agents can also be displayed to the user so that the content and format of the display phase separation. 例证性地,后者的益处允许客户端从指定的显示格式和能使用该格式显示的一个或多个数据组中实时产生页面。 Illustratively, which allows clients to benefit from the specified display format and be able to use the format of the one or more data sets in real time to generate the page. 然后可以通过合适的客户浏览器显示页面。 You can then display the appropriate client browser page.

例如,在为涉及库存数据访问的移动应用实现的本发明的实施例中,客户代理允许数据的显示描述或格式与库存数据分开存储。 For example, in cases relating to stock data access mobile applications realization of the present invention, the client agent allows the data format to display description or inventory data separately. 这样,显示格式可以被配置为指定的零件号显示例如零件名称、描述、价格、现有的数量等等的信息。 Thus, the display format can be configured to display the specified number of parts such as part name, description, price, and so the number of existing information. 数据可以存储在数据库、高速缓存器、缓存表或其它结构中。 Data can be stored in a database, cache, cache table, or other structure. 当用户提供特定的零件号时,相应的数据被检索并与显示格式相结合用于显示给用户。 When a user provides a specific part number, the corresponding data is retrieved and combined with the display format for display to the user.

例证性地,显示格式或显示描述页面可以容纳变量、字段名称或其它表示数据或内容项的占位符,也容纳能用于控制本地数据库中的数据如何能用于替换占位符的脚本语言中的命令。 Exemplary, the display format or display description page can accommodate placeholder variable, field name or other representation of data or content item, also can be used to control the data hold local database can be used to replace the placeholders how scripting language commands. 智能客户代理的脚本引擎执行在页面中的脚本语言以在页面返回到浏览器之前用实际值替换占位符。 Smart Client Agent scripting engine to perform on the page before the page scripting language to return to the browser replaces the placeholder with the actual value.

本领域技术人员会理解以前的移动应用或脱机应用被配置以存储把内容与显示格式结合起来的静态的、一致的页面。 Skilled in the art will appreciate that the previous mobile application or offline application is configured static, consistent page to store the combination of content and display format. 因此每一组内容被存储为单独的页面,从而需要更大的存储容量并提供更小的灵活性。 So that each group content is stored as a separate page, so the need for greater storage capacity and provide less flexibility. 例如,如果只有存储页面内的一个数据项需要更新,则不得不检索包含那个项的整个页面。 For example, if only one data item stored within the page needs to be updated, then you had to retrieve items that contain the entire page. 如果那个数据项是多个页面的部分,则不得不检索每一个那些页面。 If the data item is part of more than one page, you have to retrieve each of those pages.

在移动客户设备中实现智能客户代理连同缓存表促进了混合联机/脱机应用的发展和使用,其在本地访问数据(例如,脱机),但是也有利于它自己联机访问选择的(例如,非常易失的)数据。 Intelligent customers in the mobile client device proxy cache table together with the promotion of hybrid online / offline application development and use of its local access to data (for example, offline) in, but also conducive to its own online access to selected (for example, Very volatile) data. 移动设备也可以完全脱机操作并在返回到联机时提交数据的改变、完成的表格和其它信息。 Mobile devices can also operate completely offline and submit changes to the data in the back online, the completed forms and other information. 更进一步的,内容和应用可以被动态下载甚至可以被推进到客户端(例如,新的旅行路线,一组任务的改变)。 Further, content and applications can be dynamically downloaded or can be pushed to the client (for example, a new travel route, change a set of tasks).

在本发明的实施例中,存储在移动客户设备上的内容可以依照预定的模式存储。 In an embodiment of the present invention, the content stored on the mobile client device can follow a predetermined pattern storage. 根据该模式,内容可以存储在数据库表、数据服务器内容的瞬像、缓存表或其它结构中。 According to this model, the content may be stored in a database table, the contents of the data server snapshots, cache table, or other structure. 例如,在数据库中存储数据使客户代理能容易地并明确地装载和刷新数据。 For example, data stored in the database so that customers can easily and clearly agent loading and refresh the data. 在瞬像中存储数据便于把新的/更新的数据从服务器推进到客户(如下面进一步描述的)。 Storing data in snapshots to facilitate the new / updated data from the server to the client advance (as further described below). 在缓存表中存储数据,如以前的小节描述的,允许使用用于数据的智能刷新政策,也允许在要求时从实际的任何源(例如,服务器)装载。 Data stored in the cache table, as previously described in the section that allows the use of smart policy for data refresh, also allowing any source from the actual load requirements (for example, a server). 该模式可以包括URL(统一资源定位符)或与URL相关联,这里URL表示要被检索、装载、更新等等的数据的位置。 The pattern can include URL (Uniform Resource Locator) or associated with the URL, URL here said to be retrieved, load, update, and so the position data.

如上面提到的,除把内容与内容的显示格式分开以外,客户代理的实施例允许用户使用语音与移动应用交互。 As mentioned above, in addition to separate the content and the content of the display format Example client agent allows the user to interact with the application using voice mobile. 在上述的例子中。 In the above examples. 例如,用户可以说出零件号,移动应用可以通过说出相关联的库存数据进行响应。 For example, the user can say the part number, the mobile application can respond by saying the inventory data associated with it. 当用户操作车辆时或以其它的方式不能从另一个任务转移他的眼睛或手时,这可能是个特别的值。 As in other ways can not be transferred from his eyes or hands another task when the user operates the vehicle or it may be a particular value. 在客户代理的这个实施例中,语音应用程序或者语音到文本和文本到语音的转换器(例如,语法检查器、音位)的部件可以安装作为客户设备操作系统的一部分或者作为移动应用的一部分。 In this embodiment, the client agent, the voice applications or voice-to-text and text-to-speech converters (for example, grammar checker, phonemes) components can be installed as part of the client device's operating system or as part of a mobile application .

为本发明实施例配置客户设备的过程可能涉及把一组应用页面或模块、用于应用的内容或数据、模式页面、应用程序(例如,语音应用或实用程序)、浏览器等等下载到设备。 Embodiments of the present invention, the configuration process of the client device may involve the application of a set of pages or modules for applications or data content, mode page, the application (for example, voice applications or utilities), browsers, and so downloaded to the device . 设计的从用户得出数据或内容或者为用户提供数据或内容的应用页面可以表示为显示描述或格式(如上面描述的)。 Design derived from user data or content or provide users with data applications or content page can be expressed as described or display format (as described above). 对于根据本发明实施例配置的移动应用,下载页面可以识别一些或者所有的应用页面(显示格式)、语音文件、模式页面等等。 For mobile applications, the configuration according to embodiments of the invention, the download page can identify some or all of the application pages (display format), voice files, page mode, and so on. 装载或浏览下载页面可以自动地触发装载或检索每一个部件。 Loading or visit the download page can automatically trigger load or retrieve each component.

在本发明的实施例中,下载页面包括以适当的脚本语言写的程序。 In an embodiment of the present invention, the download page includes the appropriate scripting language to write the program. 该程序包括特殊的标签或标记(例如,“import”、“schema”)以识别要下载的数据项和要采取的动作。 The program includes a special tag or label (for example, "import", "schema") to identify the data to be downloaded items and actions to be taken. 因此,下载页面不仅仅是要缓存的页面或其它内容的纯粹的列表。 Therefore, not only to the download page cached page or purely a list of other content.

图4描述根据本发明的一个实施例配备有智能客户代理的移动客户设备。 Figure 4 depicts an embodiment is equipped with a smart client proxy mobile client device according to the present invention. 在这个实施例中,客户设备400可以是PDA、智能电话、手机、膝上型电脑或笔记本电脑或某个其它的移动计算设备。 In this embodiment, the client device 400 may be a PDA, smart phone, cell phone, laptop or notebook computer or some other mobile computing devices.

客户400包括数据库420、客户代理440和浏览器。 Client 400 includes database 420, 440 and browser client proxy. 客户浏览器可以与HTML(超文本标识语言)、XML(可扩展标识语言)或现在不知道或者以后开发的任何其它标识语言相兼容。 Client browser with HTML (Hypertext Markup Language), XML (Extensible Markup Language) or any other markup language development do not know now or later compatible. 使用下面描述的合适的协议识别和处理配置浏览器。 Use the following description of the appropriate protocols to identify and handle configuration browser. 客户代理440使用ODBC(开放式数据库互连)、JDBC(Java数据库互连)或某个其它的接口与数据库420交互。 Agent 440 customers use ODBC (Open Database Connectivity), JDBC (Java Database Connectivity) or some other interface 420 to interact with the database.

虽然客户代理440可以频繁地以脱机模式操作,但是当需要的时候(例如,如以下描述的)它也可以联机操作,在那时它可以通过无线(或有线)网络与一个或多个服务器接口。 Although the client agent 440 may frequently operate in offline mode, but when necessary (for example, as described below) at the time it can be wireless (or wired) network with one or more servers it can also be an online operation, interface. 客户代理440可以为本发明的一个或多个实施例如下面描述的一样操作,而不需要在客户400上的Java虚拟机器(VM)。 Client agent 440 of the present invention can be one or more embodiments, for example, as the operations described below, without the need for Java on the client 400 virtual machine (VM).

数据库420包括一个或多个以前小节中描述的缓存表422和相应的缓存控制信息424。 Database 420 includes one or more previously described cache table section 422 and the corresponding cache control information 424. 数据库也可以包括一个或多个从服务器拷贝的数据的瞬像426和数据表428。 Database may also include one or more servers from the instant data copies like 426 and 428 data tables. 例证性地,数据库420可以是Oracle 9I,9iLite,或由Oracle公司提供的另一个DBMS。 Illustratively, the database 420 may be Oracle 9I, 9iLite, or another DBMS provided by Oracle Corporation.

在图示的本发明实施例的一个实施中,数据库表例如表428在本地包含与数据服务器不同步的有用数据。 One embodiment of the present invention in the illustrated embodiment, the database table such as table 428 contains useful data on the local data server is not synchronized. 瞬像426包含可以与数据服务器定期同步的数据(来自数据服务器)的子集。 Snapshot 426 contains data server can periodically synchronize the data subsets (from the data server). 缓存表422包括有指定有效期的数据并且可以如以前小节中描述的那样被刷新(例如,当请求的缓存表内容是失时效时)。 Cache table 422 includes a designated period of validity of the data and may be as described in the previous section that is refreshed (for example, when the cache contents of the table when the request is stale).

客户代理440的高速缓存器442被配置存储要由浏览器显示的页面的显示描述或格式。 440 client proxy cache description or format display 442 is configured to store data to be displayed by the browser pages. 如上所述,当需要时显示格式可以容纳多种不同组的内容,从而不需要存储每一个组合的页面。 As described above, the display format when needed to accommodate a variety of content to different groups, thereby eliminating the need to store a combination of each page. 高速缓存器442也可以缓存从数据库420中选择的数据。 Cache 442 may also be selected from a database 420 cached data.

分配器444实现由浏览器定义的接口以把它自己注册为协议处理器。 The dispenser 444 implements the interface defined by the browser to put it registers itself as a protocol processor. 分配器从浏览器接收网页请求并把组合的页面传给浏览器。 The dispenser is received from the browser page request and the combination of the page to pass browser. 在本发明的一个实施例中,分配器444仅仅接收对应于一个或多个专用协议的页面请求。 In one embodiment of the present invention, the dispenser 444 corresponding to receive only one or more dedicated protocols page request. 例如,浏览器可以被配置以为Oracle移动客户(OMC)协议发送页面请求到分配器;这样的请求可以包括“omc://”形式的URL。 For example, the browser can be configured that Oracle Mobile Client (OMC) protocol to send page requests to the dispenser; such a request may include "omc: //" form of URL. 例证性地,正规的HTTP(超文本传输协议)请求(例如,可以由分配器444提交到服务器(例如,通过无线网络)。 Illustratively, the regular HTTP (hypertext transfer protocol) requests (for example, http: // can be submitted by the distributor 444 to the server (for example, through a wireless network). 如果请求页被缓存,分配器444将把组合的页面转递到浏览器;如果请求页没有被缓存,则可以把该请求转递到远程服务器。 If the requested page is cached, the distributor will combine 444 pages forwarded to the browser; if the requested page is not cached, the request can be forwarded to a remote server. 发送到远程服务器的请求可以由请求器450处理和/或通过队列452处理。 The request sent to the remote server can be processed by the requestor 450 and / or 452 through the queue processing.

分配器可以在把页面提供给浏览器之前检查包含在请求中的和包含在页面,例如MIME(多用途因特网邮件扩展)类型的页面的报头中的信息,并调用适当的请求处理器。 The dispenser can be checked before the page is contained in to the browser in the request and included in the page, such as MIME (Multipurpose Internet Mail Extensions) header types of pages of information, and calls the appropriate request handler. 请求处理器将采取适当的动作,该动作可以以浏览器支持的标识语言产生有效页面,然后分配器把该有效页面给浏览器。 Request processor will take appropriate action, which may be supported by the browser page markup language to produce effective, then the distributor to the active page to the browser. 客户代理440可以用OTL(脱机标签库)页面的请求处理器配置,OTL页面使用那些可能包含引用数据库表、瞬像和/或缓存表的SQL(结构话查询语言)标签的标签。 Client agent 440 can use OTL (offline tag libraries) page request processor configuration, OTL page may contain references to use those database tables, snapshots, and / or SQL cache table (Structured Query Language words) label label. 在图4中,脚本引擎446可以包括用于OTL MIME类型的处理器。 In Figure 4, the scripting engine 446 may include OTL MIME type of processor.

在图示的本发明实施例中,脚本引擎446组合将要通过浏览器(即,不是通过语音)图示地显示给用户的页面。 In the illustrated embodiment of the invention, the script engine 446 combination will be through the browser (that is, not by voice) shows graphically to the user's page. 当脚本引擎接收关于缓存页面的请求时(例如,从分配器444),它检索页面的显示格式(例如,来自高速缓存器442)和适当的数据(例如,来自数据库420)。 When the script engine receives a request for the cached page (for example, from the dispenser 444), it retrieves the page display format (for example, 442 from the cache) and the appropriate data (for example, from a database 420). 然后该数据与相应变量或显示格式的占位符结合以产生组合页。 The data is then displayed with the corresponding variable or placeholder format combined to produce a combined page. 然后组合页返回到分配器并传给客户浏览器。 Then return to the dispenser and the assembled page to the client browser.

脚本引擎446被配置成与语音引擎448一起工作。 The script engine 446 is configured to work with the speech engine 448. 当脚本引擎遇到例如&lt;say...&gt;或&lt;prompt...&gt;这样的语音标签时,它给语音引擎的适当方法准备自变量并调用该方法。 When the script engine encountered such as & lt; say ... & gt; or & lt; prompt ... & gt; when such a voice tag that appropriate methods to prepare arguments to speech engine and call the method. 然后语音引擎在听觉上响应该方法调用并返回控制和该方法调用的结果到脚本引擎。 The speech engine in response to the method call and returns the results to control and the method call to the scripting engine in the hearing.

页面请求器450可以处理与远程系统(例如,数据服务器)的交互以检索请求的页面(例如,显示格式)和/或那些不在本地存储的或在本地存储但是失时效的内容。 450 interactive page request can be processed with a remote system (for example, data server) to retrieve the requested page (for example, display format), and / or those that are not stored locally, or the content of local storage but stale. 队列452可以存储请求和/或要与远程系统交换的其它通信。 Queue 452 can store the request and / or other communications to be exchanged with the remote system.

推进式监听器454可以被配置监听推进的内容、页面(例如,显示格式)、下载的页面、应用页面、和/或其它项。 Propelled listener 454 may be configured to monitor the content of propulsion, the page (for example, the display format), page download, the application page, and / or other items. 推进可以作为SMS(短消息业务)通信或以客户400可识别的其它格式被接收。 Boosting can be received as SMS (Short Message Service) communication or other formats to customers 400 identifiable. 正如推进的一个例子,数据服务器可以推进包含一系列SQL语句的SMS消息。 As an example of the advance, the data server can advance SMS message contains a series of SQL statements. 推进式监听器454可以执行这些语句或把它们推进到分配器444或客户代理440的某个其它部件以执行。 Propelled listener 454 can execute these statements or to push them to the dispenser 444 or client agent 440 to perform some other components. 例证性地,这些语句可能导致新的或更新的数据存储在数据库420中。 Illustratively, these statements may result in 420 new or updated database data is stored in.

图5A-C描述根据本发明的一个实施例用智能客户代理操作移动应用的方法。 Figure 5A-C Description cases with smart client according to one embodiment of the invention the agent operating method of a mobile application. 在这个实施例中,移动应用在移动的或便携的(例如,无线的)计算设备(例如图4的客户设备400)上执行。 In this embodiment, the mobile application in mobile or portable (eg, wireless) computing devices (for example, the client device 400 of FIG. 4) on the implementation. 移动应用被配置用于脱机操作(例如,没有任何的到远程服务器或其它计算机系统的有效连接),但是利用可用的连接来检索那些失时效的或不可用的数据(例如,没有存储在移动设备上的)。 Mobile application is configured for offline operation (for example, there is no valid connection to a remote server or other computer systems), but the use of available connection to retrieve those stale or unavailable data (for example, not stored in the mobile ) device.

图5A演示操作分配器(例如,图4的分配器444)的方法。 Figure 5A demonstrates the operation distributor (e.g., distributor 444 of FIG. 4) of the method. 图5B-C演示操作脚本引擎(例如,图4的脚本引擎446)的方法。 Figure 5B-C demo action script engine (for example, the scripting engine 446 of FIG. 4) of the method.

在图5A的状态502中,智能客户代理(例如,图4的分配器444)从调用者,典型的是客户浏览器,接收请求。 5A, the state 502, the smart client agent (for example, the dispenser 444 of FIG. 4) from the caller, typically the client browser request is received. 例证性地,该请求可以按与客户代理相关联的一组预定协议(例如,OMC)中的一个协议提交。 Illustratively, the request can be associated with a set of predetermined client proxy protocol (for example, OMC) an agreement to submit.

在状态504中,分配器确定请求的页面或其它项当前是否被缓存。 In state 504, the dispenser to determine the requested page or other item is currently cached. 特别地,分配器可以检查客户代理高速缓存器(例如,图4中的高速缓存器442)以确定它是否包含关于请求页面的显示描述或格式。 In particular, the dispenser can check the client proxy cache (for example, Figure 4 cache 442) to determine whether it contains information about the requested page display description or format. 如果请求页的格式在高速缓存器中,那么图示的方法进入状态510。 If the format requested page in the cache, then the method enters the state 510 shown.

否则,如果没有被缓存,那么在状态506中客户代理把请求转递到请求器(例如,图4的请求器450)以传给远程系统。 Otherwise, if not cached, then the state of the client 506 to transmit the request to the requesting agent (e.g., 450 of FIG. 4 requests) transmitted to the remote system. 如果移动设备当前是脱机的,该状态可以使请求排队直到连接是可用的。 If the mobile device is currently offline, the state can make a request queue until a connection is available.

在状态508,从远程服务器返回的页面(例如,显示页面)被放进高速缓存器。 In state 508, the page returned from the remote server (for example, display the page) was placed in the cache.

在状态510中,分配器确定是否应把请求的页面照原来的样子返回给调用者(例如,浏览器)或确定是否应把请求页面发送到处理器之一以进行进一步的处理。 In state 510, the dispenser to determine whether the requested page according to the original look back to the caller (for example, a browser) or to determine if the request should be sent to one page processor for further processing. 例证性地,如果页面是OTL页面,分配器将调用脚本引擎,脚本引擎起到OTL页面处理器的作用。 Illustratively, if the page is OTL page allocator will call the script engine, script engine acts as OTL page processor. 如果不需要进一步的处理,图示的方法进入状态516。 If no further processing, the method enters state 516 illustrated.

在状态512中,分配器调用处理器(例如,脚本引擎)来处理页面。 In state 512, the dispenser call processor (for example, the script engine) to handle page. 图5B演示脚本引擎根据其操作的一种方法。 Figure 5B demonstrates scripting engine A method according to its operation.

在状态514中,分配器检查以了解处理器是否已经返回页面。 In state 514, the dispenser checks to see whether the processor has returned the page. 如果没有,该方法前进到状态518。 If not, the method proceeds to state 518.

在状态516中,请求的页面被递送给调用者。 In state 516, the requested page is delivered to the caller. 然后图示的分配器方法结束。 Then the end of the dispenser way of illustration.

在状态518中,分配器可能显示错误,这样结束该方法。 In state 518, the dispenser may display an error, so the method ends. 或者,分配器可能为由处理器提供的页面等待额外的一段时间,或者重试该操作。 Alternatively, the dispenser may be provided by the processor by waiting for additional pages for some time, or retry the operation.

根据本发明的一个实施例,图5B描述了OTL处理器例如图4的脚本引擎446的操作。 According to one embodiment of the present invention is described in Figure 5B OTL processor such as the operation of FIG. 4 scripting engine 446. 在这个实施例中,脚本引擎接收OTL页面作为输入。 In this embodiment, the script engine receives as input OTL page. OTL页面典型地包含页面的显示格式。 OTL page typically contains the display format of the page. 显示格式可以起到一种页面模板的作用。 The display format can play the role of a page template. 然而不是包含真实数据,数据由它们的变量、字段或列名称、表名称或其它占位符来表示。 However, not contain the actual data, by their variable, field or column names, table names, or other placeholder to represent. OTL页面可以包含下载其它页面或资源(例如,图像文件)的标签、如果需要就形成数据库模式的标签、与语音引擎交互的标签、执行SQL语句并把结果与变量绑定的标签、把变量值写到输出文件的标签、和提供需要的流程控制以编程产生输出网页的标签。 OTL page may contain download other pages or resources (such as image files) label, if necessary to form the database schema tag, and label the speech engine interaction, execute SQL statement and the result variable bound label, the variable value label written to the output file, and processes provide the necessary control to programmatically generate output pages of labels.

在状态530中,OTL处理器产生空的输出页面。 In state 530, OTL processor produces empty output page. 当图示的方法前进时,输出页面将容纳来自输入页面的内容和/或其它内容。 When the method illustrated forward, the output page will contain content and / or other content from the input page.

在状态532中,它开始扫描输入的页面或内容。 In state 532, it begins to scan a page or content input. 例证性地,扫描可以逐个标签地执行。 Illustratively, scanning can be performed by one label.

在状态534中,检查标签以了解该标签是否是OTL标签。 In state 534, check the label to see if the label is OTL label. 如果是OTL标签,该方法在状态540继续。 If OTL label, which in the state 540 continues.

否则,在状态536,标签不是OTL标签,这样脚本引擎把字符从输入页面拷贝到输出页面,直到在输入中遇到OTL标签或者到达页面的末端。 Otherwise, the state 536, the label is not a label OTL, so that the script engine to copy a character from the input to the output page page until it encounters OTL label or reaches the end of a page in the input. 如果遇到OTL标签,该方法前进到状态540。 If you encounter OTL label, the method proceeds to state 540.

否则,如果到达输入的末端,在状态538中输出页面被关闭并被返回到调用者(例如,分配器),该方法结束。 Otherwise, if you reach the end of the input, output in the status page 538 is closed and returned to the caller (for example, a distributor), the method ends. 输出页面可能是空的。 Output page may be empty.

在状态540,脚本引擎检验标签以了解它是否是“下载“标签。 In state 540, the script engine test label to see if it is the "Download" tab. 如果不是,该方法在状态544继续。 If not, the method continues at state 544.

但是,如果该标签是下载标签,那么在状态542中脚本引擎调用分配器以在URL下载页面,该URL被指定为下载标签的属性。 However, if the label is to download the label, then call distributor in the state 542 in the script engine to the download page URL, the URL is specified as attributes download tag. 在图示的本发明的实施例中,不在这个点上解析或执行下载的页面。 In the illustrated embodiment of the present invention, does not resolve on this point or the download page. 在下载页面后,脚本引擎返回状态532。 After downloading the page, the script engine returns status 532.

在状态544中,检验标签以了解该标签是否是“输入”标签。 In state 544, a check labels to see whether the label "Input" tab. 如果不是,该方法前进到状态548。 If not, the method proceeds to state 548.

否则,如果标签是输入标签,在状态546中调用分配器以输入带有URL的页面,该URL被提供作为输入的标签属性。 Otherwise, if the label is an input label, call the distributor in the state with 546 to enter the URL of the page, the URL is provided as an input tag attributes.

例证性地,脚本引擎把输入模式设置为“开”。 Illustratively, the script engine input mode is set to "On." 把输入模式转到“开”表示分配器正在处理输入页面,并且可能表示脚本引擎(如果分配器调用脚本引擎)正在处理输入的页面。 The input mode to "ON" indicates the dispenser is processing the input page, and may indicate that the script engine (if the distributor calls the script engine) is processing the input page. 然后脚本引擎产生到分配器的递归调用并提供要被输入的页面的URL。 Then the script engine produces a recursive call to the dispenser and provides the input to the page URL. 当分配器返回控制给脚本引擎时,输入模式被设置为“关”,图示的方法在状态532重新开始。 When the dispenser returns control to the script engine, input mode is set to "Off", the method illustrated in the state 532 to start again.

在状态548中,如果标签不是“输入”标签,那么脚本引擎检验标签以了解该标签是否是“模式”标签。 In state 548, if the label is not "input" tag, the script engine test label to see whether the label "Mode" tab. 如果不是模式标签,该方法前进到状态554。 If not model label, the method proceeds to state 554.

在状态550,脚本引擎检查本地数据库以了解该模式是否已经存在,如果存在,该方法返回到状态532。 In state 550, the scripting engine checks the local database to see if the model already exists, if it exists, the method returns to state 532.

否则,在状态552脚本引擎调用调度器以处理在由“模式”标签给出的URL的页面。 Otherwise, the state 552 script engine calls the scheduler to handle the URL from the "model" label given page. 在状态552之后,方法返回到状态532。 After state 552, the method returns to state 532.

在状态640,脚本引擎确定输入模式是开还是关。 In state 640, the script engine determines whether the input mode is on or off. 如果输入模式是开,这表示正被处理的页面是下载页面。 If the input mode is on, which means that the page is being processed is the download page. 因此,脚本引擎不会尝试处理该页面中其它的标签,而是从状态520开始重新操作。 Therefore, the script engine does not attempt to deal with the other labels pages, but starting from the state 520 to re-operate. 例证性地,这帮助保证了不立刻执行输入的页面并且也下载或输入它们依赖的任何页面和产生它们依赖的任何模式。 Illustratively, which helps to ensure that the input is not performed immediately and also download the pages or enter any page on which they depend and rely on them to produce any pattern.

在状态556中,检查OTL标签以了解该标签是否是“SQL”标签。 In state 556, check the label to see the label OTL whether the "SQL" tab. 如果不是,该方法进入状态562。 If not, the method proceeds to state 562.

否则,在状态558中脚本引擎访问客户DBMS以执行伴随标签的查询。 Otherwise, the state 558 script engine access client DBMS to execute the query associated with the label.

然后,在状态560中脚本引擎把查询结果(例如,表)绑定到包括在“SQL”标签中的变量。 Then, in the state 560 script engine query results (eg, tables) is bound to include the "SQL" tab variable. 然后该方法返回到状态532,在那里继续扫描输入页面。 The method then returns to state 532, where it continues to scan the input page.

在状态562中,如果遇到的标签不是“提交”标签,脚本引擎前进到状态566。 In state 562, if the label is not met "Submit" tab, the script engine advances to state 566.

否则,在状态564,脚本引擎通过把输出页面提交到队列(例如,图4的队列452)来响应该提交的标签,该队列将把页面转送到指定的服务器。 Otherwise, the state 564, the script engine by the output page is submitted to the queue (for example, a queue 452 of FIG. 4) to respond to the submitted label, the queue will be transferred to the designated page server.

在本发明的这个实施例中,提交标签至少有三个属性。 In this embodiment of the invention, the submitted label has at least three attributes. 第一个属性是页面要提交到的服务器的URL。 The first attribute is the URL of the page you want to submit to the server. 第二个属性识别表示成功提交的从服务器返回的编码。 The second property represents coded identification returned from the server successfully submitted. 第三个是如果从服务器返回的编码是除了在第二个属性中识别的编码以外的任何编码则将要被访问的那个页面的URL。 The third is that if the code is returned from the server in addition to the identification of a second property in any encoding will be encoded to be accessed that page URL.

当队列有到服务器的连接时,它将提交任何排队的请求。 When the queue has a connection to the server, it will submit any requests queued. 如果有错误,它将访问错误处理页面并把服务器的URL和返回的编码传递给错误处理页面。 If there are errors, it will access the page and the URL error handling server and return code is passed to the error-handling page.

在状态566,检查标签以了解它是否是语音标签。 In state 566, check the label to see if it is a voice tag. 如果不是,图示的方法前进到状态570。 If not, the method proceeds to state 570 illustrated.

否则,如果它是语音标签,在状态568引擎脚本从脚本的变量中准备参数值以调用必要的语音引擎方法。 Otherwise, if it is a voice tag, prepare the values from the variable script in state 568 engine script to invoke the necessary speech engine method. 作为调用方法的结果,语音引擎将向用户说出一个消息(如果语音标签是“说(say)”标签)或在听觉上提示用户输入(如标签是“提示(prompt)”标签)。 As a result of calling the method, the speech engine speak a message to the user (if the voice tag is, "said (say)" label) or auditory cues on user input (such as a label is "prompt (prompt)" label). 如果标签是提示,那么语音引擎将接受听觉上的输入然后试图识别它并把它转变为文本串。 If the label is prompt, so the speech engine will accept input auditory and attempt to identify it and put it into a text string. 这个文本串作为方法的结果被返回。 This text string is returned as a result of the method. 然后脚本引擎返回到状态532继续扫描输入的页面。 Then the script engine returns to state 532 continues to scan the input page.

在状态570,脚本引擎检验标签以了解标签是否是“out”标签。 In state 570, the script engine test label to see whether the label is "out" label. “out”标签告诉脚本引擎输出值(常数或与变量结合的值)。 "Out" tag tells the script engine output value (constant or variable combination of value).

如果标签是“out”标签,在状态572中脚本引擎把值写到输出页面然后返回到状态532。 If the label is "out" label, in the state of the script engine 572 writes the value of the output of the page and then return to the state 532.

如果标签不是“out”标签,那么在状态574中脚本引擎把该标签作为它支持的语句之一进行处理,然后返回到状态532。 If the label is not "out" label, then the state of the script engine 574 to the tag as the one statement that it supports for processing and then returned to the state 532.

在执行图5B-C的方法时,脚本引擎为请求的页面检索数据。 When the method execution Figure 5B-C, the script engine to retrieve data for the requested page. 例如,如果数据当前存储在客户数据库中(例如,在表、缓存表或瞬像中)并且是有效的,则可以在状态558的过程中从数据库检索数据。 For example, if the data is currently stored in the customer database (for example, in the table, the cache table or snapshots) and are effective, it can retrieve data from the database in a state 558 in the process. 然而,如果任何数据项当前都不在数据库中,或者如果必要的数据项是失时效的,那么客户引擎可以发起到远程系统的连接以检索一个或多个数据项。 However, if any of the data items currently not in the database, or if the necessary items is stale, then the client engine can initiate the connection to the remote system to retrieve one or more data items. 在本发明的这个方法中,可以指出的是通过仅仅检索必要的数据,到远程系统的连接减到最少。 In the process of the present invention, it may be noted that by simply retrieve the necessary data, the connection to the remote system is minimized. 特别地,客户引擎可以避免下载其它的数据(例如,那些本地提供的和不失时效的数据)和请求页面的非数据部分(例如,显示描述或格式)。 In particular, the client engine to avoid downloading other data (for example, those provided locally and timeliness of data yet), and request the non-data portion of the page (for example, displays a description or format).

仅仅为了说明和描述的目的,已经介绍了前面的本发明实施例。 Solely for purposes of illustration and description, it has been introduced in front of the embodiments of the invention. 前面的描述并不是详尽的,且也不打算把本发明限定到所公开的形式。 The foregoing description is not exhaustive, and are not intended to limit the invention to the forms disclosed. 因此,上述公开的内容不用于限定本发明;本发明的范围由附加的权利要求来限定。 Accordingly, the above disclosure is not intended to limit the invention; the scope of the invention is defined by the claims appended hereto.

Referenced by
Citing PatentFiling datePublication dateApplicantTitle
CN102541870A *15 Dec 20104 Jul 2012金蝶软件(中国)有限公司Processing method and system of data sheet
CN104331492A *14 Nov 20144 Feb 2015北京国双科技有限公司Method and device for caching multi-instance data
US863972016 Dec 201028 Jan 2014International Business Machines CorporationData access method and configuration management database system
International ClassificationG06F12/00, G06F13/00, G06F17/30
Cooperative ClassificationY10S707/99953, Y10S707/99945, Y10S707/99942, G06F17/3048
European ClassificationG06F17/30S4P4C
Legal Events
24 Aug 2005C06Publication
19 Oct 2005C10Request of examination as to substance
22 Oct 2008C14Granted