WO2017045410A1 - 一种在分页模型中动态加载数据的方法及装置 - Google Patents

一种在分页模型中动态加载数据的方法及装置 Download PDF

Info

Publication number
WO2017045410A1
WO2017045410A1 PCT/CN2016/082255 CN2016082255W WO2017045410A1 WO 2017045410 A1 WO2017045410 A1 WO 2017045410A1 CN 2016082255 W CN2016082255 W CN 2016082255W WO 2017045410 A1 WO2017045410 A1 WO 2017045410A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
client
specified page
page
table model
Prior art date
Application number
PCT/CN2016/082255
Other languages
English (en)
French (fr)
Inventor
刘金宏
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017045410A1 publication Critical patent/WO2017045410A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Definitions

  • the present application relates to, but is not limited to, the field of data display technology, and in particular, a method and apparatus for dynamically loading data in a paging model.
  • routers In a mobile communication system, the number of routers (routers) usually reaches hundreds of thousands, and the number is large. If all the data is loaded into the page, it takes a long time to load the data into the page, so paging is required to display the data in the user interface.
  • the time for the user to switch to other pages is uncertain.
  • the data in the database may be added, deleted, and the data in the database may have changed.
  • the data displayed in the user interface is not the same as the data stored in the corresponding storage location in the database.
  • the purpose of the present application is to provide a method and apparatus for dynamically loading data in a paging model, which solves the problem that the data in the interface of the related art is inconsistent with the data stored in the corresponding storage location in the database.
  • a method of dynamically loading data in a paging model comprising the steps of:
  • the data of the specified page is obtained and displayed from the client table model
  • the client obtains the data of the specified page from the server, and automatically updates the client table model with the acquired data of the specified page, and The client form model retrieves and displays the data of the specified page.
  • the server when the server adds or deletes data that has been loaded on a specified page of the client table model, the server acquires and saves data of a specified page that has been added or deleted data, and the client saves and displays The data that has been loaded on the specified page of the client table model.
  • the server acquires and saves the data of the specified page of the added or deleted data and Data of other pages of data having been added or deleted
  • the client saves and displays the data of the page loaded in the client table model, and obtains the data of the specified page of the added or deleted data from the server, and The acquired data of the specified page on which the data has been added or deleted is automatically updated in the client table model.
  • the method for dynamically loading data in the paging model further includes:
  • the client detects whether the data of the specified page that has been added or deleted data has the same data as the data that has been loaded into the client table model
  • the client detects that the data of the specified page to which the data has been added or deleted has the same data as the data that has been loaded into the client table model, the acquired data added or deleted is removed.
  • the data of the specified page that is the same as the data of the page that has been loaded into the client table model.
  • the data of the specified page is obtained and displayed from the client table model; or, when determining the client table model
  • the client acquires the data of the specified page from the server, and automatically updates the client table module with the acquired data of the specified page.
  • the method further includes: when the server adds or deletes data, causing the number of pages in the server to increase or decrease, the client acquires data of the specified page from the server, and uses the specified page The data is automatically updated by the client table model.
  • the server adds or deletes data of the page
  • the number of pages in the server increases or decreases
  • the client Obtaining, from the server, data for filling the remaining pages of the specified page that are not full of data and the number of pages after adding or deleting data, and using the specified page for filling the unfilled data
  • the client table model is automatically updated with the data of the remaining pages and the number of pages after the data is added or deleted.
  • the application further provides a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • an apparatus for dynamically loading data in a paging model comprising:
  • the determining module is configured to determine, when the client is required to display the data of the specified page, whether the data of the specified page has been loaded in the client table model;
  • a display module configured to: when it is determined that the data of the specified page has been loaded in the client table model, obtain and display data of the specified page from the client table model; or, when determining that the client table model is not loaded
  • the client obtains the data of the specified page from the server, and automatically updates the client table model with the acquired data of the specified page, and obtains and displays the method from the client table model. Specify the data for the page.
  • the display module includes:
  • a first display unit configured to: when it is determined that data of the specified page has been loaded in the client table model, when the server adds or deletes data that has been loaded on a specified page of the client table model, the server Acquiring and saving data on a specified page to which data has been added or deleted, the client saves and displays data that has been loaded on a specified page of the client table model.
  • the display module further includes:
  • a second display unit configured to: when it is determined that the data of the specified page is not loaded in the client table model, the data of the specified page is not loaded in the client in the client table model and the service
  • the server adds or deletes the data of the loaded page
  • the server acquires and saves the data of the newly specified page of the added or deleted data and the data of the other pages of the added or deleted data, so that the client Saving and displaying the data of the page loaded in the client table model, and obtaining the data of the specified page in the added or deleted data from the server, and automatically acquiring the data of the specified page in the added or deleted data Update the client table model.
  • the device further includes a detection module, the detection module configured to: after the client table model is automatically updated with the acquired data of the specified page of the added or deleted data, the client is detected by the client Whether the data of the specified page that has been added or deleted data has the same data as the data that has been loaded into the client table model;
  • the client detects that the data of the specified page to which the data has been added or deleted has the same data as the data that has been loaded into the client table model, the acquired data added or deleted is removed.
  • the data of the specified page that is the same as the data of the page that has been loaded into the client table model.
  • the device further includes an obtaining module, where the obtaining module is configured to: when the data of the specified page has been loaded in the client table model, obtain and display the data from the client table model Specifying data of the page; or, when determining that the data of the specified page is not loaded in the client table model, the client acquires data of the specified page from the server, and automatically updates the acquired data of the specified page.
  • the client forms a model
  • the server adds or deletes data, causing the number of pages in the server to increase or decrease
  • the client is caused to acquire data of the specified page from the server, and use the data of the specified page.
  • the client table model is automatically updated.
  • the obtaining module is configured to increase or decrease the number of pages in the server when the server adds or deletes data of the page, and the data loaded in the client table model does not fill the specified
  • the client acquires data for filling the remaining pages of the specified page that are not full of data and the number of pages after adding or deleting data from the server, and
  • the client table model is automatically updated with the data of the remaining pages of the specified page full of data and the number of pages after the data is added or deleted.
  • the client only loads a small amount of data per page, so that the client's page can Fast presentation and improved usability.
  • the client-to-server data changes maintain a limited consistency, that is, only consistent with the data that the client does not load, reducing the complexity of the interaction between the client and the server.
  • FIG. 1 is a flowchart of a method for dynamically loading data in a paging model according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an apparatus for dynamically loading data in a paging model according to an embodiment of the present invention
  • FIG. 3 is a flowchart of updating a total number of pages in a paging model according to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of initially loading first page data in a paging model according to an embodiment of the present invention
  • FIG. 5 is a schematic diagram of loading a second page of data in a paging model according to an embodiment of the present invention
  • FIG. 6 is a schematic diagram of jumping to a third page in a paging model according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of loading a second page in a paging model according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of reloading third page data in a paging model according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of updating only data of a current page in a paging model according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for dynamically loading data in a paging model according to an embodiment of the present invention. As shown in FIG. 1 , the method includes the following steps:
  • Step S101 When the client is required to display the data of the specified page, determine the client table. Whether the data of the specified page has been loaded in the model;
  • Step S102 When it is determined that the data of the specified page has been loaded in the client table model, the data of the specified page is obtained and displayed from the client table model;
  • Step S103 When it is determined that the data of the specified page is not loaded in the client table model, the client obtains the data of the specified page from the server, and automatically updates the client table model with the acquired data of the specified page. And obtaining and displaying the data of the specified page from the client table model.
  • the server when the server adds or deletes data that has been loaded on a specified page of the client table model, the server acquires and saves data of a specified page that has been added or deleted data, and the client saves and displays The data that has been loaded on the specified page of the client table model.
  • the server acquires and saves the specified page of the added or deleted data.
  • the client saves and displays data of a page loaded in the client table model, and acquires the specified page of the added or deleted data from the server The data is automatically updated with the acquired data of the specified page of the added or deleted data.
  • the method for dynamically loading data in the paging model further comprises: the client End detecting whether the data of the specified page that has been added or deleted data has the same data as the data that has been loaded into the client table model; when the client detects the specified page of the added or deleted data And when the data is the same as the data that has been loaded into the client table model, then the obtained specified page of the added or deleted data is removed from the loaded form to the client table model.
  • the data of the page is the same data.
  • the method for dynamically loading data in the paging model provided by the application further includes: when the server adds or deletes data, causing the number of pages in the server to increase or decrease, the client acquires the specified page from the server. Data, and automatically update the client table model with the data of the specified page.
  • the server adds or deletes data of the page
  • the number of pages in the server increases or decreases
  • the loaded data in the client table model does not fill the specified
  • the client acquires data for filling the remaining pages of the specified page that are not full of data and the number of pages after adding or deleting data from the server, and
  • the client table model is automatically updated with the data of the remaining pages of the specified page full of data and the number of pages after the data is added or deleted.
  • Embodiments of the present invention further provide a computer readable storage medium storing computer executable instructions that are implemented when the computer executable instructions are executed.
  • FIG. 2 is a schematic diagram of an apparatus for dynamically loading data in a paging model according to an embodiment of the present invention.
  • the method includes: a determining module 201 and a display module 202.
  • the determining module 201 is configured to determine, when the client is required to display the data of the specified page, whether the data of the specified page has been loaded in the client table model;
  • the display module 202 is configured to determine the client table When the data of the specified page has been loaded in the model, the data of the specified page is obtained and displayed from the client table model; or, when it is determined that the data of the specified page is not loaded in the client table model, the client Obtaining data of the specified page from the server, and automatically updating the client table model with the acquired data of the specified page, and acquiring and displaying data of the specified page from the client table model.
  • the display module 202 includes: a first display unit, configured to add or delete the loaded client table in the server when it is determined that the data of the specified page has been loaded in the client table model
  • the server acquires and saves the data of the specified page to which the data has been added or deleted, and the client saves and displays the data that has been loaded on the specified page of the client table model.
  • the display module 202 includes: a second display unit, configured to: when it is determined that the data of the specified page is not loaded in the client table model, the data of the specified page is not loaded in the client table model of the server and When the server adds or deletes data of a loaded page, the server acquires and saves data of a specified page that has added or deleted data and data of other pages that have added or deleted data, so that the client Saving and displaying the data of the page loaded in the client table model, and obtaining the data of the specified page in the added or deleted data from the server, and automatically acquiring the data of the specified page in the added or deleted data Update the client table model.
  • a second display unit configured to: when it is determined that the data of the specified page is not loaded in the client table model, the data of the specified page is not loaded in the client table model of the server and When the server adds or deletes data of a loaded page, the server acquires and saves data of a specified page that has added or deleted data and data of other pages that have added or deleted data
  • the apparatus further includes a detection module configured to: after automatically updating the client table model with data of the specified page of the acquired added or deleted data, The client detects whether the data of the specified page that has been added or deleted data has the same data as the data that has been loaded into the client table model;
  • the client detects that the data of the specified page to which the data has been added or deleted has the same data as the data that has been loaded into the client table model, the acquired data added or deleted is removed.
  • the data of the specified page that is the same as the data of the page that has been loaded into the client table model.
  • the device further includes an obtaining module, where the obtaining module is configured to: when the data of the specified page has been loaded in the client table model, obtain and display the data from the client table model Specifying data of the page; or, when determining that the data of the specified page is not loaded in the client table model, the client acquires data of the specified page from the server, and automatically updates the acquired data of the specified page.
  • the client forms a model
  • the server adds or deletes data, causing the number of pages in the server to increase or decrease
  • the client is caused to acquire data of the specified page from the server, and use the data of the specified page.
  • the client table model is automatically updated.
  • the obtaining module is configured to increase or decrease the number of pages in the server when the server adds or deletes data of the page, and the data loaded in the client table model does not fill the specified
  • the client acquires data for filling the remaining pages of the specified page that are not full of data and the number of pages after adding or deleting data from the server, and
  • the client table model is automatically updated with the data of the remaining pages of the specified page full of data and the number of pages after the data is added or deleted.
  • the loading strategy is implemented on the client side, and the loading strategy includes: storing data in an area of the memory in the client table model, for example, if implemented by using Java, the List ⁇ Map ⁇ String, Object>> object can be used. Storing data. At the beginning, there is no data stored in the List. When the data of the specified page needs to be displayed, it is loaded into the List page by page. Each Map ⁇ String,Object> object in the List represents a record in the database.
  • This record is from the database and can not be exactly the same as the record currently stored in the database when it is stored, so as to be suitable for the operation of the client. .
  • the interface should also include: whether the router is selected for synchronization, various states during synchronization, progress, and exception information. This information is related to customer operations and does not need to be saved to the database. At the same time, these operational information is important to the user and cannot be cleared due to changes in the data in the database. Therefore, it is necessary to retain this information when the page is switched.
  • data is stored by the List ⁇ Map ⁇ String, Object>> object.
  • the data of the specified page needs to be displayed, the data of the specified page is loaded into the List.
  • the data list of the nth page is first obtained from the model. If the length of the data list is >0, the data is considered to have been loaded into the client table model, and there is no need to re-acquire from the database. data. If the length of the data list is 0, it means that the nth page has no data in the client table model and needs to load data from the server.
  • the client table model After obtaining the nth page data through the interface of the server, it is stored in the client table model.
  • the data in the database changes during the page switching process, the data of the page has been loaded into the client table model.
  • the client table model The data of the corresponding page will not be updated again. In this way, the data displayed in the interface will be inconsistent with the data in the actual database, but it is considered reasonable.
  • the data of the page needs to be obtained from the database. At this point, the records corresponding to some rows in the data of the page obtained from the database may already exist in the loaded page.
  • the principle of processing is to share the same data source with the data of the loaded page. That is, the same record will appear in one or more pages, all pointing to the same data source. When any one page modifies the record, the other pages will automatically follow the changes.
  • the interface When the interface is initialized, only the data of the first page is displayed. At this time, the first page data is obtained from the server according to the conditions set by the user (the returned result should also include the total number of pages). After the data is acquired, the data of the first page is displayed on the page, and the range of pages that can be jumped is set according to the number of pages. For example, if the current number of pages is 10, the user can jump in the page within the range [1, 10]. After the first page of the operation is completed, the customer can click on the "next page" or "jump to specify” in the page. The page "switches to another page. Suppose you switch to the Nth page. At this time, the data of the page N is not loaded into the client table model, and the data of the page N is obtained from the database.
  • the data in the database has changed during this time period.
  • the changes include:
  • the data on the first page is now inconsistent with the data on the first page in the database (including adding and deleting records).
  • the data that has been loaded into the page will not be updated, and the current state will be retained. That is, the client and the server are allowed to inconsistent with this data.
  • the data on the first page will be sorted to the second page by sequentially adding some records to the first page. Since the data of the first page will not be updated once it is loaded, when the data of the second page is loaded, the same data as the first page is displayed.
  • the first page data includes: 1001, 1002, 1005, 1006, and 1007. As shown in Figure 4.
  • the data in the actual database is not consistent with the interface at this time.
  • the data includes: 1001, 1002, 1003, 1004, and 1006.
  • 1003 and 1004 are added, 1005 has been deleted, and 1007 has moved to the second page.
  • 1007 has moved to the second page.
  • its first page will not change, still showing the 5 records of 1001, 1002, 1005, 1006 and 1007.
  • the second page the five records of 1007, 1008, 1009, 1010, and 1011 are displayed.
  • the total number of pages may also change as the data in the database changes (increases or deletes).
  • the total number of pages in the interface also needs to change synchronously.
  • Step 1 Display page pageNo
  • Step 2 Determine whether the page pageNo data has been loaded into the client table model. If it is determined that the page pageNo data has been loaded into the client table model, proceed to step 9, if it is determined that the page pageNo data is not loaded into the client table model. Then proceed to step 3.
  • Step 3 Loading the data of the page corresponding to the pageNo from the database
  • Step 4 Get the total number of pages from the query data, and update the total number of pages in the interface pageCount;
  • Step 6 Empty all the data of the page larger than pageCount in the client table model
  • Step 7 Set pageNo to pageCount and reload it
  • Step 8 Update the data of the queried page to the client table model
  • Step 9 Display the data of the page in the page.
  • TP the current total number of pages
  • the page p1 is loaded, it is found that the total number of pages changes to TP1, and TP1>TP, that is, the page is increased.
  • the page p appears not the last page.
  • the number of page records does not match the single page capacity.
  • you switch to page p again you need to load the data of the page again, but when updating the page, the original data remains unchanged, and the corresponding data is only filled in the position where there is no data.
  • the load policy determines whether the data of a certain page needs to be reloaded from the database.
  • the condition is that the number of records of the page after the switch is equal to 0; the second condition is that the number of records of the page after the switch is in the range ( 0, single page capacity), and the current page number is less than the total number of pages.
  • the client of the application displays data in a paging manner, and can dynamically load a large amount of data stored on the server. Quickly display the interface, reducing the complexity of maintaining data consistency between the client and the server. Especially for the case where the client manipulates the data of the page page by page, and during the operation, a change related only to the state of the client is made, ensuring that these states are not cleared due to changes in the data stored in the corresponding storage location in the database. Greatly facilitate the operation and maintenance of the business.
  • the instructions are related to hardware (eg, a processor) that can be stored in a computer readable storage medium, such as a read only memory, a magnetic disk, or an optical disk.
  • a computer readable storage medium such as a read only memory, a magnetic disk, or an optical disk.
  • all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits.
  • each module/unit in the above embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, executing a program stored in the memory by a processor. / instruction to achieve its corresponding function.
  • Embodiments of the invention are not limited to any specific form of combination of hardware and software.
  • the technical solution provided by the application enables the client to load only a small amount of data per page through the paging mode, so that the client's page can be quickly presented and improved in availability; when the data is loaded page by page, if the data on the client is different from the data on the server. Keeping the data on the client unchanged, it is more suitable for most business-related operation and maintenance scenarios; the client-to-server data changes have limited consistency, that is, only consistent with the data that the client does not load, reducing the customer The complexity of the interaction between the end and the server.

Abstract

一种在分页模型中动态加载数据的方法及装置,该方法包括以下步骤:在客户端被要求显示指定页面的数据时,判断在客户端表格模型中是否已加载所述指定页面的数据;当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型,并从客户端表格模型获取并显示所述指定页面的数据。通过上述方案,采用分页的方式显示数据时,动态地加载存储在服务器的大数量的数据,使界面快速显示,降低保持在客户端与服务器之间数据的一致性的复杂度。

Description

一种在分页模型中动态加载数据的方法及装置 技术领域
本申请涉及但不限于数据显示技术领域,特别是一种在分页模型中动态加载数据的方法及装置。
背景技术
移动通信系统中,路由器的记录(Router)数量通常达到几十万条,数量庞大。如果将所有数据加载到页面中,需要长时间才能将数据加载到页面中,因此需要分页以在用户界面显示数据。
当采用分页以在用户界面中显示数据时,按照设定的每页中数据容量,将大数量的数据在客户端拆分为多页以易于显示。当第一次显示用户界面时,只加载第一页的数据,以快速地生成用户界面。
由于第一次显示用户界面时,客户端表格模型中只加载了第一页的数据,用户切换到其它页面的时间是不确定的。在从加载第一页的数据的时刻到切换到其他页面的时刻的期间,在数据库中的数据可能被增加、删除,在数据库中的数据可能已经变化。此时,用户界面中显示的数据与存储在数据库中对应存储位置的数据不相同。
发明内容
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。
本申请的目的在于提供一种在分页模型中动态加载数据的方法及装置,解决了相关技术的界面中的数据与存储在数据库中对应存储位置的数据不一致的问题。
根据本申请的一个方面,提供了一种在分页模型中动态加载数据的方法,包括以下步骤:
在客户端被要求显示指定页面的数据时,判断在客户端表格模型中是否 已加载所述指定页面的数据;
当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;
当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型,并从客户端表格模型获取并显示所述指定页面的数据。
可选地,在所述服务器添加或删除已加载在客户端表格模型的指定页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据,所述客户端保存并显示已加载在客户端表格模型的指定页面的数据。
可选地,在客户端表格模型未加载指定页面的数据且所述服务器添加或删除在已加载的页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据和在已添加或删除数据的其他页面的数据,所述客户端保存并显示已加载在客户端表格模型的页面的数据,并从服务器获取所述在已添加或删除数据的指定页面的数据,并以所获取的在已添加或删除数据的指定页面的数据自动更新所述客户端表格模型中。
可选地,在所述以所获取的已添加或删除数据的指定页面的数据自动更新所述客户端表格模型的步骤之后,所述在分页模型中动态加载数据的方法还包括:
所述客户端检测所述在已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据是否有相同的数据;
当所述客户端检测到所述已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据有相同的数据时,移除所述所获取的在已添加或删除数据的指定页面的、与所述已加载到客户端表格模型的页面的数据相同的数据。
可选地,在所述当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模 型的步骤之后,所述方法还包括当所述服务器添加或删除数据导致服务器中的页面的数量增加或减少时,所述客户端从服务器获取所述指定页面的数据,并以所述指定页面的数据自动更新所述客户端表格模型。
可选地,当所述服务器添加或删除页面的数据导致服务器中的页面数量增加或减少,且在所述客户端表格模型中已加载的数据没有布满所述指定页面的时候,所述客户端从服务器获取用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量,并将所述用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量自动更新所述客户端表格模型。
本申请另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
根据本申请的另一方面,提供了一种在分页模型中动态加载数据的装置,包括:
判断模块,设置成在客户端被要求显示指定页面的数据时,判断在客户端表格模型中是否已加载所述指定页面的数据;
显示模块,设置成当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型,并从客户端表格模型获取并显示所述指定页面的数据。
可选地,所述显示模块包括:
第一显示单元,设置成当判断在客户端表格模型中已加载所述指定页面的数据时,则在所述服务器添加或删除已加载在客户端表格模型的指定页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据,所述客户端保存并显示已加载在客户端表格模型的指定页面的数据。
可选地,所述显示模块还包括:
第二显示单元,设置成当判断客户端表格模型中未加载所述指定页面的数据时,则在所述服务器在客户端表格模型未加载指定页面的数据且所述服 务器添加或删除在已加载的页面的数据时,所述服务器获取并保存在已添加或删除数据的新指定页面的数据和在已添加或删除数据的其他页面的数据,使所述客户端保存并显示已加载在客户端表格模型的页面的数据,并从服务器获取所述在已添加或删除数据的指定页面的数据,并以所获取的在已添加或删除数据的指定页面的数据自动更新所述客户端表格模型。
可选地,所述装置还包括检测模块,所述检测模块设置成在以所获取的已添加或删除数据的指定页面的数据自动更新所述客户端表格模型之后,使所述客户端检测所述在已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据是否有相同的数据;
当所述客户端检测到所述已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据有相同的数据时,移除所述所获取的在已添加或删除数据的指定页面的、与所述已加载到客户端表格模型的页面的数据相同的数据。
可选地,所述装置还包括获取模块,所述获取模块设置成在所述当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型的时候,当所述服务器添加或删除数据导致服务器中的页面的数量增加或减少时,使所述客户端从服务器获取所述指定页面的数据,并以所述指定页面的数据自动更新所述客户端表格模型。
可选地,所述获取模块是设置成当所述服务器添加或删除页面的数据导致服务器中的页面数量增加或减少,且在所述客户端表格模型中已加载的数据没有布满所述指定页面的时候,所述客户端从服务器获取用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量,并以所述用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量自动更新所述客户端表格模型。
与相关技术相比较,本申请提供的技术方案的有益效果在于:
1、通过分页的方式,客户端每页只加载少量数据,使客户端的页面可以 快速呈现,提高可用性。
2、逐页加载数据时,如果在客户端的数据与在服务器的数据不相同,保持在客户端的数据不变,更适合于大部分与业务相关的操作维护场景。
3、客户端对服务器的数据的变化保持有限的一致性,即只与客户端没有加载的数据保持一致,降低客户端与服务器之间交互的复杂度。
在阅读并理解了附图和详细描述后,可以明白其他方面。
附图概述
图1是本发明实施例提供的一种在分页模型中动态加载数据的方法的流程图;
图2是本发明实施例提供的一种在分页模型中动态加载数据的装置的示意图;
图3是本发明实施例提供的在分页模型中页面总数更新的流程图;
图4是本发明实施例提供的在分页模型中初始加载第一页数据的示意图;
图5是本发明实施例提供的在分页模型中加载第二页数据的示意图;
图6是本发明实施例提供的在分页模型中跳转到第三页的示意图;
图7是本发明实施例提供的在分页模型中加载第二页的示意图;
图8是本发明实施例提供的在分页模型中重新加载第三页数据的示意图;
图9是本发明实施例提供的在分页模型中只更新当前页面的数据的示意图。
本发明的较佳实施方式
以下结合附图对本申请的可选实施例进行详细说明,应当理解,以下所说明的可选实施例仅用于说明和解释本申请,并不用于限定本申请。
图1是本发明实施例提供的一种在分页模型中动态加载数据的方法流程图,如图1所示,包括以下步骤:
步骤S101:在客户端被要求显示指定页面的数据时,判断在客户端表格 模型中是否已加载所述指定页面的数据;
步骤S102:当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;
步骤S103:当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型,并从客户端表格模型获取并显示所述指定页面的数据。
可选地,在所述服务器添加或删除已加载在客户端表格模型的指定页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据,所述客户端保存并显示已加载在客户端表格模型的指定页面的数据。
可选地,在客户端表格模型未加载指定页面的数据且所述服务器添加或删除在已加载的页面的数据中的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据和在已添加或删除数据的其他页面的数据,所述客户端保存并显示已加载在客户端表格模型中的页面的数据,并从服务器获取所述在已添加或删除数据的指定页面的数据,并以所获取的在已添加或删除数据的指定页面的数据自动更新所述客户端表格模型。
可选地,在所述以所获取的已添加或删除数据的指定页面的数据自动更新所述客户端表格模型的步骤之后,所述在分页模型中动态加载数据的方法还包括:所述客户端检测所述在已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据是否有相同的数据;当所述客户端检测到所述已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据有相同的数据时,则移除所述所获取的在已添加或删除数据的指定页面的、与所述已加载到客户端表格模型的页面的数据相同的数据。
可选地,本申请提供的在分页模型中动态加载数据的方法还包括当所述服务器添加或删除数据导致服务器中的页面的数量增加或减少时,所述客户端从服务器获取所述指定页面的数据,并以所述指定页面的数据自动更新所述客户端表格模型。
可选地,当所述服务器添加或删除页面的数据导致服务器中的页面的数量增加或减少,且在所述客户端表格模型中已加载的数据没有布满所述指定 页面的时候,所述客户端从服务器获取用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量,并以所述用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量自动更新所述客户端表格模型。本发明实施例另外提供一种计算机可读存储介质,存储有计算机可执行指令,所述计算机可执行指令被执行时实现上述方法。
图2是本发明实施例提供的一种在分页模型中动态加载数据的装置示意图,如图2所示,包括:判断模块201和显示模块202。所述判断模块201,设置成在客户端被要求显示指定页面的数据时,判断在客户端表格模型中是否已加载所述指定页面的数据;所述显示模块202,设置成当判断客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型,并从客户端表格模型获取并显示所述指定页面的数据。
可选地,所述显示模块202包括:第一显示单元,设置成当判断在客户端表格模型中已加载所述指定页面的数据时,则在所述服务器添加或删除已加载在客户端表格模型的指定页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据,所述客户端保存并显示已加载在客户端表格模型的指定页面的数据。可选地,显示模块202包括:第二显示单元,设置成当判断客户端表格模型中未加载所述指定页面的数据时,则在所述服务器在客户端表格模型未加载指定页面的数据且所述服务器添加或删除在已加载的页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据和在已添加或删除数据的其他页面的数据,使得所述客户端保存并显示已加载在客户端表格模型的页面的数据,并从服务器获取所述在已添加或删除数据的指定页面的数据,并以所获取的在已添加或删除数据的指定页面的数据自动更新所述客户端表格模型。
可选地,所述装置还包括检测模块,所述检测模块设置成在以所获取的已添加或删除数据的指定页面的数据自动更新所述客户端表格模型之后,使 所述客户端检测所述在已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据是否有相同的数据;
当所述客户端检测到所述已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据有相同的数据时,移除所述所获取的在已添加或删除数据的指定页面的、与所述已加载到客户端表格模型的页面的数据相同的数据。
可选地,所述装置还包括获取模块,所述获取模块设置成在所述当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型的时候,当所述服务器添加或删除数据导致服务器中的页面的数量增加或减少时,使所述客户端从服务器获取所述指定页面的数据,并以所述指定页面的数据自动更新所述客户端表格模型。
可选地,所述获取模块是设置成当所述服务器添加或删除页面的数据导致服务器中的页面数量增加或减少,且在所述客户端表格模型中已加载的数据没有布满所述指定页面的时候,所述客户端从服务器获取用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量,并以所述用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量自动更新所述客户端表格模型。
本申请使用加载策略处理客户端使用分页的方式显示大数量数据时,在数据库中的数据由于增加、删除等操作导致客户端与数据库数据不一致时,正常加载和更新客户端的页面的数据。其中,加载策略在客户端实现,加载策略包括:在客户端表格模型中,在内存的一个区域存储数据,比如,如果使用Java来实现的话,可以使用List<Map<String,Object>>对象来存储数据。开始时,List中并没有存放任何数据,当需要显示指定页面的数据时,逐页加载到List中。List中每一个Map<String,Object>对象表示数据库中的一条记录,这条记录来源于数据库,并且可以与在数据库中的存储时的位置当前存储的记录不完全一致,以便适用于客户的操作。比如,在移动通信系统中, 当需要对记录(Router)数据同步时,只需要从数据库中获取记录(Router)相关的ID和名称等简单的信息。对于客户来说,在界面中只是这些有限的信息还是不够的。比如,界面中还应该包括:记录(Router)是否被选中进行同步的状态,同步执行中的各种状态,进度和异常信息等。这些信息都是与客户操作有关,不需要保存到数据库中。同时,这些操作信息对用户很重要,不能因为数据库中的数据变化,就使这些信息被清除。因此在页面切换时,有必要保留这些信息。
也就是说,在客户端表格模型中,通过List<Map<String,Object>>对象来存储数据。开始时,List中并没有存储任何数据,当需要显示指定页面的数据时,将指定页面的数据加载到List中。当用户切换到第n页时,先从模型中获取第n页的数据列表,如果数据列表的长度>0,则认为数据已经加载到客户端表格模型中,此时不需要重新从数据库中获取数据。如果数据列表的长度=0,表示第n页在客户端表格模型中没有数据,需要从服务器加载数据。此时,通过服务器的接口,获取到第n页数据后,存放到客户端表格模型中。当数据库中的数据在页面切换过程中变化时,对于页面的数据已经加载到客户端表格模型中的情况,此时尽管数据库中对应的存储位置中存储的数据已经发生变化,客户端表格模型中对应页面的数据也不会再次更新。这样,界面中显示的数据与实际数据库中的数据会出现不一致,但认为这是合理的。对于页面的数据没有加载到客户端表格模型中,需要从数据库中获取页面的数据的情况。此时,从数据库中获取到的页面的数据中的某些行对应的记录,在已加载的页面中可能已经存在了。那么,对于这种出现重复记录的情况,处理的原则是与已加载的页面的数据共享同一个数据源。也就是说,同一个记录会出现在一个或者多个页面中,它们都指向同一个数据源,当任何一个页面修改了这个记录时,其它页面会自动跟随变化。
初始化界面时,只显示第一页的数据,此时按照用户设置的条件从服务器中获取第一页数据(返回结果还应该包括总页数)。获取数据后,将第一页的数据显示在页面中,同时根据页面数量设置可以跳转的页面范围。比如,假设当前的页面数量为10,则用户可以在[1,10]范围内的页面中跳转。客户在第一页操作完成后,可以通过点击页面中的“下一页”或者“跳转到指定 页”切换到其它页面。假设切换到第N页,此时,页面N的数据由于没有加载到客户端表格模型中,会从数据库中获取页面N的数据。
从服务器中获取页面N的数据时,返回结果同样包括当前的页面的数量,此时,会出现以下情况需要处理:
1.数据库中的数据在这个时间段内没有发生变化,此时只需要将页面N的数据加载到客户端表格模型中,页面的数量等其他信息都不需要更新。
2.数据库中的数据这个时间段内已经变化,变化包括:
<1>已经加载到页面中的数据已经发生变化;
比如,第一页的数据此时与数据库中的第一页的数据已经不一致(包括增加、删除了记录)。但是为了保存客户的操作信息,这些已经加载到页面的数据不会更新,保留当前的状态。即允许客户端与服务器中的这种数据不一致。
<2>页面N中的某些数据与已经加载到页面中的一些数据重复;
伴随着数据的增加和删除,一些数据会切换到别的页面中,比如第一页的数据,会由于在第一页增加了记录,将原来的某些记录顺次排列到第二页。由于第一页的数据一旦加载就不会再更新,那么加载第二页的数据时,就会显示与第一页相同的数据。
为了保留用户的操作信息,对于这种在其他页面中已经存在的数据,则移出新的数据,使用其他页面中的数据,即它们共享同一个数据源。因此,在用户界面中的任何页面上对该数据的更新,都会同步更新到其他页面中。
<3>页面总数发生变化。
如果页面总数增加了,则只需要更新用户界面中的页面总数即可;如果页面总数缩小了,则需要处理客户端表格模型中的数据。
下面以假设每一条记录都以ID为关键字,将整个加载流程做详细描述:
一、加载页面的数据流程
1、初始化时,只加载第一页的数据。此时,在数据库中,第一页数据包括:1001、1002、1005、1006和1007。如图4所示。
2、点击“下一页”按钮,此时会加载第二页数据,如图5所示。
从图4发现,此时实际的数据库中的数据跟界面已经不一致了。对于第一页,在实际数据库中,数据包括:1001、1002、1003、1004和1006。其中,1003和1004是新增的,1005已经被删除,1007已经移到第二页。但是,对于客户端页面来说,它的第一页不会发生变化,依然显示的是1001、1002、1005、1006和1007这5个记录。对于第二页,显示的是1007、1008、1009、1010和1011这5条记录。其中ID=1007与第一页ID=1007的记录共享同一个数据源,也就是说第一页ID=1007的记录发生变化时,第二页ID=1007的记录也会跟随变化,因为它们的数据源是共享的。
同理,加载后续页面的数据时,与第二页类似。
二、共享数据源
对于共享数据源的更新,即如上述ID=1007的记录,在页面1上已经存在,加载页面2时,会有新的ID=1007数据源,此时如果页面1上ID=1007的数据的某些状态(比如处于选中状态,或者其它一些只跟客户端操作有关的状态)已经发生变化,如果用新的ID=1007数据源覆盖的话,原来的状态就会被修改。所以,对于共享数据源,使用模型中的数据。即,加载第二页的ID=1007时,如果判断到其他页面已经存在对应的记录,则丢弃该新的数据,并使用其他页面的数据。
三、动态更新页面总数
伴随着数据库中数据的变化(增加或者删除),页面总数也可能发生变化。当页面总数发生变化时,界面中页面总数也需要同步变化。
当切换到第n页时,如果第n页在客户端表格模型中不存在,则需要从数据库中获取第n页数据。此时,返回结果中包括页面总数,需要将最新的页面总数更新到界面中。具体流程如图3所示,包括以下步骤:
步骤1:显示页面pageNo;
步骤2:判断页面pageNo数据是否已经加载到客户端表格模型中,若判断页面pageNo数据已经加载到客户端表格模型中,则进行到步骤9,若判断页面pageNo数据没有加载到客户端表格模型中,则进行到步骤3。
步骤3:从数据库中加载pageNo对应的页面的数据;
步骤4:从查询数据中获取页面总数,并更新界面中的页面总数pageCount;
步骤5:判断是否pageNo>pageCount,若pageNo>pageCount,则进行到步骤6,pageNo<pageCount或pageNo=pageCount,则进行到步骤8。
步骤6:在客户端表格模型中将大于pageCount的页面的数据全部清空;
步骤7:将pageNo设置为pageCount,然后重新加载;
步骤8:将查询的页面的数据更新到客户端表格模型中;
步骤9:在页面中显示页面的数据。
页面总数的变化,还会导致某些不是最后一页的页面记录数与单页容量不一致的情况。假设当前页面总数为TP(TP>=3),并且最后一页的记录数小于单页容量。页面初始化并加载第一页的数据后,然后通过“跳转到指定页”的方式,跳转到最后一页(记为页面p,p=TP),此时加载的第p页的数据小于单页容量。然后再次跳转到p1(1<p1<TP)页,在加载页面p1的时候,发现页面总数变化为TP1,并且TP1>TP,即页面增加了,此时页面p就出现不是最后一页的页面记录数与单页容量不一致的情况。此时,如果再次切换到页面p,需要再次加载该页面的数据,但是更新页面时,一样保留原有数据不变,只在没有数据的位置填充对应的数据。基于此,加载策略判断某一页的数据是否需要重新从数据库中加载的条件包括两个:条件一是切换后的页面的记录数等于0;条件二是切换后的页面的记录数在范围(0,单页容量)之间,并且当前页面编号小于总页面数。
四、更新未满页面
如果在加载页面的数据时,数据库中的数据出现增长,则页面也会增加,此时可能会出现有些页面没有布满的情况。如下:
1、假设当前数据库中有13条记录,并且单一页面的容量为5,那么可知当前页面总数为3,并且第三页只有3条记录。开始时,加载了第一页,并且使用Go的方法跳转到了第三页,此时客户端界面模型中,第二页数据没有加载,第三页只有3条数据,如图6所示。
2、此时用户跳转到第二页数据,在加载第二页数据时,发现数据库中数据总数变为16条,即总共需要4页才能显示,如图7所示。
3、加载第二页后,发现数据库总页数已经是4了,此时如果切换到第三页,虽然第三页已经加载了,需要重新加载,并且补齐第13和第14位置上的数据,如图8所示。
从图6可知,网元1014和1015时重新加载的,对于这种重新加载,遵循以下原则:
<1>只更新没有数据的位置,如上,对于第三页,重新加载时,位置10、11和12上已经存在数据,那么这3个位置上的数据是不会再次更新的。
<2>重新更新第三页中的数据时,需要查询数据库,此时,可能数据库中的数据又变化了。比如查询第三页中的数据时,数据库中只有14条记录,意味着总页数发生了变化,但是此时不会更新页面总数,只会将ID=1014的网元加入页面中,其他位置的数据保持不变,如图9所示,对于这种“更新未满页面”的操作,只做布满页面的操作,期间可能页面总数发生了变化,也不会对除了当前页面的数据外的其他任何数据进行更新。同时,如果出现第三页中的数据减少的情况,也同样不会删除第三页中的数据。也就是说,这种“更新未满页面”的操作只会在当前页面中实施增加数据的操作。
综上所述,本申请具有以下技术效果:
本申请客户端采用分页的方式显示数据,可以动态地加载存储在服务器上的大数量的数据。在使界面快速显示,降低保持在客户端与服务器之间数据的一致性的复杂度。尤其对于客户逐页操作页面的数据,并且在操作过程中会做出只与客户端的状态相关的改变的情况,保证这些状态不会由于存储在数据库中对应的存储位置的数据的变化而清除,极大地方便了业务的运营维护。
尽管上文对本申请进行了详细说明,但是本申请不限于此,本技术领域技术人员可以根据本申请的原理进行各种修改。因此,凡按照本申请原理所作的修改,都应当理解为落入本申请的保护范围。
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的各模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明实施例不限制于任何特定形式的硬件和软件的结合。
工业实用性
本申请提供的技术方案通过分页的方式,使客户端每页只加载少量数据,使客户端的页面可以快速呈现,提高可用性;逐页加载数据时,如果在客户端的数据与在服务器的数据不相同,保持在客户端的数据不变,更适合于大部分与业务相关的操作维护场景;客户端对服务器的数据的变化保持有限的一致性,即只与客户端没有加载的数据保持一致,降低客户端与服务器之间交互的复杂度。

Claims (12)

  1. 一种在分页模型中动态加载数据的方法,包括:
    在客户端被要求显示指定页面的数据时,判断在客户端表格模型中是否已加载所述指定页面的数据;
    当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型,并从客户端表格模型获取并显示所述指定页面的数据。
  2. 根据权利要求1所述的方法,其中,所述当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据的步骤包括:在所述服务器添加或删除已加载在客户端表格模型的指定页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据,所述客户端保存并显示已加载在客户端表格模型的指定页面的数据。
  3. 根据权利要求1所述的方法,其中,所述当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型的步骤包括:在客户端表格模型未加载指定页面的数据且所述服务器添加或删除在已加载的页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据和在已添加或删除数据的其他页面的数据,所述客户端保存并显示已加载在客户端表格模型的页面的数据,并从服务器获取所述在已添加或删除数据的指定页面的数据,并以所获取的在已添加或删除数据的指定页面的数据自动更新所述客户端表格模型。
  4. 根据权利要求3所述的方法,在所述以所获取的已添加或删除数据的指定页面的数据自动更新所述客户端表格模型的步骤之后,所述在分页模型中动态加载数据的方法还包括:
    所述客户端检测所述在已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据是否有相同的数据;
    当所述客户端检测到所述已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据有相同的数据时,移除所述所获取的在已添加或删除数据的指定页面的、与所述已加载到客户端表格模型的页面的数据相同的数据。
  5. 根据权利要求1所述的方法,在所述当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型的步骤之后,所述方法还包括:
    当所述服务器添加或删除数据导致服务器中的页面的数量增加或减少时,所述客户端从服务器获取所述指定页面的数据,并以所述指定页面的数据自动更新所述客户端表格模型。
  6. 根据权利要求5所述的方法,其中,所述客户端从服务器获取所述指定页面的数据,并以所述指定页面的数据自动更新所述客户端表格模型的步骤包括:
    当所述服务器添加或删除页面的数据导致服务器中的页面数量增加或减少,且在所述客户端表格模型中已加载的数据没有布满所述指定页面的时候,所述客户端从服务器获取用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量,并以所述用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量自动更新所述客户端表格模型。
  7. 一种在分页模型中动态加载数据的装置,包括:
    判断模块,设置成在客户端被要求显示指定页面的数据时,判断在客户端表格模型中是否已加载所述指定页面的数据;
    显示模块,设置成当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型中,并从客户端表格模型获取并显示所述指定页面的数据。
  8. 根据权利要求7所述的装置,其中,所述显示模块包括:
    第一显示单元,设置成当判断在客户端表格模型中已加载所述指定页面的数据时,则在所述服务器添加或删除已加载在客户端表格模型的指定页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据,所述客户端保存并显示已加载在客户端表格模型的指定页面的数据。
  9. 根据权利要求7所述的装置,其中,所述显示模块包括:
    第二显示单元,设置成当判断客户端表格模型中未加载所述指定页面的数据时,则在所述服务器在客户端表格模型未加载指定页面的数据且所述服务器添加或删除在已加载的页面的数据时,所述服务器获取并保存在已添加或删除数据的指定页面的数据和在已添加或删除数据的其他页面的数据,使所述客户端保存并显示已加载在客户端表格模型的页面的数据,并从服务器获取所述在已添加或删除数据的指定页面的数据,并以所获取的在已添加或删除数据的指定页面的数据自动更新所述客户端表格模型。
  10. 根据权利要求9所述的装置,所述装置还包括检测模块,所述检测模块设置成在以所获取的已添加或删除数据的指定页面的数据自动更新所述客户端表格模型之后,使所述客户端检测所述在已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据是否有相同的数据;
    当所述客户端检测到所述已添加或删除数据的指定页面的数据与所述已加载到客户端表格模型的数据有相同的数据时,移除所述所获取的在已添加或删除数据的指定页面的、与所述已加载到客户端表格模型的页面的数据相同的数据。
  11. 根据权利要求7所述装置,所述装置还包括获取模块,所述获取模块设置成在所述当判断在客户端表格模型中已加载所述指定页面的数据时,则从客户端表格模型获取并显示所述指定页面的数据;或者,当判断客户端表格模型中未加载所述指定页面的数据时,则客户端从服务器获取所述指定页面的数据,并以所获取的指定页面的数据自动更新所述客户端表格模型的时候,当所述服务器添加或删除数据导致服务器中的页面的数量增加或减少时,使所述客户端从服务器获取所述指定页面的数据,并以所述指定页面的数据自动更新所述客户端表格模型。
  12. 根据权利要求11所述装置,其中,所述获取模块是设置成当所述服务器添加或删除页面的数据导致服务器中的页面数量增加或减少,且在所述客户端表格模型中已加载的数据没有布满所述指定页面的时候,所述客户端从服务器获取用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量,并以所述用于布满所述没有布满数据的指定页面的剩余页面的数据和添加或删除数据后页面的数量自动更新所述客户端表格模型。
PCT/CN2016/082255 2015-09-17 2016-05-16 一种在分页模型中动态加载数据的方法及装置 WO2017045410A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510594061.XA CN106547754A (zh) 2015-09-17 2015-09-17 一种在分页模型中动态加载数据的方法及装置
CN201510594061.X 2015-09-17

Publications (1)

Publication Number Publication Date
WO2017045410A1 true WO2017045410A1 (zh) 2017-03-23

Family

ID=58288146

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/082255 WO2017045410A1 (zh) 2015-09-17 2016-05-16 一种在分页模型中动态加载数据的方法及装置

Country Status (2)

Country Link
CN (1) CN106547754A (zh)
WO (1) WO2017045410A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868315A (zh) * 2021-09-28 2021-12-31 深圳云之家网络有限公司 一种数据滚动加载方法、装置、设备及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110851043B (zh) * 2019-11-14 2021-05-11 腾讯科技(深圳)有限公司 页面显示方法和装置、存储介质及电子装置
CN112540823B (zh) * 2020-12-25 2023-05-23 杭州智聪网络科技有限公司 用于组件化搭载的微页面分页方法
CN114895971A (zh) * 2022-03-23 2022-08-12 深圳市酷开网络科技股份有限公司 一种数据加载方法、装置、终端设备及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751278A (zh) * 2009-12-17 2010-06-23 中兴通讯股份有限公司 一种数据延迟加载方法及装置
CN102968322A (zh) * 2012-11-22 2013-03-13 用友软件股份有限公司 数据加载装置和数据加载方法
CN104281668A (zh) * 2014-09-28 2015-01-14 墨仕(厦门)电子商务有限公司 一种数据处理方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101751278A (zh) * 2009-12-17 2010-06-23 中兴通讯股份有限公司 一种数据延迟加载方法及装置
CN102968322A (zh) * 2012-11-22 2013-03-13 用友软件股份有限公司 数据加载装置和数据加载方法
CN104281668A (zh) * 2014-09-28 2015-01-14 墨仕(厦门)电子商务有限公司 一种数据处理方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113868315A (zh) * 2021-09-28 2021-12-31 深圳云之家网络有限公司 一种数据滚动加载方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN106547754A (zh) 2017-03-29

Similar Documents

Publication Publication Date Title
US10579479B2 (en) Restoring data in a hierarchical storage management system
US9830327B2 (en) Method, device, node and system for managing file in distributed data warehouse
US9292347B2 (en) Status tool to expose metadata read and write queues
US11556501B2 (en) Determining differences between two versions of a file directory tree structure
KR100932803B1 (ko) 원자적으로 갱신되는 중앙 캐시 메모리를 위한 방법 및 시스템
JP6050343B2 (ja) 最近使用した文書のリストの自動同期
WO2017045410A1 (zh) 一种在分页模型中动态加载数据的方法及装置
US20140222972A1 (en) Systems and Methods for Space Management in File Systems
US9892183B2 (en) Computer system, computer system management method, and program
US20210011884A1 (en) Storage organization system with associated storage utilization values
US10915551B2 (en) Change management for shared objects in multi-tenancy systems
CN106874281B (zh) 实现数据库读写分离的方法和装置
US10007548B2 (en) Transaction system
CN110347651A (zh) 基于云存储的数据同步方法、装置、设备及存储介质
US20170161050A1 (en) Methods for Downloading and Installing Computer Software Applications on Demand
US11687533B2 (en) Centralized storage for search servers
WO2017003971A1 (en) Metamorphic documents
CN105094811A (zh) 一种事件处理的方法和装置
US8589454B2 (en) Computer data file merging based on file metadata
CN111736950A (zh) 一种虚拟机的加速器资源添加方法及相关装置
US20090248620A1 (en) Interacting methods of data extraction
CN113467719B (zh) 数据写入方法及装置
CN107181773A (zh) 分布式存储系统的数据存储及数据管理方法、设备
CN103365535B (zh) 信息处理装置及信息处理方法
US9460179B1 (en) Systems and methods for providing adaptive visualization of synchronization of multiple files

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16845524

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16845524

Country of ref document: EP

Kind code of ref document: A1