WO2020019450A1 - 分程异步加载方法、装置、终端设备及存储介质 - Google Patents

分程异步加载方法、装置、终端设备及存储介质 Download PDF

Info

Publication number
WO2020019450A1
WO2020019450A1 PCT/CN2018/106249 CN2018106249W WO2020019450A1 WO 2020019450 A1 WO2020019450 A1 WO 2020019450A1 CN 2018106249 W CN2018106249 W CN 2018106249W WO 2020019450 A1 WO2020019450 A1 WO 2020019450A1
Authority
WO
WIPO (PCT)
Prior art keywords
voucher
page
content
current page
total number
Prior art date
Application number
PCT/CN2018/106249
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 WO2020019450A1 publication Critical patent/WO2020019450A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation

Definitions

  • the present application relates to the field of big data querying, and in particular, to a method, a device, a terminal device, and a storage medium for split-range asynchronous loading.
  • Pagination query refers to the current page and total page number of the voucher at the same time when querying the financial file voucher, and after waiting for both the current page and the total page number to be searched, the current page and the total page are displayed on the display interface at the same time. Number of pages.
  • querying the current page and the total number of pages of a voucher by using a paging query method will cause the display of the current page to be delayed, which is time-consuming, labor-intensive, and not conducive to user experience.
  • the embodiments of the present application provide a method, a device, a terminal device, and a storage medium for split-range asynchronous loading to solve the problems of long waiting time and slow query speed of users.
  • a divided-range asynchronous loading method including:
  • the query instruction including a first instruction for querying the content of the voucher of the current page and a second instruction for querying the total number of credentials
  • the first thread is started according to the first instruction, and the current page voucher content is queried in the database through the first thread.
  • the current page voucher content is queried, the current page voucher is displayed on the display interface. content;
  • a split-range asynchronous loading device including:
  • a receiving module configured to receive a query instruction sent by a client, the query instruction including a first instruction for querying the content of the voucher of the current page and a second instruction for querying the total number of credentials;
  • a first startup module configured to start a first thread according to the first instruction, and query the current page voucher content in a database through the first thread, and when the current page voucher content is queried, display the interface Displaying the contents of the current page voucher;
  • a second startup module configured to start a second thread according to the second instruction, and query the total number of credentials in a database through the second thread; when the total number of credentials is queried, the content of the voucher on the current page
  • the preset position on the display interface of the display displays the total number of vouchers, the page number of the current page voucher, and the total page number of the voucher.
  • a terminal device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
  • the processor implements the computer-readable instructions to implement The following steps:
  • the query instruction including a first instruction for querying the content of the voucher of the current page and a second instruction for querying the total number of credentials
  • the first thread is started according to the first instruction, and the current page voucher content is queried in the database through the first thread.
  • the current page voucher content is queried, the current page voucher is displayed on the display interface. content;
  • one or more non-volatile readable storage media storing computer-readable instructions
  • the computer-readable instructions when executed by one or more processors, cause the one or more processors to Perform the following steps:
  • the query instruction including a first instruction for querying the content of the voucher of the current page and a second instruction for querying the total number of credentials
  • the first thread is started according to the first instruction, and the current page voucher content is queried in the database through the first thread.
  • the current page voucher content is queried, the current page voucher is displayed on the display interface. content;
  • FIG. 1 is a schematic diagram of an application environment of the divided-range asynchronous loading method according to an embodiment of the present application
  • FIG. 2 is a flowchart of a divided-range asynchronous loading method according to an embodiment of the present application
  • FIG. 3 is a flowchart of a split-range asynchronous loading method in another embodiment of the present application.
  • step S20 of the divided-range asynchronous loading method is a flowchart of step S20 of the divided-range asynchronous loading method according to an embodiment of the present application
  • step S20 of the divided-range asynchronous loading method in another embodiment of the present application.
  • step S30 of the divided-range asynchronous loading method is a flowchart of step S30 of the divided-range asynchronous loading method according to an embodiment of the present application
  • step S30 of the divided-range asynchronous loading method in another embodiment of the present application is a flowchart of step S30 of the divided-range asynchronous loading method in another embodiment of the present application.
  • FIG. 8 is a principle block diagram of a split-range asynchronous loading device in an embodiment of the present application.
  • FIG. 9 is a principle block diagram of a split-range asynchronous loading device in another embodiment of the present application.
  • FIG. 10 is a schematic diagram of a terminal device in an embodiment of the present application.
  • the divided-range asynchronous loading method provided in this application can be applied in the application environment shown in FIG. 1, in which a client (terminal device) communicates with a server through a network.
  • the clients include, but are not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the server can be implemented by an independent server or a server cluster composed of multiple servers.
  • a method for loading asynchronously in a range is provided.
  • the method is applied to the server in FIG. 1 as an example, and includes the following steps:
  • S10 Receive a query instruction sent by a client, where the query instruction includes a first instruction to query a content of a voucher on a current page and a second instruction to query a total number of credentials.
  • the query instruction is automatically sent to the server.
  • the query instruction is used to query the content and total number of vouchers on the current page. Preferably, both can be queried at the same time. Since the query speed of the content of the current page voucher is better than the query speed of the total number of vouchers, the user can preferably know the content of the current page voucher, such as the page number of the current page voucher. . S20. Start the first thread according to the first instruction, and query the current page voucher content in the database through the first thread. When the current page voucher content is queried, display the current page on the display interface. Page voucher content.
  • the first thread is started according to the first instruction, and the current page credential content is queried in the database through the first thread, the second thread is started according to the second instruction, and Query the total number of credentials in the database. Since the content of the current page voucher is less than the total number of vouchers, the query speed of the current page voucher content by the first thread is faster than that of the total number of vouchers by the second thread. Therefore, even if the first thread and the second thread are At the same time, the query of the current page voucher content and the total number of vouchers is started to run, but the query result of the current page voucher content found by the first thread will be returned first. In this embodiment, there is no need to wait for the query result of the total number of credentials queried by the second thread to return, as long as the query result of the current page credential content queried by the first thread returns, the current page credential content can be displayed.
  • S30 Start a second thread according to the second instruction, and query the total number of vouchers in the database through the second thread.
  • the The preset position displays the total number of vouchers, the page number of the current page voucher, and the total page number of the voucher.
  • the current content of the voucher, the total number of vouchers, the total voucher number of the voucher, and the voucher of the current page are displayed on the current display interface (that is, the display interface of the voucher content of the current page).
  • the server receives the client's query instruction, the first thread and the second thread start running at the same time.
  • the query instruction for querying both the current page credential content and the total number of credentials is also issued at the same time. Since the content of the current page voucher is less than the total number of vouchers, the query speed of the current page voucher content by the first thread is faster than that of the total number of vouchers by the second thread. Therefore, even if the first thread and the second thread are At the same time, the query of the current page voucher content and the total number of vouchers is started, but the query result of the current page voucher content found by the first thread will be returned first, and the user does not need to wait for the total number of vouchers to be retrieved before obtaining the current page voucher content. And only after the first thread finishes querying the current page voucher content, the current page voucher content can be displayed on the display interface.
  • the starting of the first thread and the second thread is not limited in sequence, and can be set to be started simultaneously or one of the threads is started first according to requirements.
  • the advantages of using the split-range asynchronous loading method are: query the current page voucher content and the total number of vouchers through the first thread and the second thread, the query routes do not interfere with each other, and the query data does not interfere with each other; Better than the query speed of the second thread, and the query result of the current page voucher content retrieved by the first thread is the first to be returned to the client; the user does not need to wait for the total number of vouchers to be retrieved before obtaining the current page voucher content, only the first After the thread has finished querying the current page voucher content, it can display the current page voucher content on the display interface; reducing the user waiting time, improving the query and display speed, and improving the user experience.
  • step S30 the method further includes the following steps:
  • the database can be used to detect whether the total number of vouchers has increased in real time or at regular intervals (a time interval can be set according to demand).
  • Or delete when it is detected that the total number of credentials is increased or deleted, update the total number of credentials in the cache (still associated with the unique identifier), and send the total number of credentials added or deleted to the client, And based on the total number of vouchers added or deleted, the total number of vouchers displayed on the display page, the page number of the current page voucher, the total page number of vouchers, etc. (contents associated with the total number of vouchers) are updated.
  • the modified current page voucher content is sent to the client, and the current page voucher content is updated and displayed on the display interface.
  • step S20 specifically includes the following steps:
  • S201 Start the first thread according to the first instruction, and query the current page voucher content in the database through the first thread, and detect in real time whether the current page voucher content has been obtained.
  • the number of vouchers for each page is equal, and the voucher numbers are continuous.
  • the server searches for the 20 pages of the current page number of 00041 to 00060 through the first thread.
  • the user can increase or decrease the recorded content according to requirements, for example, the page number of the current page voucher can also be recorded.
  • step S202 the method further includes the following steps:
  • the page turning parameters include, but are not limited to, the number of pages turned, the direction of turning the pages, the page number after turning the pages, and the like.
  • S205 Acquire the total number of pages to be turned according to the number of pages turned and the number of vouchers per page.
  • the total number of vouchers to be turned is 40.
  • the page turning direction backwards indicates that the voucher number is increasing, and the page turning direction forwards indicates that the voucher number is decreasing.
  • the minimum content of the current page voucher content When the number is 00041, the maximum number of the current page's voucher content is 00060, and the page turning direction is backward (representing the increase of the voucher number), the minimum number (00041) and the maximum number (00060) of the current page voucher content can be respectively Add the total number of vouchers (40) that have been turned over to get the voucher numbers of the pages after turning over from 0081 to 00100.
  • all voucher numbers of the page after the page turning can be obtained according to the page turning parameters, without re-querying the page after the page turning and all pages before the page, and obtaining all the vouchers of the page after the turning based on the voucher number information of the page. Number, the query speed of this program has been significantly improved.
  • the page turning parameters include the page number after page turning
  • the page number of the current page voucher previously recorded is page 3
  • the number of vouchers per page is 20
  • the minimum number of the current page voucher content is 00041
  • the maximum number of the voucher content of the current page is 00060.
  • the voucher number of the fifth page after the page turning is from 00081 to 00100.
  • the query instruction further includes a unique identifier corresponding to the query
  • the step S30 specifically includes the following steps:
  • S301 Start the second thread according to the second instruction, and periodically query whether the total number of credentials corresponding to the unique identifier is generated in the database through the second thread.
  • the query instruction is automatically sent to the server.
  • the server receives the query instruction, it automatically generates a unique identifier corresponding to the query.
  • the unique identifier is associated with the query instruction of this query and stored in the client; the unique identifier may be randomly generated according to a preset rule, and the length of the identifier may be set according to one or more requirements of the uniformity of the identifier specifications , Just need to guarantee its uniqueness.
  • step S20 the first thread is started according to the first instruction, and the current page voucher content is queried in the database through the first thread. Since the current page voucher content is less than the total number of vouchers, the current page voucher is obtained The content should be fast, and the data can be retrieved from the database for display immediately.
  • step S30 the second thread is started according to the second instruction, and the total number of credentials is queried in the database through the second thread. Since there is more data on the total number of credentials, it takes longer to obtain the total number of credentials in the database. .
  • the total number of vouchers is periodically checked at a preset time interval. Since the number of queries may be multiple and other clients may retrieve data from the database during the period, the unique identifier The total number of credentials retrieved is associated with the client, and the total number of credentials obtained can be fed back to the client in a timely manner.
  • the total number of credentials is queried and displayed directly from the database through the first thread. After the total number of credentials is generated for the first time, the total number of credentials is stored in the cache in association with the unique identifier.
  • the query process when the user needs to perform a page turning operation, that is, when the user needs to re-query the current page voucher content after the page turning, the data of the total number of vouchers does not change at this time, and the display can be directly retrieved from the cache, no need to Query from the database.
  • the total number of vouchers and the current page can be displayed in a preset position on the display interface of the client according to demand.
  • the current page's voucher content, the total number of vouchers, the total voucher number of the voucher, and the current page are displayed on the current display interface (that is, the display interface of the voucher content of the current page).
  • the display interface displays a total of 1,000 vouchers queried, with a total of 50 pages of voucher content.
  • the page number of the current page voucher is the second page, and the second page contains all the contents of the 20 vouchers; at this time, in Clicking the link label on the previous page or the next page will switch the displayed current page voucher content to the previous or next page voucher content, and the page number of the current page voucher will change accordingly.
  • multiple windows are displayed on a current display interface (that is, on a display interface of the current page voucher content).
  • a main window displays the contents of the current page of the voucher, the total number of vouchers, the total page number of the voucher, and the page number of the current page voucher.
  • the position of the main window can be set anywhere on the screen (for example: the center of the screen, left or right, etc.)
  • the display interface of the main window occupies more than one-half of the display space of the entire display interface; and at other locations close to the main window, several secondary windows can also be set, and the content displayed by the secondary window can be set according to requirements.
  • the display space occupied by the window can also be reasonably allocated according to the remaining display space on the display interface except the main window.
  • the sizes of the main window and the sub-window can be adjusted according to the display ratio.
  • the total number of vouchers, the total page number of the voucher, the contents of the previous and next pages of the voucher, and the page numbers corresponding to the voucher content of the page may be displayed on the two sub-windows.
  • the user only needs to click on the secondary window to directly display the content of the voucher displayed in the clicked secondary window on the main window.
  • there can be more than two sub-windows and the content displayed can also be set according to user needs.
  • the credentials of the first and last pages can also be displayed.
  • the secondary window is used to preview and display the credential content of other pages other than the current page, so that the user can better select the next page to be displayed according to the preview status.
  • step S302 the method further includes the following steps:
  • S304 Receive a page flip trigger instruction sent by the client, control the second thread to retrieve the total number of credentials in the cache according to the unique identifier, and display the total number of credentials on the display interface.
  • the total number of credentials is stored in the cache in association with the unique identifier. At this time, when the total number of credentials needs to be retrieved from the cache, it is only necessary to match the client with the unique identifier in the cache. , The total number of the credentials stored in the cache associated with the unique identifier can be found.
  • a divided-range asynchronous loading device corresponds to the divided-range asynchronous loading method in the above-mentioned embodiment.
  • the divided-range asynchronous loading device includes a receiving module 110, a first starting module 120, and a second starting module 130.
  • the detailed description of each function module is as follows:
  • the receiving module 110 is configured to receive a query instruction sent by a client.
  • the query instruction includes a first instruction for querying the content of the voucher on the current page and a second instruction for querying the total number of credentials.
  • a first startup module 120 is configured to start a first thread according to the first instruction, and query the current page voucher content in a database through the first thread, and when the current page voucher content is queried, display the The interface displays the current page credential content.
  • a second startup module 130 is configured to start a second thread according to the second instruction, and query the total number of vouchers in a database through the second thread.
  • the current page voucher is The preset position on the content display interface displays the total number of vouchers, the page number of the current page voucher, and the total page number of the voucher.
  • the first startup module 120 specifically includes: a first query sub-module 121, a first display sub-module 122, and a first return sub-module 123.
  • the functional modules are described in detail as follows:
  • a first query submodule 121 configured to start the first thread according to the first instruction, and query the content of the current page credential in the database through the first thread to detect in real time whether the voucher has been obtained The contents of the current page credential.
  • the first display submodule 122 is configured to display the current page voucher content on the display interface when the current page voucher content is obtained, and record the number of vouchers per page and the minimum of the current page voucher content. Number and maximum number.
  • a first return submodule 123 is configured to continue to query the content of the current page voucher and wait for the return of data when the content of the current page voucher is not obtained.
  • the first startup module 120 further includes a page turning receiving sub-module 124, a page turning obtaining sub-module 125, and a page turning display sub-module 126.
  • a page turning receiving sub-module 124 receives a page turning signal from the page turning module 120.
  • a page turning obtaining sub-module 125 receives a page turning display sub-module 126.
  • a page turning display sub-module 126 the detailed description of each functional module is as follows:
  • the page turning receiving sub-module 124 is configured to receive a page turning trigger instruction sent by the client, and obtain a page turning parameter included in the page turning trigger instruction.
  • the page turning parameter includes a page turning direction and a page turning direction.
  • the page turning obtaining sub-module 125 is configured to obtain the total number of pages turned over according to the number of pages turned over and the number of vouchers per page, and according to the total number of pages turned over, the page turning direction, the current The minimum and maximum numbers of the page voucher content, get all the voucher numbers of the page after turning the page.
  • the page turning display sub-module 126 is used to control the first thread to directly query and retrieve the corresponding voucher content in the database according to the voucher number of the page after the page turning, and display it on the display interface.
  • the query instruction further includes a unique identifier corresponding to the query;
  • the second startup module 130 specifically includes: a second query sub-module 131, a second display sub-module 132, and a second return
  • the sub-module 133 and the second calling sub-module 134 are described in detail as follows:
  • a second query submodule 131 is configured to start the second thread according to the second instruction, and periodically query whether a total number of credentials corresponding to the unique identifier is generated in a database through the second thread.
  • a second display sub-module 132 configured to display the total number of vouchers, the page number of the current page voucher, and the total page number of the voucher at a preset position on the display interface of the current page voucher content when generating the total number of vouchers,
  • the total number of credentials is stored in the cache in association with the unique identification.
  • the second return sub-module 133 is configured to continue to query the total number of vouchers in the database and wait for the return of data when the total number of vouchers is not generated.
  • a second calling submodule 134 configured to receive a page flip trigger instruction sent by the client, and control the second thread to retrieve the total number of credentials in the cache according to the unique identifier, and display the The total number of said credentials is displayed on the interface.
  • Each module in the above-mentioned divided-range asynchronous loading device may be implemented in whole or in part by software, hardware, and a combination thereof.
  • Each of the above modules may be embedded in the processor in the form of hardware or independent of the processor in the terminal device, or may be stored in the memory of the terminal device in the form of software to facilitate the processor to call and execute the operations corresponding to the above modules.
  • a terminal device ie, a computer device
  • the terminal device may be a server, and the internal structure diagram may be as shown in FIG. 10.
  • the terminal device includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the terminal device is used to provide computing and control capabilities.
  • the memory of the terminal device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, computer-readable instructions, and a database.
  • the internal memory provides an environment for operating the operating system and computer-readable instructions in a non-volatile storage medium.
  • the network interface of the terminal device is used to communicate with external terminals through a network connection.
  • the computer-readable instructions are executed by a processor to implement a method of asynchronous loading by division.
  • a terminal device which includes a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor.
  • the processor executes the computer-readable instructions, the following steps are implemented:
  • a query instruction sent by a client is received, the query instruction includes a first instruction to query the content of the voucher on the current page and a second instruction to query the total number of credentials.
  • the first thread is started according to the first instruction, and the current page voucher content is queried in the database through the first thread.
  • the current page voucher content is queried, the current page voucher is displayed on the display interface. content.
  • the preset position displays the total number of vouchers, the page number of the current page voucher, and the total page number of the voucher.
  • one or more non-volatile readable storage media storing computer readable instructions are provided, and the non readable storage medium stores computer readable instructions, the computer readable instructions When executed by one or more processors, causes the one or more processors to perform the following steps:
  • a query instruction sent by a client is received, the query instruction includes a first instruction to query the content of the voucher on the current page and a second instruction to query the total number of credentials.
  • the first thread is started according to the first instruction, and the current page voucher content is queried in the database through the first thread.
  • the current page voucher content is queried, the current page voucher is displayed on the display interface. content.
  • the preset position displays the total number of vouchers, the page number of the current page voucher, and the total page number of the voucher.
  • Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM random access memory
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain DRAM
  • RDRAM memory bus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Abstract

一种分程异步加载方法、装置、终端设备及存储介质。所述方法包括:接收客户端发送的查询指令,查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令(S10);根据第一指令开启第一线程,并通过第一线程在数据库中查询当前页凭证内容,在查询到当前页凭证内容时,在显示界面上显示当前页凭证内容(S20);根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码(S30)。实现分程查询当前页凭证内容和凭证总数,优先显示当前页凭证内容,减少用户等待时间,有利于提高查询及显示速度,提升用户体验。

Description

分程异步加载方法、装置、终端设备及存储介质
本申请以2018年7月27日提交的申请号为201810845419.5,名称为“分程异步加载方法、装置、终端设备及存储介质”的中国发明专利申请为基础,并要求其优先权。
技术领域
本申请涉及大数据查询领域,尤其涉及一种分程异步加载方法、装置、终端设备及存储介质。
背景技术
目前,对财务档案凭证进行查询时,采用的是分页查询的方式,其查询速度相当缓慢。分页查询是指,在对财务档案凭证进行查询时,同时查询凭证的当前页与总页数,且在等待当前页与总页数均查询完毕之后,方在显示界面上同时显示当前页与总页数。目前利用分页查询的方式查询凭证的当前页和总数页,会存在当前页的显示被滞后的问题,费时费力,且不利于用户体验。
发明内容
本申请实施例提供了一种分程异步加载方法、装置、终端设备及存储介质,以解决用户等待时间长,查询速度缓慢的问题。
第一方面,提供一种分程异步加载方法,包括:
接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
第二方面,提供一种分程异步加载装置,包括:
接收模块,用于接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
第一启动模块,用于根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
第二启动模块,用于根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
第三方面,提供一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
第四方面,提供一个或多个存储有计算机可读指令的非易失性可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中分程异步加载方法的应用环境示意图;
图2是本申请一实施例中分程异步加载方法的流程图;
图3是本申请另一实施例中分程异步加载方法的流程图;
图4是本申请一实施例中的分程异步加载方法的步骤S20的流程图;
图5是本申请另一实施例中的分程异步加载方法的步骤S20的流程图;
图6是本申请一实施例中的分程异步加载方法的步骤S30的流程图;
图7是本申请另一实施例中的分程异步加载方法的步骤S30的流程图;
图8是本申请一实施例中的分程异步加载装置的原理框图;
图9是本申请另一实施例中的分程异步加载装置的原理框图;
图10是本申请一实施例中终端设备的示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请提供的分程异步加载方法,可应用在如图1的应用环境中,其中,客户端(终端设备)通过网络与服务器进行通信。其中,客户端包括但不限于为各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。服务器可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一实施例中,如图2所示,提供一种分程异步加载方法,以该方法应用在图1中的服务器为例进行说明,包括如下步骤:
S10、接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令。
也即,用户在客户端点击查询按钮时,已自动将查询指令发送至服务器。所述查询指令用于对当前页凭证内容和凭证总数进行查询。作为优选,两者可以同时查询,由于所述当前页凭证内容的查询速度优于所述凭证总数的查询速度,因此用户可以优选获知所述当前页凭证内容,比如:所述当前页凭证的页码。S20、根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容。
可理解地,根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询当前页凭证内容,根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询凭证总数。由于当前页凭证内容比凭证总数要少,因此通过第一线程对当前页凭证内容的查询速度,比通过第二线程对凭证总数的查询速度要快,故而,即便第一线程与第二线程是同时开启运行对当前页凭证内容与凭证总数进行查询的,但第一线程查询到的当前页凭证内容的查询结果会率先返回。在本实施例中,无需等待第二线程查询到的凭证总数的查询结果返回,只要第一线程查询到的当前页凭证内容的查询结果返回,即可显示当前页凭证内容。
S30、根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。比如,在查询到所述凭证总数时,在当前的显示界面上(也即所述当前页凭证内容的显示界面上)展示当前页的凭证内容、凭证总数、凭证总页码及所述当前页凭证的页码、上一页和下一页的链接标签等内容。作为优选,在服务器接收到客户端的查询指令时,所述第一线程与第二线程同时开启运行,此时对于当前页凭证内容与凭证总数两者进行查询的查询指令也是同时发出的。由于当前页凭证内容比凭证总数要少,因此通过第一线程对当前页凭证内容的查询速度,比通过第二线程对凭证总数的查询速度要快,故而,即便第一线程与第二线程是同时开启运行对当前页凭证内容与凭证总数进行查询的,但是第一线程查询到的当前页凭证内容的查询结果会率先返回,且用户无需等待凭证总数查询完毕之后才获取到当前页凭证内容,而仅需在第一线程对当前页凭证内容查询完毕之后,即可在显示界面上显示当前页凭证内容。
可理解地,在另一实施例中,所述第一线程与所述第二线程的开启,并未限定其先后顺序,可以根据需求设定为同时开启或其中一线程率先开启。
综上所述,采用分程异步加载方法优点有:通过第一线程和第二线程分别查询当前页凭证内容和凭证总数,查询路线互不干扰,查询数据互不干扰;第一线程的查询速度优于第二线程的查询速度,且第一线程查询到的当前页凭证内容的查询结果率先返回至客户端;用户无需等待凭证总数查询完毕之后才获取到当前页凭证内容,仅需在第一线程对当前页凭证内容查询完毕之后,即可在显示界面上显示当前页凭证内容;减少用户等待时间,提高了查询及显示速度,提升用户体验。
在另一实施例中,如图3所示,所述步骤S30之后还包括以下步骤:
S40,实时或定时检测所述凭证总数是否增加或删除,并在所述凭证总数增加或删除之后更新所述显示页面上显示的所述凭证总数、所述当前页凭证的页码和凭证总页码。可理解的,在同一次查询过程中,已经查询到凭证总数并将其存储至缓存之后,可以在数据库中实时或定时(可根据需求设定定时的间隔时间)检测所述凭证总数是否发生增加或删除,在检测到所述凭证总数发生增加或删除时,将该凭证总数在缓存中更新(依旧与所述唯一标识关联),同时将增加或删除后的凭证总数发送至所述客户端,并根据增加或删除后的的凭证总数,更新所述显示页面上显示的所述凭证总数、所述当前页凭证的页码和凭证总页码等(与所述凭证总数关联的内容)。
S50,实时或定时检测所述当前页凭证内容是否修改,并在所述当前页凭证内容被修改时,在所述显示界面上更新所述当前页凭证内容。
也即,若检测到所述当前页凭证内容发生修改时,将修改之后的所述当前页凭证内容发送至客户端,并在显示界面上更新显示所述当前页凭证内容。
在一实施例中,如图4所示,所述步骤S20具体包括如下步骤:
S201、根据所述第一指令开启所述第一线程,并通过所述第一线程在所述数据库中查询当前页凭证内容,实时检测是否已获取到所述当前页凭证内容。
由于用户对当前页凭证内容的显示速度要求通常较高,为了提升用户体验,故采用实时查询并实时显示的方法。
S202、在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,且记录每页凭证的数量、当前页凭证内容的最小号码和最大号码。
在本实施例中,每一页面的凭证数量都是相等的,且凭证号码是连续的。比如,在当前页凭证内容为20条,当前页凭证内容的最小号码与最大号码分别为00041和00060时;此时,服务器通过第一线程查询到的当前页号码为00041至00060的20条凭证,并在显示界面上显示号码为00041至00060的20条凭证,同时记录每页凭证的数量为20条,当前页凭证内容的最小号码为00041,当前页凭证内容的最大号码为00060。可理解的,在查询所述当前页凭证内容时,用户可以根据需求对记录的内容进行增加或减少,比如,亦可记录所述当前页凭证的页码。
S203、在未获取到所述当前页凭证内容时,在所述数据库中继续查询所述当前页凭证内容并等待数据的返回。
也即,若一直未查询到所述当前页凭证内容时,首先继续查询并等待数据的返回,若超过预设时间还未查询到,可提示用户本次查询失败。
在一实施例中,如图5所示,所述步骤S202之后,还包括如下步骤:
S204、在接收所述客户端发送的翻页触发指令,获取所述翻页触发指令中包含的翻页参数,所述翻页参数包括翻页页数和翻页方向。
也即,在用户处理完当前页凭证内容之后,若需要翻页查询其他页面的凭证内容时,用户只要进行翻页动作,即发送翻页触发指令,且翻页时的翻页参数将随所述翻页触发指令发送至服务器。可理解的,所述翻页参数包括但不限定于为翻页页数、翻页方向、翻页后的页码等。
S205、根据所述翻页页数和所述每页凭证的数量获取被翻页的凭证总数量。
比如,翻页页数为2页,此前记录的每页凭证的数量为20条时,那么获取被翻页的凭证总数量为40。
S206、根据所述被翻页的凭证总数量、翻页方向、当前页凭证内容的最小号码和最大号码,获取翻页后页面的所有凭证号码。
由于凭证号码是连续的,翻页方向向后代表凭证号码递增,翻页方向向前代表凭证号码递减;此时,当此前记录的被翻页的凭证总数量为40、当前页凭证内容的最小号码为00041、当前页凭证内容的最大号码为00060、翻页方向为向后翻动(代表凭证号码递增)时,可将所述当前页凭证内容的最小号码(00041)和最大号码(00060)分别加上被翻页的凭证总数量(40),得出翻页后页面的凭证号码为0081至00100。
本实施例可以根据翻页参数获取翻页后页面的所有凭证号码,无需重新查询翻页后页面及该页面之前的所有页面,并根据该页面的凭证号码信息得出翻页后页面的所有凭证号码,该方案的查询速度明显得到了提升。
同理,在所述翻页参数包括翻页后页码时,而此前记录的所述当前页凭证的页码为第3页,每页凭证的数量为20条,当前页凭证内容的最小号码为00041,当前页凭证内容的最大号码为00060,可根据上述参数得出翻页后页码为第5页的凭证号码为00081至00100。
S207、控制所述第一线程根据翻页后页面的凭证号码直接在所述数据库中查询并调取对应的凭证内容,并将其显示在所述显示界面上。
在一实施例中,如图6所示,所述查询指令中还包括与本次查询对应的唯一标识,所述步骤S30具体包括如下步骤:
S301、根据所述第二指令开启所述第二线程,并通过所述第二线程在所述数据库中定时查询与所述唯一标识对应的凭证总数是否生成。用户在客户端点击查询按钮时,自动将查询指令发送至服务器。当服务器接收查询指令后,自动生成对应于本次查询的唯一标识。所述唯一标识与本次查询的查询指令关联,并存储于客户端;所述唯一标识可以按照预设规则随机生成,其标识长短可以根据标识规格的统一性一种或多种需求进行设定,仅需保证其唯一性即可。
在上述步骤S20中,根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询当前页凭证内容,由于当前页凭证内容比凭证总数要少,因此获取到当前页凭证内容的时间要快,并可以即时从数据库中调取数据进行显示。而在步骤S30中,根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询凭证总数,由于凭证总数的数据较多,因此在数据库中获取到凭证总数时间较长。
在本实施例中,按照预设的时间间隔定时去查看是否生成凭证总数,由于查询次数可能会多次,且期间可能会有其他客户端从数据库中调取数据,因此通过所述唯一标识将调取的凭证总数与客户端之间进行关联,可以将获取到凭证总数及时反馈至客户端。
S302、在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中。
在首次生成凭证总数时,通过第一线程直接从数据库中查询并显示凭证总数,而在首次生成凭证总数之后,会将该凭证总数与唯一标识关联存储至缓存中,此时,若在本次查询过程中,用户还需要进行翻页操作时,即需要重新查询翻页之后的当前页凭证内容时,此时凭证总数的数据并无变化,可以直接从缓存中调取显示即可,无需再从数据库中进行查询。可理解地,在当前页凭证内容与凭证总数均查询完毕时,由于已经获知并记录每页凭证的数量,可以根据需求在客户端的显示界面的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码、上一页和下一页的链接标签等。
在一个实施例中,在查询到所述凭证总数时,在当前的显示界面上(也即所述当前页凭证内容的显示界面上)展示当前页的凭证内容、凭证总数、凭证总页码及所述当前页凭证的页码、上一页和下一页的链接标签等。比如,显示界面上显示查询到的凭证总数为1000条,一共有50页凭证内容,所述当前页凭证的页码为第2页,且第2页包含20条凭证的所有内容;此时,在点击上一页或者下一页的链接标签,会将显示的当前页凭证内容切换至上一页或下一页的凭证内容,且所述当前页凭证的页码也会随之更改。
在另一实施例中,在当前的显示界面上(也即所述当前页凭证内容的显示界面上)展示多个窗口。其中,一个主窗口展示当前页的凭证内容、凭证总数、凭证总页码及所述当前页凭证的页码,该主窗口的位置可以设置在屏幕的任意位置(例如:屏幕中央,左边或者右边等),且主窗口的显示界面占据整个显示界面二分之一以上的显示空间;而在靠近所述主窗口的其他位置,还可以设置若干个副窗口,副窗口展示的内容可以根据需求设置,副窗口所占据的显示空间,亦可根据显示界面上除主窗口之外的剩余显示空间进行合理分配。可理解地,在显示过程中,可以根据显示比例对主窗口和副窗口的大小进行调整。所述副窗口可以为两个,此时可以在两个所述副窗口上分别显示凭证总数、凭证总页码、上一页和下一页的凭证内容以及该页凭证内容对应的页面页码,因此用户仅需点击副窗口,就可以直接在所述主窗口上展示点击的副窗口中所显示的凭证内容。同理,副窗口还可以为两个以上,其中展示的内容亦可根据用户需求来设定,比如,还可以展示第一页和最后一页的凭证内容。本实施例中通过所述副窗口来对当前页面之外的其他页面的凭证内容来进行预览显示,可以使得用户可以根据预览状况来更好地选择下一个需要展示的页面。
S303、在未生成所述凭证总数时,在所述数据库中继续查询所述凭证总数并等待数据的返回。在本实施例中,若未查询到所述凭证总数时,首先继续查询并等待数据的返回,若超过预设时间还未查询到,可提示用户本次查询失败。
在一实施例中,如图7所示,所述步骤S302之后,还包括如下步骤:
S304、接收所述客户端发送的翻页触发指令,控制所述第二线程根据所述唯一标识在所述缓存中调取所述凭证总数,并在所述显示界面上显示所述凭证总数。
也即,将所述凭证总数与所述唯一标识关联存储至缓存中,此时,需要自缓存中调取所述凭证总数时,仅需要通过匹配所述客户端与所述缓存中的唯一标识,即可找寻到与所述唯一标识关联存储在所述缓存中的所述凭证总数。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
在一实施例中,如图8所示,提供一种分程异步加载装置,该分程异步加载装置与上述实施例中分程异步加载方法一一对应。该分程异步加载装置包括接收模块110、第一启动模块120和第二启动模块130。各功能模块详细说明如下:
接收模块110,用于接收模块,用于接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令。
第一启动模块120,用于根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容。
第二启动模块130,用于根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
优选地,如图9所示,第一启动模块120具体包括:第一查询子模块121、第一显示子模块122、第一返回子模块123,各功能模块详细说明如下:
第一查询子模块121,用于根据所述第一指令开启所述第一线程,并通过所述第一线程在所述数据库中查询所述当前页凭证内容,实时检测是否已获取到所述当前页凭证内容。
第一显示子模块122,用于在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,且记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码。
第一返回子模块123,用于在未获取到所述当前页凭证内容时,在所述数据库中继续查询所述当前页凭证内容并等待数据的返回。
优选地,如图9所示,第一启动模块120具体还包括:翻页接收子模块124、翻页获取子模块125、翻页显示子模块126,各功能模块详细说明如下:
翻页接收子模块124,用于接收所述客户端发送的翻页触发指令,获取所述翻页触发指令中包含的翻页参数,所述翻页参数包括翻页页数和翻页方向。
翻页获取子模块125,用于根据所述翻页页数和每页凭证的数量获取被翻页的凭证总数量,并根据所述被翻页的凭证总数量、翻页方向、所述当前页凭证内容的最小号码和最大号码,获取翻页后页面的所有凭证号码。
翻页显示子模块126,用于控制第一线程根据翻页后页面的凭证号码直接在所述数据库中查询并调取对应的凭证内容,并将其显示在所述显示界面上。
优选地,如图9所示,所述查询指令中还包括与本次查询对应的唯一标识;第二启动模块130具体包括:第二查询子模块131、第二显示子模块132、第二返回子模块133和第二调取子模块134,各功能模块详细说明如下:
第二查询子模块131,用于根据所述第二指令开启所述第二线程,并通过所述第二线程在数据库中定时查询与所述唯一标识对应的凭证总数是否生成。
第二显示子模块132,用于在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中。
第二返回子模块133,用于在未生成所述凭证总数时,在所述数据库中继续查询所述凭证总数并等待数据的返回。
第二调取子模块134,用于接收所述客户端发送的翻页触发指令,控制所述第二线程根据所述唯一标识在所述缓存中调取所述凭证总数,并在所述显示界面上显示所述凭证总数。
关于分程异步加载装置的具体限定可以参见上文中对于分程异步加载方法的限定,在此不再赘述。上述分程异步加载装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于终端设备中的处理器中,也可以以软件形式存储于终端设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种终端设备(也即计算机设备),该终端设备可以是服务器,其内部结构图可以如图10所示。该终端设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该终端设备的处理器用于提供计算和控制能力。该终端设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为非易失性存储介质中的操作系统和计算机可读指令的运行提供环境。该终端设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种分程异步加载方法。
在一个实施例中,提供了一种终端设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现以下步骤:
接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令。
根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容。
根据所述第二指令开启第二线程,并通过所述第二线程在所述数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
在一个实施例中,提供了一个或多个存储有计算机可读指令的非易失性可读存储介质,该非易失性可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现以下步骤:
接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令。
根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容。
根据所述第二指令开启第二线程,并通过所述第二线程在所述数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲 存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路DRAM(SLDRAM)、存储器总线直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将所述装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
以上所述实施例仅说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种分程异步加载方法,其特征在于,包括:
    接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
    根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
    根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
  2. 如权利要求1所述的分程异步加载方法,其特征在于,所述通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容,包括:
    根据所述第一指令开启第一线程,并通过所述第一线程在所述数据库中查询所述当前页凭证内容,实时检测是否已获取到所述当前页凭证内容;
    在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,且记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码;
    在未获取到所述当前页凭证内容时,在所述数据库中继续查询所述当前页凭证内容并等待数据的返回。
  3. 如权利要求2所述的分程异步加载方法,其特征在于,所述在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,并记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码之后,还包括:
    接收所述客户端发送的翻页触发指令,获取所述翻页触发指令中包含的翻页参数,所述翻页参数包括翻页页数和翻页方向;
    根据所述翻页页数和所述每页凭证的数量获取被翻页的凭证总数量;
    根据所述被翻页的凭证总数量、翻页方向、所述当前页凭证内容的最小号码和最大号码,获取翻页后页面的所有凭证号码;
    控制所述第一线程根据翻页后页面的凭证号码直接在所述数据库中查询并调取对应的凭证内容,并将其显示在所述显示界面上。
  4. 如权利要求1所述的分程异步加载方法,其特征在于,所述查询指令中还包括与本次查询对应的唯一标识;
    所述根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,包括:
    根据所述第二指令开启第二线程,并通过所述第二线程在所述数据库中定时查询与所述唯一标识对应的凭证总数是否生成;
    在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中;
    在未生成所述凭证总数时,在所述数据库中继续查询所述凭证总数并等待数据的返回。
  5. 如权利要求4所述的分程异步加载方法,其特征在于,所述在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中之后,还包括:
    接收所述客户端发送的翻页触发指令,控制所述第二线程根据所述唯一标识在所述缓存中调取所述凭证总数,并在所述显示界面上显示所述凭证总数。
  6. 一种分程异步加载装置,其特征在于,包括:
    接收模块,用于接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
    第一启动模块,用于根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
    第二启动模块,用于根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
  7. 如权利6所述的分程异步加载装置,其特征在于,所述第一启动模块包括:
    第一查询子模块,用于根据所述第一指令开启所述第一线程,并通过所述第一线程在所述数据库中查询所述当前页凭证内容,实时检测是否已获取到所述当前页凭证内容;
    第一显示子模块,用于在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,且记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码;
    第一返回子模块,用于在未获取到所述当前页凭证内容时,在所述数据库中继续查询所述当前页凭证内容并等待数据的返回。
  8. 如权利7所述的分程异步加载装置,其特征在于,所述第一启动模块还包括:
    翻页接收子模块,用于在未获取到所述当前页凭证内容时,在所述数据库中继续查询所述当前页凭证内容并等待数据的返回。
    翻页获取子模块,用于根据所述翻页页数和所述每页凭证的数量获取被翻页的凭证总数量,并根据所述被翻页的凭证总数量、翻页方向、当前页凭证内容的最小号码和最大号码,获取翻页后页面的所有凭证号码;
    翻页显示子模块,用于控制所述第一线程根据翻页后页面的凭证号码直接在所述数据库中查询并调取对应的凭证内容,并将其显示在所述显示界面上。
  9. 如权利6所述的分程异步加载装置,其特征在于,所述查询指令中还包括与本次查询对应的唯一标识;第二启动模块包括:
    第二查询子模块,用于根据所述第二指令开启所述第二线程,并通过所述第二线程在数据库中定时查询与所述唯一标识对应的凭证总数是否生成;
    第二显示子模块,用于在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中;
    第二返回子模块,用于在未生成所述凭证总数时,在所述数据库中继续查询所述凭证总数并等待数据的返回。
  10. 如权利9所述的分程异步加载装置,其特征在于,所述第二启动模块还包括:
    第二调取子模块,用于接收所述客户端发送的翻页触发指令,控制所述第二线程根据所述唯一标识在所述缓存中调取所述凭证总数,并在所述显示界面上显示所述凭证总数。
  11. 一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其特征在于,所述处理器执行所述计算机可读指令时实现如下步骤:
    接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
    根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
    根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证 总数、所述当前页凭证的页码和凭证总页码。
  12. 如权利要求11所述的终端设备,其特征在于,所述通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容,包括:
    根据所述第一指令开启第一线程,并通过所述第一线程在所述数据库中查询所述当前页凭证内容,实时检测是否已获取到所述当前页凭证内容;
    在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,且记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码;
    在未获取到所述当前页凭证内容时,在所述数据库中继续查询所述当前页凭证内容并等待数据的返回。
  13. 如权利要求12所述的终端设备,其特征在于,所述在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,并记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码之后,还包括:
    接收所述客户端发送的翻页触发指令,获取所述翻页触发指令中包含的翻页参数,所述翻页参数包括翻页页数和翻页方向;
    根据所述翻页页数和所述每页凭证的数量获取被翻页的凭证总数量;
    根据所述被翻页的凭证总数量、翻页方向、所述当前页凭证内容的最小号码和最大号码,获取翻页后页面的所有凭证号码;
    控制所述第一线程根据翻页后页面的凭证号码直接在所述数据库中查询并调取对应的凭证内容,并将其显示在所述显示界面上。
  14. 如权利要求11所述的终端设备,其特征在于,所述查询指令中还包括与本次查询对应的唯一标识;
    所述根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,包括:
    根据所述第二指令开启第二线程,并通过所述第二线程在所述数据库中定时查询与所述唯一标识对应的凭证总数是否生成;
    在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中;
    在未生成所述凭证总数时,在所述数据库中继续查询所述凭证总数并等待数据的返回。
  15. 如权利要求14所述的终端设备,其特征在于,所述在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中之后,还包括:
    接收所述客户端发送的翻页触发指令,控制所述第二线程根据所述唯一标识在所述缓存中调取所述凭证总数,并在所述显示界面上显示所述凭证总数。
  16. 一个或多个存储有计算机可读指令的非易失性可读存储介质,其特征在于,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    接收客户端发送的查询指令,所述查询指令包括对当前页凭证内容进行查询的第一指令和对凭证总数进行查询的第二指令;
    根据所述第一指令开启第一线程,并通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容;
    根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码。
  17. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述通过所述第一线程在数据库中查询所述当前页凭证内容,在查询到所述当前页凭证内容时,在显示界面上显示所述当前页凭证内容,包括:
    根据所述第一指令开启第一线程,并通过所述第一线程在所述数据库中查询所述当前页凭证内容,实时检测是否已获取到所述当前页凭证内容;
    在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,且记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码;
    在未获取到所述当前页凭证内容时,在所述数据库中继续查询所述当前页凭证内容并等待数据的返回。
  18. 如权利要求17所述的非易失性可读存储介质,其特征在于,所述在获取到所述当前页凭证内容时,在所述显示界面上显示所述当前页凭证内容,并记录每页凭证的数量、所述当前页凭证内容的最小号码和最大号码之后,还包括:
    接收所述客户端发送的翻页触发指令,获取所述翻页触发指令中包含的翻页参数,所述翻页参数包括翻页页数和翻页方向;
    根据所述翻页页数和所述每页凭证的数量获取被翻页的凭证总数量;
    根据所述被翻页的凭证总数量、翻页方向、所述当前页凭证内容的最小号码和最大号码,获取翻页后页面的所有凭证号码;
    控制所述第一线程根据翻页后页面的凭证号码直接在所述数据库中查询并调取对应的凭证内容,并将其显示在所述显示界面上。
  19. 如权利要求16所述的非易失性可读存储介质,其特征在于,所述查询指令中还包括与本次查询对应的唯一标识;
    所述根据所述第二指令开启第二线程,并通过所述第二线程在数据库中查询所述凭证总数,在查询到所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,包括:
    根据所述第二指令开启第二线程,并通过所述第二线程在所述数据库中定时查询与所述唯一标识对应的凭证总数是否生成;
    在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中;
    在未生成所述凭证总数时,在所述数据库中继续查询所述凭证总数并等待数据的返回。
  20. 如权利要求19所述的非易失性可读存储介质,其特征在于,所述在生成所述凭证总数时,在所述当前页凭证内容的显示界面上的预设位置显示所述凭证总数、所述当前页凭证的页码和凭证总页码,并将所述凭证总数与所述唯一标识关联存储至缓存中之后,还包括:
    接收所述客户端发送的翻页触发指令,控制所述第二线程根据所述唯一标识在所述缓存中调取所述凭证总数,并在所述显示界面上显示所述凭证总数。
PCT/CN2018/106249 2018-07-27 2018-09-18 分程异步加载方法、装置、终端设备及存储介质 WO2020019450A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810845419.5A CN109325049A (zh) 2018-07-27 2018-07-27 分程异步加载方法、装置、终端设备及存储介质
CN201810845419.5 2018-07-27

Publications (1)

Publication Number Publication Date
WO2020019450A1 true WO2020019450A1 (zh) 2020-01-30

Family

ID=65264086

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106249 WO2020019450A1 (zh) 2018-07-27 2018-09-18 分程异步加载方法、装置、终端设备及存储介质

Country Status (2)

Country Link
CN (1) CN109325049A (zh)
WO (1) WO2020019450A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858581A (zh) * 2020-06-08 2020-10-30 远光软件股份有限公司 一种分页查询的方法、装置、存储介质和电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521280A (zh) * 2011-11-26 2012-06-27 华为技术有限公司 一种EPub电子书加载方法及装置
WO2014143055A1 (en) * 2013-03-15 2014-09-18 Intel Corporation Mechanism for facilitating dynamic and efficient management of translation buffer prefetching in software programs at computing systems
CN104298788A (zh) * 2014-11-13 2015-01-21 中国建设银行股份有限公司 一种分页查询方法和系统
CN107689997A (zh) * 2017-09-12 2018-02-13 中国联合网络通信集团有限公司 一种阅读进度同步方法及系统、应用服务端和客户端
CN108153847A (zh) * 2017-12-20 2018-06-12 北京奇艺世纪科技有限公司 一种列表分页方法、装置及电子设备

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102521280A (zh) * 2011-11-26 2012-06-27 华为技术有限公司 一种EPub电子书加载方法及装置
WO2014143055A1 (en) * 2013-03-15 2014-09-18 Intel Corporation Mechanism for facilitating dynamic and efficient management of translation buffer prefetching in software programs at computing systems
CN104298788A (zh) * 2014-11-13 2015-01-21 中国建设银行股份有限公司 一种分页查询方法和系统
CN107689997A (zh) * 2017-09-12 2018-02-13 中国联合网络通信集团有限公司 一种阅读进度同步方法及系统、应用服务端和客户端
CN108153847A (zh) * 2017-12-20 2018-06-12 北京奇艺世纪科技有限公司 一种列表分页方法、装置及电子设备

Also Published As

Publication number Publication date
CN109325049A (zh) 2019-02-12

Similar Documents

Publication Publication Date Title
KR101626639B1 (ko) 컴퓨터에서 콘텐츠 렌더링하는 시스템 및 방법
WO2018176960A1 (zh) 显示网络图片的方法、装置以及用户终端
US20140298313A1 (en) Method, server, client and system for updating data
US11836112B2 (en) Path resolver for client access to distributed file systems
WO2021164161A1 (zh) 影像数据标注方法、装置、计算机设备和存储介质
CN111125169A (zh) 数据查询方法及其控制方法、装置、介质及计算机设备
US9110917B2 (en) Creating a file descriptor independent of an open operation
WO2019041500A1 (zh) 分页的实现方法、装置、计算机设备及存储介质
US10506400B2 (en) Data download method and apparatus
WO2020006864A1 (zh) 浏览器输入框展示方法、装置、计算机设备及存储介质
WO2022001625A1 (zh) 数据查询方法、装置、计算机设备和存储介质
US11914667B2 (en) Managing multi-dimensional array of data definitions
WO2020019450A1 (zh) 分程异步加载方法、装置、终端设备及存储介质
CN112866339B (zh) 数据传输方法、装置、计算机设备和存储介质
US20150234703A1 (en) System and method to perform a backup operation using one or more attributes of files
US11068558B2 (en) Managing data for rendering visualizations
WO2018201993A1 (zh) 图像绘制方法、终端及存储介质
CN112818021B (zh) 数据请求处理方法、装置、计算机设备和存储介质
US10616291B2 (en) Response caching
CN108173892B (zh) 云端镜像操作方法和装置
WO2021129416A1 (zh) 移动终端帧率的控制方法、装置、计算机设备和存储介质
US11379653B2 (en) Rendering method for on-demand loading of PDF file on network
CN113448739A (zh) 一种数据处理方法及装置
CN110750724B (zh) 数据处理方法、装置、设备和存储介质
CN114238264A (zh) 数据处理方法、装置、计算机设备和存储介质

Legal Events

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

Ref document number: 18927772

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: 18927772

Country of ref document: EP

Kind code of ref document: A1