WO2018095187A1 - 文档在线预览方法及装置 - Google Patents

文档在线预览方法及装置 Download PDF

Info

Publication number
WO2018095187A1
WO2018095187A1 PCT/CN2017/107730 CN2017107730W WO2018095187A1 WO 2018095187 A1 WO2018095187 A1 WO 2018095187A1 CN 2017107730 W CN2017107730 W CN 2017107730W WO 2018095187 A1 WO2018095187 A1 WO 2018095187A1
Authority
WO
WIPO (PCT)
Prior art keywords
primary key
data associated
preview
key
content
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2017/107730
Other languages
English (en)
French (fr)
Inventor
王瑞波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to RU2019113516A priority Critical patent/RU2729053C1/ru
Priority to US16/349,329 priority patent/US11256773B2/en
Publication of WO2018095187A1 publication Critical patent/WO2018095187A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/14Details of searching files based on file metadata
    • G06F16/156Query results presentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Definitions

  • the present disclosure relates to the field of Internet technologies, and in particular, to a document online preview method and a document online preview device.
  • Front-end conversion and online preview the online preview of this document is implemented by triggering the background program to convert the document when the user clicks on the document for preview.
  • the advantage of this implementation method is that the document does not have to be completely converted, and only when the user needs to view the document, the conversion is performed, which reduces the pressure on the server; the disadvantage is that when the document is relatively large, the waiting time of the user may be increased, and The download is almost indistinguishable, the user experience is poor, and large document conversions are prone to failure under high concurrency.
  • the backend asynchronously converts the document.
  • This online preview method of the document is asynchronous conversion when the user uploads the document, and the foreground user previews the document when the document is clicked.
  • the advantage of this implementation method is that the foreground is quick and the experience is good when previewing the document; the disadvantage is that all the documents need to be converted, the server is under pressure, and the conversion failure also occurs for large documents.
  • a document online preview method including:
  • the data associated with the primary key is queried, the data associated with the primary key is obtained from the cache server, and data associated with the primary key is sent to an application server;
  • the application server After receiving the data associated with the primary key, the application server determines a key value browsing amount of the primary key included in data associated with the primary key;
  • the value of the key page view amount is not zero, obtaining the content to be previewed from the cloud storage server according to the primary key and providing the content to the application server;
  • the application server receives the content to be previewed for preview by a user.
  • the method further includes: updating the key value browsing amount, and storing the updated key value browsing amount in the cache server.
  • the method further includes:
  • the access time in the data initial value is the current access time.
  • the method further includes: if the value of the key browsing amount is zero, converting the preview content, and uploading the converted preview content to the cloud storage server.
  • converting the preview content includes:
  • a primary key that needs to wait for a conversion is obtained from the queue and the content to be previewed is obtained from the cloud storage server according to the primary key for conversion.
  • the method further includes:
  • the key value browsing amount in the cache server is modified to 1.
  • the method further includes:
  • the method further includes:
  • the data associated with the primary key whose access time is greater than a second preset value in the cache server is periodically deleted.
  • a document online preview apparatus including:
  • a data query module configured to query, in the cache server, whether data associated with the primary key exists according to a primary key of the content to be previewed;
  • the first data obtaining module is configured to: if the data associated with the primary key is found to exist, acquire data associated with the primary key from the cache server, and send data associated with the primary key to an application server;
  • a key value browsing amount judging module after the application server receives the data associated with the primary key, determining a key value browsing amount of the primary key included in the data associated with the primary key;
  • a preview content obtaining module configured to: when determining that the value of the key value browsing amount is not zero, obtain the content to be previewed from the cloud storage server according to the primary key and provide the content to the application server;
  • the preview content receiving module is configured to receive, by the application server, the content to be previewed for preview by a user.
  • the method further includes:
  • Updating the storage module for updating the key value browsing amount, and storing the updated key value browsing amount in the cache service In the server.
  • the method further includes:
  • a second data obtaining module configured to acquire data associated with the primary key from a database if the data associated with the primary key is not present;
  • a first data sending module configured to send data associated with the primary key to the cache server if data associated with the primary key exists in the database
  • a second data sending module if there is no data associated with the primary key in the database, creating an initial value of the data associated with the primary key in the database and sending the data to the cache server, the data initial The value of the key value in the value is zero, and the access time in the initial value of the data is the current access time.
  • the method further includes:
  • the preview content conversion module when determining that the value of the key value browsing amount is zero, converting the preview content, and uploading the converted preview content to the cloud storage server.
  • converting the preview content includes:
  • the primary key that needs to wait for the conversion is obtained from the queue and the content to be previewed is obtained from the cloud storage server according to the primary key for conversion.
  • the method further includes:
  • the key value browsing amount in the cache server is modified to 1.
  • the method further includes:
  • the apparatus further includes:
  • a first data deletion module periodically deleting data associated with the primary key in the cache server that is smaller than a first preset value
  • the second data deletion module periodically deletes data associated with the primary key in the cache server that has an access time greater than a second preset value.
  • an electronic device comprising one or more processors; a memory for storing one or more programs; and when the one or more programs are used by the one or more processors Executing to cause the one or more processors to implement the document online preview method as described above.
  • a computer readable medium having stored thereon a computer program that, when executed by a processor, implements a document online preview method as described above.
  • the document online preview method and apparatus of the present disclosure queries and acquires data associated with the primary key in a cache server according to a primary key of the content to be previewed, and then sends data associated with the primary key to an application server; the application server receives After the data associated with the primary key, the content to be previewed is obtained from the cloud storage server according to the primary key and provided to the application server; the application server receives the content to be previewed for preview by the user; on the other hand, adopts a document paging conversion preview Way, reducing the time required for the conversion of the entire document; on the other hand, by adopting caching, queue conversion
  • the user provides the document that needs to be previewed, which improves the performance of the overall system and is suitable for the user to concurrently access the preview.
  • the conversion trigger mode is required when the user selects the preview document, so that the server does not need to convert all the documents, thereby reducing the server.
  • the pressure further, by speeding up the cache based on the number of visits to the document page and the most recent access time, the speed at which the user previews the document is improved.
  • FIG. 1 schematically shows a flow chart of a document online preview method in an exemplary embodiment of the present disclosure.
  • FIG. 2 schematically illustrates a flow chart of a method of converting preview content in an exemplary embodiment of the present disclosure.
  • FIG. 3 schematically shows a flow chart of another document online preview method in an exemplary embodiment of the present disclosure.
  • FIG. 4 schematically shows a block diagram of a document online preview apparatus in an exemplary embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram showing a computer readable storage medium in an exemplary embodiment of the present disclosure
  • FIG. 6 schematically shows a schematic diagram of an electronic device in an exemplary embodiment of the present disclosure.
  • a document online preview method is first provided.
  • the document online preview method may include the following steps:
  • the application server After receiving the data associated with the primary key, the application server determines a key value browsing amount of the primary key included in data associated with the primary key;
  • the application server receives the content to be previewed for preview by a user.
  • the online preview method of the document in the example embodiment adopts the method of page-by-page conversion preview, which reduces the time required for the conversion of the entire document; on the other hand, the user is provided with a preview by using a cache and a queue conversion manner.
  • the document improves the performance of the overall system and is suitable for users to concurrently access the preview.
  • the conversion trigger mode is required when the user selects the preview document, so that the server does not need to convert all the documents, thereby reducing the pressure on the server.
  • the speed at which the user previews the document is improved by clearing the cache according to the number of visits of the document page and the time of the latest access time.
  • step S110 whether the data associated with the primary key exists in the cache server according to the primary key of the content to be previewed.
  • the content to be previewed may include a certain page or a certain page of a certain document that the user needs to view;
  • the primary key may include one or more fields;
  • the primary key of the content to be previewed may be The document number and the page number corresponding to the document are included;
  • the cache server may be a server that determines whether the user requests the preview of the document and whether the current page of the document already has a conversion; for example:
  • the request is first sent to the application server; the application server receives the user request, and the document number (for example: JDZL00001) and the page number corresponding to the document (for example, it can be: the first page) as the joint primary key (ie, the key is: JDZL00001-1, referred to as the primary key), and the primary key is used to search for the data associated with the primary key on the cache server.
  • the search may be performed in other manners according to the situation, which is not specifically limited in the exemplary embodiment.
  • step S120 if data associated with the primary key is queried, data associated with the primary key is obtained from the cache server, and data associated with the primary key is sent to an application server.
  • the data associated with the primary key may include a primary key, a key value browsing amount, an access time, and the like; the key value browsing amount may be used to indicate a browsing number of a page in the document to be previewed;
  • the access time may include the most recent browsing time; however, the present example embodiment does not particularly limit the data associated with the primary key, and in other exemplary embodiments of the present disclosure, it may also include other data.
  • the application server when it is determined by the query that the data associated with the primary key exists, for example, the application server first queries the cache server to query whether there is a document that needs to be previewed and a page corresponding to the document. Data, if the application server queries the cache server for a document that needs to be previewed and a page pair in the document If the data exists, the document and the data in the document and the corresponding data of the page, such as the pageview and the latest browsing time, are directly obtained from the cache server, and then the data is sent to the application server.
  • the data associated with the primary key is obtained from the database. And if data associated with the primary key exists in the database, data associated with the primary key may be sent to the cache server; if data associated with the primary key does not exist in the database, then An initial value of the data associated with the primary key is created in the database and sent to the cache server.
  • the key value of the initial value of the data is zero, and the access time of the initial value of the data is the current access time.
  • the application server queries the cache server for a document that needs to be previewed and a page in the document does not exist, the document is obtained from the database, and the corresponding page number in the document and the page view of the page and the most recent The browsing time of one time is then sent to the application server; if the document does not exist in the database and the corresponding page in the document and the page view of the page and the last browsing time, the document is created in the database and the corresponding in the document The page and the page view and the most recent browsing time are then sent to the application server; the pageview is zero and the browsing time is the current time.
  • step S130 after receiving the data associated with the primary key, the application server determines the key value browsing amount of the primary key included in the data associated with the primary key.
  • the page view is judged.
  • step S140 when it is determined that the value of the key value browsing amount is not zero, the content to be previewed is obtained from the cloud storage server according to the primary key and provided to the application server; and the key value browsing amount is updated, and The updated key page views are stored in the cache server.
  • converting the preview content may include the following steps S202 to S206. among them:
  • step S202 the primary key is written to the queue that needs to be converted to wait for conversion.
  • step S204 a primary key that needs to wait for conversion is acquired from the queue and the content to be previewed is acquired from the cloud storage server according to the primary key for conversion. For example:
  • the single key or the multi-threaded manner may be used to obtain a primary key that needs to wait for the conversion from the queue, and obtain the to-be previewed content from the cloud storage server according to the primary key for conversion, but the present exemplary embodiment Not limited to this.
  • the primary key that needs to wait for the conversion may also be obtained from the queue in other manners according to the situation, which is not specifically limited in the exemplary embodiment.
  • LWP Lightweight Process
  • PC current instruction pointer
  • queue Can be understood as: a special linear table, the special thing is that it only allows the delete operation on the front of the table, and the insert operation on the back of the table, like the stack, the queue is a A linear table with restricted operations, the end of the insert operation is called the tail of the team, and the end of the delete operation is called the head of the team; however, the embodiment of the present invention is not limited thereto.
  • the format generated after the content to be previewed is converted may include: .html, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .txt, or .pdf, etc., but Example embodiments are not limited thereto.
  • step S206 when the preview content conversion is completed, the key value browsing amount in the cache server is modified to 1, thereby facilitating the subsequent process.
  • a user waiting identifier may be further provided; when the conversion of the preview content is completed, the user waiting identifier is cancelled; if the set timeout period is exceeded, Then the conversion fails and you need to re-convert.
  • step S150 the application server receives the content to be previewed for preview by a user.
  • the application server After receiving the content to be previewed of the page, the application server sends the content to be previewed of the page to the terminal, and the user previews the final result through the terminal.
  • the terminal may include various electronic devices having a display screen, such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, a game machine, and a PDA.
  • the document online preview method may further include step S310 and step S320. among them:
  • step S310 the data associated with the primary key in the cache server is less than the first preset value, and the access time in the cache server is periodically deleted in step S320.
  • the data associated with the primary key of the preset value In detail: In order to make full use of the cache server memory and to meet the high performance of the system, the page content of the user browsing the document needs to be obtained from the cache server as much as possible. Therefore, the document with a relatively low page view can be periodically obtained from the cache server. The page number is deleted; the document and page number whose access time is relatively long away can be deleted from the cache server periodically; and the deleted document and the page number are saved in the database; by the above manner, the cache is guaranteed in the cache server.
  • the data has maximum activity.
  • a document online preview device may include: a data query module 410, a first data obtaining module 420, and a key value browsing amount determining module 430. a preview content acquisition module 440, an update storage module 450, and a preview content receiving module 460; wherein:
  • the data query module 410 is configured to query, in the cache server, whether data associated with the primary key exists according to a primary key of the content to be previewed;
  • the first data obtaining module 420 is configured to: if the data associated with the primary key is found to exist, acquire data associated with the primary key from the cache server, and send data associated with the primary key to an application server ;
  • the key value browsing amount determining module 430 is configured to determine, after the application server receives the data associated with the primary key, the key value browsing amount of the primary key included in the data associated with the primary key;
  • the preview content obtaining module 440 is configured to: when determining that the value of the key value browsing amount is not zero, acquire the content to be previewed from the cloud storage server according to the primary key and provide the content to the application server; and
  • the update storage module 450 is configured to update the key value browsing amount, and store the updated key value browsing amount in the In the server;
  • the preview content receiving module 460 is configured to receive, by the application server, the content to be previewed for preview by a user.
  • the document online preview device of the present disclosure adopts the method of page paging conversion preview, which reduces the time required for the conversion of the entire document; uses the method of caching and queue conversion to provide the user with the document that needs to be previewed, improves the performance of the overall system, and is suitable for the user.
  • High concurrent access preview the conversion trigger mode is required when the user selects the preview document, so that the server does not need to convert all the documents, and the pressure of the server performance is promoted; the cache is cleaned according to the access page amount of the document page and the latest access time. The way to improve the speed at which users browse documents.
  • the method further includes:
  • a second data obtaining module configured to acquire data associated with the primary key from a database if the data associated with the primary key is not present;
  • a first data sending module configured to send data associated with the primary key to the cache server if data associated with the primary key exists in the database
  • a second data sending module if there is no data associated with the primary key in the database, creating an initial value of the data associated with the primary key in the database and sending the data to the cache server, the data initial The value of the key value in the value is zero, and the access time in the initial value of the data is the current access time.
  • the method further includes:
  • the preview content conversion module when determining that the value of the key value browsing amount is zero, converting the preview content, and uploading the converted preview content to the cloud storage server.
  • converting the preview content includes:
  • the primary key that needs to wait for the conversion is obtained from the queue and the content to be previewed is obtained from the cloud storage server according to the primary key for conversion.
  • the method further includes:
  • the key value browsing amount in the cache server is modified to 1.
  • the method further includes:
  • the apparatus further includes:
  • a first data deletion module periodically deleting data associated with the primary key in the cache server that is smaller than a first preset value
  • the second data deletion module periodically deletes data associated with the primary key in the cache server that has an access time greater than a second preset value.
  • the present disclosure also provides an electronic device comprising one or more processors; a memory for storing one or more programs; and when the one or more programs are executed by the one or more processors, One or more processors implemented as above The online preview method of the document.
  • the present disclosure also provides a computer readable medium having stored thereon a computer program that, when executed by a processor, implements a document online preview method as described above.
  • modules or units of equipment for action execution are mentioned in the detailed description above, such division is not mandatory. Indeed, in accordance with embodiments of the present disclosure, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one of the modules or units described above may be further divided into multiple modules or units.
  • a computer readable storage medium having stored thereon a computer program, the program being executable by, for example, a processor, capable of implementing the electronic prescription flow processing in any one of the above embodiments
  • aspects of the present invention may also be embodied in the form of a program product comprising program code for causing said program product to run on a terminal device
  • the terminal device performs the steps according to various exemplary embodiments of the present invention described in the section of the above-described electronic prescription circulation processing method of the present specification.
  • a program product 500 for implementing the above method which may employ a portable compact disk read only memory (CD-ROM) and includes program code, and may be in a terminal device, is illustrated in accordance with an embodiment of the present invention.
  • CD-ROM portable compact disk read only memory
  • the program product of the present invention is not limited thereto, and in the present document, the readable storage medium may be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus or device.
  • the program product can employ any combination of one or more readable media.
  • the readable medium can be a readable signal medium or a readable storage medium.
  • the readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive lists) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
  • the computer readable storage medium can include a data signal that is propagated in a baseband or as part of a carrier, in which readable program code is carried. Such propagated data signals can take a variety of forms including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • the readable storage medium can also be any readable medium other than a readable storage medium that can transmit, propagate or transport a program for use by or in connection with an instruction execution system, apparatus or device.
  • Program code embodied on a readable storage medium may be transmitted by any suitable medium, including but not limited to wireless, wireline, optical cable, RF, etc., or any suitable combination of the foregoing.
  • Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, etc., including conventional procedural Cheng Programming language—such as the “C” language or a similar programming language.
  • the program code can execute entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the remote computing device on the user computing device, or entirely on the remote computing device or server. Execute on.
  • the remote computing device can be connected to the user computing device via any kind of network, including a local area network (LAN) or wide area network (WAN), or can be connected to an external computing device (eg, provided using an Internet service) Businesses are connected via the Internet).
  • LAN local area network
  • WAN wide area network
  • Businesses are connected via the Internet.
  • an electronic device comprising a processor, and a memory for storing executable instructions of the processor.
  • the processor is configured to perform the step of the electronic prescription flow processing method in any one of the above embodiments via execution of the executable instruction.
  • FIG. 9 An electronic device 600 in accordance with such an embodiment of the present invention is described below with reference to FIG. 9 is merely an example and should not impose any limitation on the function and scope of use of the embodiments of the present invention.
  • electronic device 600 is embodied in the form of a general purpose computing device.
  • the components of the electronic device 600 may include, but are not limited to, at least one processing unit 610, at least one storage unit 620, a bus 630 that connects different system components (including the storage unit 620 and the processing unit 610), a display unit 640, and the like.
  • the storage unit stores program code, and the program code may be executed by the processing unit 610, such that the processing unit 610 performs various exemplary embodiments according to the present invention described in the electronic recipe flow processing method section of the present specification.
  • the processing unit 610 can perform the steps as shown in FIG.
  • the storage unit 620 can include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 6201 and/or a cache storage unit 6202, and can further include a read only storage unit (ROM) 6203.
  • RAM random access storage unit
  • ROM read only storage unit
  • the storage unit 620 can also include a program/utility 6204 having a set (at least one) of the program modules 6205, such as, but not limited to, an operating system, one or more applications, other program modules, and programs. Data, each of these examples or some combination may include an implementation of a network environment.
  • Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local area using any of a variety of bus structures. bus.
  • the electronic device 600 can also communicate with one or more external devices 700 (eg, a keyboard, pointing device, Bluetooth device, etc.), and can also communicate with one or more devices that enable the user to interact with the electronic device 600, and/or with The electronic device 600 is enabled to communicate with any device (e.g., router, modem, etc.) that is in communication with one or more other computing devices. This communication can take place via an input/output (I/O) interface 650. Also, electronic device 600 can communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network, such as the Internet) through network adapter 660. Network adapter 660 can communicate with other modules of electronic device 600 via bus 630.
  • LAN local area network
  • WAN wide area network
  • public network such as the Internet
  • electronic device 600 includes, but is not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
  • the technical solution according to an embodiment of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network.
  • a non-volatile storage medium which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.
  • a number of instructions are included to cause a computing device (which may be a personal computer, server, mobile terminal, or network device, etc.) to perform a method in accordance with an embodiment of the present disclosure.
  • the disclosure is applicable to the field of Internet technology, and solves the problem of pressure on the document conversion server in the prior art; not only reduces the document conversion time, but also reduces the pressure on the server and improves the speed of the user previewing the document.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种文档在线预览方法及装置,该方法包括:根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在(S110);如果查询到与所述主键关联的数据存在,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器(S120);所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断(S130);在判断所述键值浏览量的值不为零时,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;以及更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓存服务器中(S140);所述应用服务器接收所述待预览内容以供用户预览(S150)。该方法可以提高用户预览文档的速度。

Description

文档在线预览方法及装置 技术领域
本公开涉及互联网技术领域,具体而言,涉及一种文档在线预览方法以及一种文档在线预览装置。
背景技术
随着互联网的迅速发展,人们可以从互联网上轻松下载各种文档到本地进行浏览,但需本地安装相应文档的阅读软件。另外,下载文档尤其是大文档需要增加额外的等待时间,用户体验性差。所以,目前越来越多的网站趋向于在线预览文档,文档在线预览技术常规做法是先进行转换,后进行预览,但大都存在性能较低,转换率不高等情况。
目前两种常用的文档在线预览方案如下:
前端转换并在线预览,这种文档在线预览实现方法是当用户点击文档进行预览时,触发后台程序转换文档。这种实现方法的优点是:文档不必全部转换,只有当用户需要查看文档的时候才进行转换,降低了服务器的压力;缺点是:当文档比较大的时候,可能会增加用户的等待时间,与下载几乎无分别,用户体验较差,并且,在高并发下大文档转换极易发生失败。
后端异步转换文档,这种文档在线预览方法是当用户上传文档的时候进行异步转换,前台用户点击文档时预览文档。这种实现方法的优点是:前台预览文档的时候速度快、体验好;缺点是:所有文档都需要进行转换,服务器压力较大,并且,对于大文档也同样存在转化失败的问题。
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。
发明内容
本公开的目的在于提供一种文档在线预览的方法及装置,进而至少在一定程度上克服由于相关技术的限制和缺陷而导致的一个或者多个问题。
根据本公开的一个方面,提供一种文档在线预览方法,包括:
根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在;
如果查询到与所述主键关联的数据,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器;
所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断;
如果所述键值浏览量的值不为零,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;以及,
所述应用服务器接收所述待预览内容以供用户预览。
在本公开的一种示例性实施例中,还包括:更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓存服务器中。
在本公开的一种示例性实施例中,还包括:
如果与所述主键关联的数据不存在,则从数据库中获取与所述主键关联的数据;以及
如果所述数据库中存在与所述主键关联的数据,则将与所述主键关联的数据发送到所述缓存服务器;
如果所述数据库中不存在与所述主键关联的数据,则在所述数据库中创建一与所述主键关联的数据初始值并发送到所述缓存服务器,所述数据初始值中键值浏览量为零,所述数据初始值中访问时间为当前访问时间。
在本公开的一种示例性实施例中,还包括:如果所述键值浏览量的值为零,对预览内容进行转换,并将转换后的预览内容上传至所述云存储服务器。
在本公开的一种示例性实施例中,对预览内容进行转换包括:
将所述主键写入需要转换的队列等待转换;
从所述队列中获取需要等待转换的主键并根据所述主键从所述云存储服务器获取待预览内容进行转换。
在本公开的一种示例性实施例中,还包括:
完成所述预览内容转换时,将所述缓存服务器中的键值浏览量修改为1。
在本公开的一种示例性实施例中,还包括:
对所述预览内容进行转换时,提供一用户等待标识;
完成所述预览内容的转换时,取消所述用户等待标识。
在本公开的一种示例性实施例中,所述方法还包括:
定时删除所述缓存服务器中所述键值浏览量小于第一预设值的与所述主键关联的数据;以及
定时删除所述缓存服务器中访问时间大于第二预设值的与所述主键关联的数据。
根据本公开的另一个方面,提供一种文档在线预览装置,包括:
数据查询模块:用于根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在;
第一数据获取模块:用于如果查询到与所述主键关联的数据存在,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器;
键值浏览量判断模块:用于所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断;
预览内容获取模块:用于在判断所述键值浏览量的值不为零时,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;以及
预览内容接收模块:用于所述应用服务器接收所述待预览内容以供用户预览。
在本公开的一种示例性实施例中,还包括:
更新存储模块:用于更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓存服 务器中。
在本公开的一种示例性实施例中,还包括:
第二数据获取模块:用于如果查询到与所述主键关联的数据不存在,则从数据库中获取与所述主键关联的数据;以及
第一数据发送模块:用于如果所述数据库中存在与所述主键关联的数据,则将与所述主键关联的数据发送到所述缓存服务器;
第二数据发送模块:如果所述数据库中不存在与所述主键关联的数据,则在所述数据库中创建一与所述主键关联的数据初始值并发送到所述缓存服务器,所述数据初始值中键值浏览量为零,所述数据初始值中访问时间为当前访问时间。
在本公开的一种示例性实施例中,还包括:
预览内容转换模块:在判断所述键值浏览量的值为零时,对预览内容进行转换,并将转换后的预览内容上传至所述云存储服务器。
在本公开的一种示例性实施例中,对预览内容进行转换包括:
将所述主键写入需要转换的队列等待转换;
从所述队列中获取需要等待转换的主键并根据所述主键从所述云存储服务器获取待预览的内容进行转换。
在本公开的一种示例性实施例中,还包括:
完成所述预览内容转换时,将所述缓存服务器中的键值浏览量修改为1。
在本公开的一种示例性实施例中,还包括:
对所述预览内容进行转换时,提供一用户等待标识;
完成所述预览内容的转换时,取消所述用户等待标识。
在本公开的一种示例性实施例中,所述装置还包括:
第一数据删除模块:定时删除所述缓存服务器中所述键值浏览量小于第一预设值的与所述主键关联的数据;以及
第二数据删除模块:定时删除所述缓存服务器中访问时间大于第二预设值的与所述主键关联的数据。
根据本公开的另一方面,提供一种电子设备,包括一个或多个处理器;存储器,用于存储一个或多个程;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上所述的文档在线预览方法。
根据本公开的又一方面,提供一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上所述的文档在线预览方法。
本公开的文档在线预览方法及装置,根据待预览内容的主键在缓存服务器中查询并获取与所述主键关联的数据,然后将与所述主键关联的数据发送给应用服务器;所述应用服务器接收与所述主键关联的数据后,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;所述应用服务器接收所述待预览内容以供用户预览;一方面,采用文档分页转换预览的方式,减少了整个文档的转换所需时间;另一方面,通过采用缓存、队列转换的方式为 用户提供需要预览的文档,提高了整体系统的性能,适合用户高并发访问预览;再一方面,通过在用户选择预览文档时才需要进行转换触发方式,使得服务器不用转换全部的文档,减轻了服务器的压力;更进一步的,通过根据文档页面的访问浏览量和最近访问时间定时清理缓存的方式,提升了用户预览文档的速度。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示意性示出本公开示例性实方式中一种文档在线预览方法的流程图。
图2示意性示出本公开示例性实施方式中对预览内容进行转换的方法流程图。
图3示意性示出本公开示例性实方式中另一种文档在线预览方法的流程图。
图4示意性示出本公开示例性实施方式中一种文档在线预览装置的方框图。
图5示意性示出本公开示例性实施例中一种计算机可读存储介质示意图;
图6示意性示出本公开示例性实施例中一种电子设备示意图。
具体实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
本示例实施方式中首先提供了一种文档在线预览方法。参考图1中所示,所述文档在线预览方法可以包括以下步骤:
S110.根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在;
S120.如果查询到与所述主键关联的数据存在,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器;
S130.所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断;
S140.在判断所述键值浏览量的值不为零时,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;
S150.更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓存服务器中;
S160.所述应用服务器接收所述待预览内容以供用户预览。
本示例实施方式中的文档在线预览方法,一方面,采用文档分页转换预览的方式,减少了整个文档的转换所需时间;另一方面,通过采用缓存、队列转换的方式为用户提供需要预览的文档,提高了整体系统的性能,适合用户高并发访问预览;再一方面,通过在用户选择预览文档时才需要进行转换触发方式,使得服务器不用转换全部的文档,减轻了对服务器的压力。
更进一步的,通过根据文档页面的访问浏览量和最近访问时间定时清理缓存的方式,提升了用户预览文档的速度。
下面,将对本示例实施方式中上述文档在线预览方法的各步骤进行详细的说明。
在步骤S110中,根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在。
在本示例实施方式中,所述待预览内容可以包括用户所需要查看的某一个文档的某一页或者某几页;所述主键可以包括一个或者多个字段;所述待预览内容的主键可以包括文档编号和文档对应的页码;所述缓存服务器可以是用户判断用户所请求预览的文档和该文档当前页是否已经存在转换的服务器;举例而言:
在用户选择某一个文档并对该文档中的某一页进行预览时,首先向应用服务器发送请求;应用服务器接收用户请求,将该文档编号(例如可以是:JDZL00001)和该文档对应的页码(例如可以是:第一页)作为联合主键key(即key为:JDZL00001-1,简称主键),根据主键在缓存服务器上查找与主键关联的数据是否存在。此外,在本公开的其他示例性实施例中,也可以根据情况以其他方式进行查找,本示例性实施方式中对此不做特殊限定。
在步骤S120中,如果查询到与所述主键关联的数据,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器。
在本示例实施方式中,与所述主键关联的数据可以包括主键、键值浏览量以及访问时间等;所述键值浏览量可以用于表示待预览文档中某一页的浏览次数;所述访问时间可以包括最近一次的浏览时间;但本示例实施方式对与所述主键关联的数据不做特殊限制,在本公开的其他示例性实施例中,其也可以包括其他数据。
本示例实施方式中,在经过查询确定与所述主键关联的数据存在时,举例而言,首先应用服务器查询在所述缓存服务器中查询是否存在需要预览的文档以及该文档中的某一页对应的数据,如果应用服务器在缓存服务器中查询到需要预览的文档以及该文档中的某一页对 应的数据存在,则直接从缓存服务器中获取该文档以及该文档中的某一页和该页对应的数据,例如浏览量以及最近一次的浏览时间,然后将该数据发送给应用服务器。
在本示例的另外一种实施方式中,如果应用服务器在缓存服务器中查询到需要预览的文档以及该文档中的某一页对应的数据不存在,则从数据库中获取与所述主键关联的数据;以及如果所述数据库中存在与所述主键关联的数据,则可以将与所述主键关联的数据发送到所述缓存服务器;如果所述数据库中不存在与所述主键关联的数据,则在所述数据库中创建一与所述主键关联的数据初始值并发送到所述缓存服务器,所述数据初始值中键值浏览量为零,所述数据初始值中访问时间为当前访问时间。举例而言,如果应用服务器在缓存服务器中查询到需要预览的文档以及该文档中的某一页不存在,则从数据库中获取该文档以及该文档中对应的页码和该页的浏览量以及最近一次的浏览时间,然后发送给应用服务器;如果数据库中不存在该文档以及该文档中对应的页和该页的浏览量以及最近一次的浏览时间,则在数据库中创建该文档以及该文档中对应的页和该页的浏览量以及最近一次的浏览时间,然后发送给应用服务器;所述浏览量为零,所述浏览时间为当前时间。
在步骤S130中,所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断。
举例而言,应用服务器接收该文档以及该文档中对应的页和该页的浏览量以及最近一次的浏览时间后,对所述浏览量就行判断。
在步骤S140中,在判断所述键值浏览量的值不为零时,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;以及,更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓存服务器中。
在判断所述浏览量的值为零时,对预览内容进行转换,并将转换后的预览内容上传至所述云存储服务器;并且,在原有的浏览量的基础上加1,然后将更新后的浏览量存储在缓存服务器中。参考图2所示,本示例实施方式中,对预览内容进行转换可以包括下述步骤S202~S206。其中:
在步骤S202中,将所述主键写入需要转换的队列等待转换。
在步骤S204中,从所述队列中获取需要等待转换的主键并根据所述主键从所述云存储服务器获取待预览内容进行转换。举例而言:
本示例实施方式中,可以采用单线程或多线程的方式,从所述队列中获取需要等待转换的主键并根据所述主键从所述云存储服务器获取待预览内容进行转换,但本示例实施方式不以此为限。此外,在本公开的其他示例性实施例中,也可以根据情况以其他方式从队列中获取需要等待转换的主键,本示例性实施例中对此不做特殊限定。
其中,上述线程可以被理解为:轻量级进程(Lightweight Process,LWP),是程序执行流的最小单元;一个标准的线程由线程ID,当前指令指针(PC),寄存器集合和堆栈组成;队列可以被理解为:一种特殊的线性表,特殊之处在于它只允许在表的前端(front)进行删除操作,而在表的后端(rear)进行插入操作,和栈一样,队列是一种操作受限制的线性表,进行插入操作的端称为队尾,进行删除操作的端称为队头;但本示例实施方式不以此为限。
在本示例实施方式中,待预览内容转换以后生成的格式可以包括:.html、.doc、.docx、.xls、.xlsx、.ppt、.pptx、.txt或者是.pdf等等,但本示例实施方式不以此为限。
在步骤S206中,完成所述预览内容转换时,将所述缓存服务器中的键值浏览量修改为1,从而便于后续流程的进行。
此外,在本示例实施方式中,对所述预览内容进行转换时,还可以提供一用户等待标识;完成所述预览内容的转换时,取消所述用户等待标识;如果超过设定的超时时间,则提示转换失败,需要重新进行转换。通过采用用户等待标识,使得用户可以很明确的看出文档的具体转换情况,提高了用户体验。
在步骤S150中,所述应用服务器接收所述待预览内容以供用户预览。
举例而言,应用服务器在接收到该页的待预览内容以后,会将该页的待预览内容发送至终端,用户通过终端进行预览最终的结果。在本示例实施方式中,所述终端可以包括:手机、平板电脑、笔记本电脑、台式电脑、游戏机、PDA等各种具备显示屏幕的电子设备。
在另一些示例实施方式中,参考图3所示,所述文档在线预览方法还可以包括步骤S310以及步骤S320。其中:
在步骤S310中,定时删除所述缓存服务器中所述键值浏览量小于第一预设值的与所述主键关联的数据;在步骤S320中,定时删除所述缓存服务器中访问时间大于第二预设值的与所述主键关联的数据。详细而言:为了充分利用缓存服务器内存以及满足系统的高性能,用户浏览文档的页面内容需要尽可能的从缓存服务器中获得,因此,可以定时的从缓存服务器中将浏览量比较低的文档和页码删除;也可以定时的从缓存服务器中将访问时间距离现在比较久远的文档和页码删除;并将上述删除的文档和页码保存到数据库中;通过上述方式,同时保证了缓存在缓存服务器中的数据具有最大活性。
下述为本发明装置实施例,可以用于执行本发明方法实施例。对于本发明装置实施例中未披露的细节,请参照本发明方法实施例。
本示例实施方式中还提供了一种文档在线预览装置,参考图4中所示,所述文档在线预览装置可以包括:数据查询模块410、第一数据获取模块420、键值浏览量判断模块430、预览内容获取模块440、更新存储模块450以及预览内容接收模块460;其中:
数据查询模块410:用于根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在;
第一数据获取模块420:用于如果查询到与所述主键关联的数据存在,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器;
键值浏览量判断模块430:用于所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断;
预览内容获取模块440:用于在判断所述键值浏览量的值不为零时,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;以及,
更新存储模块450:用于更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓 存服务器中;
预览内容接收模块460:用于所述应用服务器接收所述待预览内容以供用户预览。
本公开的文档在线预览装置,采用文档分页转换预览的方式,减少了整个文档的转换所需时间;采用缓存、队列转换的方式为用户提供需要预览的文档,提高了整体系统的性能,适合用户高并发访问预览;采用在用户选择预览文档时才需要进行转换触发方式,使得服务器不用转换全部的文档,提搞了服务器性能的压力;采用根据文档页面的访问浏览量和最近访问时间定时清理缓存的方式,提升了用户浏览文档的速度。
在另一些实施例中,还包括:
第二数据获取模块:用于如果查询到与所述主键关联的数据不存在,则从数据库中获取与所述主键关联的数据;以及
第一数据发送模块:用于如果所述数据库中存在与所述主键关联的数据,则将与所述主键关联的数据发送到所述缓存服务器;
第二数据发送模块:如果所述数据库中不存在与所述主键关联的数据,则在所述数据库中创建一与所述主键关联的数据初始值并发送到所述缓存服务器,所述数据初始值中键值浏览量为零,所述数据初始值中访问时间为当前访问时间。
在另一些示例实施方式中,还包括:
预览内容转换模块:在判断所述键值浏览量的值为零时,对预览内容进行转换,并将转换后的预览内容上传至所述云存储服务器。
在本示例实施方式中,对预览内容进行转换包括:
将所述主键写入需要转换的队列等待转换;
从所述队列中获取需要等待转换的主键并根据所述主键从所述云存储服务器获取待预览的内容进行转换。
在本示例实施方式中,还包括:
完成所述预览内容转换时,将所述缓存服务器中的键值浏览量修改为1。
在本示例实施方式中,还包括:
对所述预览内容进行转换时,提供一用户等待标识;
完成所述预览内容的转换时,取消所述用户等待标识。
在本示例实施方式中,所述装置还包括:
第一数据删除模块:定时删除所述缓存服务器中所述键值浏览量小于第一预设值的与所述主键关联的数据;以及
第二数据删除模块:定时删除所述缓存服务器中访问时间大于第二预设值的与所述主键关联的数据。
上述文档在线预览装置中各模块的具体细节已经在对应的文档在线预览方法中进行了详细想描述,因此此处不再赘述。
本公开还提供一种电子设备,包括一个或多个处理器;存储器,用于存储一个或多个程;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上 所述的文档在线预览方法。
本公开还提供一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上所述的文档在线预览方法。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本公开的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
此外,尽管在附图中以特定顺序描述了本公开中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
在本公开的示例性实施例中,还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被例如处理器执行时可以实现上述任意一个实施例中所述电子处方流转处理方法的步骤。在一些可能的实施方式中,本发明的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在终端设备上运行时,所述程序代码用于使所述终端设备执行本说明书上述电子处方流转处理方法部分中描述的根据本发明各种示例性实施方式的步骤。
参考图5所示,描述了根据本发明的实施方式的用于实现上述方法的程序产品500,其可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
所述计算机可读存储介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读存储介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。可读存储介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程 序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
在本公开的示例性实施例中,还提供一种电子设备,该电子设备可以包括处理器,以及用于存储所述处理器的可执行指令的存储器。其中,所述处理器配置为经由执行所述可执行指令来执行上述任意一个实施例中所述电子处方流转处理方法的步骤。
所属技术领域的技术人员能够理解,本发明的各个方面可以实现为系统、方法或程序产品。因此,本发明的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。
下面参照图6来描述根据本发明的这种实施方式的电子设备600。图9显示的电子设备600仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。
如图6所示,电子设备600以通用计算设备的形式表现。电子设备600的组件可以包括但不限于:至少一个处理单元610、至少一个存储单元620、连接不同系统组件(包括存储单元620和处理单元610)的总线630、显示单元640等。
其中,所述存储单元存储有程序代码,所述程序代码可以被所述处理单元610执行,使得所述处理单元610执行本说明书上述电子处方流转处理方法部分中描述的根据本发明各种示例性实施方式的步骤。例如,所述处理单元610可以执行如图1中所示的步骤。
所述存储单元620可以包括易失性存储单元形式的可读介质,例如随机存取存储单元(RAM)6201和/或高速缓存存储单元6202,还可以进一步包括只读存储单元(ROM)6203。
所述存储单元620还可以包括具有一组(至少一个)程序模块6205的程序/实用工具6204,这样的程序模块6205包括但不限于:操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。
总线630可以为表示几类总线结构中的一种或多种,包括存储单元总线或者存储单元控制器、外围总线、图形加速端口、处理单元或者使用多种总线结构中的任意总线结构的局域总线。
电子设备600也可以与一个或多个外部设备700(例如键盘、指向设备、蓝牙设备等)通信,还可与一个或者多个使得用户能与该电子设备600交互的设备通信,和/或与使得该电子设备600能与一个或多个其它计算设备进行通信的任何设备(例如路由器、调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口650进行。并且,电子设备600还可以通过网络适配器660与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。网络适配器660可以通过总线630与电子设备600的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备600使用其它硬件和/或软件模块,包 括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本公开实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者网络设备等)执行根据本公开实施方式的方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由所附的权利要求指出。
工业实用性
本公开适用于互联网技术领域,用以解决现有技术中文档转换服务器压力大的问题;不仅减少了文档转换时间,还减轻了服务器的压力,提升了用户预览文档的速度。

Claims (16)

  1. 一种文档在线预览方法,其特征在于,包括:
    根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在;
    如果查询到与所述主键关联的数据,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器;
    所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断;
    如果所述键值浏览量的值不为零,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;以及
    所述应用服务器接收所述待预览内容以供用户预览。
  2. 根据权利要求1所述的文档在线预览方法,其特征在于,还包括:
    如果查询确定与所述主键关联的数据不存在,则从数据库中获取与所述主键关联的数据;以及
    如果所述数据库中存在与所述主键关联的数据,则将与所述主键关联的数据发送到所述缓存服务器;
    如果所述数据库中不存在与所述主键关联的数据,则在所述数据库中创建一与所述主键关联的数据初始值并发送到所述缓存服务器,所述数据初始值中键值浏览量为零,所述数据初始值中访问时间为当前访问时间。
  3. 根据权利要求1所述的文档在线预览方法,其特征在于,还包括:
    如果所述键值浏览量的值为零,对预览内容进行转换,并将转换后的预览内容上传至所述云存储服务器。
  4. 根据权利要求3所述的文档在线预览方法,其特征在于,对预览内容进行转换包括:
    将所述主键写入需要转换的队列等待转换;
    从所述队列中获取需要等待转换的主键并根据所述主键从所述云存储服务器获取待预览内容进行转换。
  5. 根据权利要求3或4所述的文档在线预览方法,其特征在于,还包括:
    完成所述预览内容转换时,将所述缓存服务器中的键值浏览量修改为1。
  6. 根据权利要求3或4所述的文档在线预览方法,其特征在于,还包括:
    对所述预览内容进行转换时,提供一用户等待标识;
    完成所述预览内容的转换时,取消所述用户等待标识。
  7. 根据权利要求1所述的文档在线预览方法,其特征在于,所述方法还包括:
    更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓存服务器中;
    和/或
    定时删除所述缓存服务器中所述键值浏览量小于第一预设值的与所述主键关联的数据;以及
    定时删除所述缓存服务器中访问时间大于第二预设值的与所述主键关联的数据。
  8. 一种文档在线预览装置,其特征在于,包括:
    数据查询模块:用于根据待预览内容的主键在缓存服务器中查询与所述主键关联的数据是否存在;
    第一数据获取模块:用于如果查询到与所述主键关联的数据存在,则从所述缓存服务器中获取与所述主键关联的数据,并将与所述主键关联的数据发送给应用服务器;
    键值浏览量判断模块:用于所述应用服务器接收与所述主键关联的数据后,对与所述主键关联的数据中包含的所述主键的键值浏览量进行判断;
    预览内容获取模块:用于在判断所述键值浏览量的值不为零时,根据所述主键从云存储服务器获取待预览内容并提供至应用服务器;以及
    预览内容接收模块:用于所述应用服务器接收所述待预览内容以供用户预览。
  9. 根据权利要求8所述的文档在线预览装置,其特征在于,还包括:
    第二数据获取模块:用于如果查询到与所述主键关联的数据不存在,则从数据库中获取与所述主键关联的数据;以及
    第一数据发送模块:用于如果所述数据库中存在与所述主键关联的数据,则将与所述主键关联的数据发送到所述缓存服务器;
    第二数据发送模块:如果所述数据库中不存在与所述主键关联的数据,则在所述数据库中创建一与所述主键关联的数据初始值并发送到所述缓存服务器,所述数据初始值中键值浏览量为零,所述数据初始值中访问时间为当前访问时间。
  10. 根据权利要求8所述的文档在线预览装置,其特征在于,还包括:
    预览内容转换模块,用于在判断所述键值浏览量的值为零时,对预览内容进行转换,并将转换后的预览内容上传至所述云存储服务器。
  11. 根据权利要求10所述的文档在线预览装置,其特征在于,所述预览内容转换模块用于在判断所述键值浏览量的值为零时将所述主键写入需要转换的队列等待转换,从所述队列中获取需要等待转换的主键并根据所述主键从所述云存储服务器获取待预览的内容进行转换,并将转换后的预览内容上传至所述云存储服务器。
  12. 根据权利要求10或11所述的文档在线预览装置,其特征在于,所述预览内容转换模块还用于完成所述预览内容转换时,将所述缓存服务器中的键值浏览量修改为1。
  13. 根据权利要求10或11所述的文档在线预览装置,其特征在于,所述预览内容转换模块还用于对所述预览内容进行转换时,提供一用户等待标识;完成所述预览内容的转换时,取消所述用户等待标识。
  14. 根据权利要求8所述的文档在线预览装置,其特征在于,所述装置还包括:
    更新存储模块:用于更新所述键值浏览量,并将更新后的键值浏览量存储在所述缓存 服务器中;
    和/或
    第一数据删除模块:定时删除所述缓存服务器中所述键值浏览量小于第一预设值的与所述主键关联的数据;以及
    第二数据删除模块:定时删除所述缓存服务器中访问时间大于第二预设值的与所述主键关联的数据。
  15. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器,用于存储一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一所述的文档在线预览方法。
  16. 一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1-7中任一所述的文档在线预览方法。
PCT/CN2017/107730 2016-11-22 2017-10-26 文档在线预览方法及装置 Ceased WO2018095187A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
RU2019113516A RU2729053C1 (ru) 2016-11-22 2017-10-26 Способ и устройство для онлайн-предпросмотра документа
US16/349,329 US11256773B2 (en) 2016-11-22 2017-10-26 Document online preview method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201611036737.4 2016-11-22
CN201611036737.4A CN108090078B (zh) 2016-11-22 2016-11-22 文档在线预览方法及装置、存储介质、电子设备

Publications (1)

Publication Number Publication Date
WO2018095187A1 true WO2018095187A1 (zh) 2018-05-31

Family

ID=62168619

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/107730 Ceased WO2018095187A1 (zh) 2016-11-22 2017-10-26 文档在线预览方法及装置

Country Status (4)

Country Link
US (1) US11256773B2 (zh)
CN (1) CN108090078B (zh)
RU (1) RU2729053C1 (zh)
WO (1) WO2018095187A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779028A (zh) * 2021-08-31 2021-12-10 珠海市新德汇信息技术有限公司 融合主键索引基因的入库方法、查询方法、电子设备及存储介质
CN114844947A (zh) * 2022-04-29 2022-08-02 北京达佳互联信息技术有限公司 请求的处理方法、装置、电子设备及计算机可读介质
CN116861847A (zh) * 2023-06-21 2023-10-10 三峡高科信息技术有限责任公司 一种Office文件在线预览的方法及系统

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109657211A (zh) * 2018-12-11 2019-04-19 万兴科技股份有限公司 在线格式转换的方法、装置及智能终端
CN109828984B (zh) * 2019-01-11 2021-06-08 北京明略软件系统有限公司 一种分析处理的方法、装置、计算机存储介质及终端
CN110674082B (zh) * 2019-09-24 2023-03-14 北京字节跳动网络技术有限公司 移除在线文档的方法、装置、电子设备及计算机可读介质
CN111191418B (zh) * 2019-12-06 2024-01-12 腾讯科技(深圳)有限公司 在线文档处理方法、装置、电子设备及计算机存储介质
US20220391418A1 (en) * 2021-06-08 2022-12-08 Kyndryl, Inc. Operating a storage server with a storage volume
CN116166619B (zh) * 2021-11-25 2026-02-03 中移(苏州)软件技术有限公司 一种文件预览方法、装置、设备以及计算机存储介质
CN116226053B (zh) * 2023-05-05 2024-03-22 中国民航信息网络股份有限公司 一种文本处理方法、装置及设备
CN121562546B (zh) * 2026-01-21 2026-03-31 苏州元脑智能科技有限公司 一种文档预览方法及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184177A (zh) * 2011-01-04 2011-09-14 北京开心人信息技术有限公司 一种预览文件的方法与系统
CN102508892A (zh) * 2011-10-25 2012-06-20 深圳市万兴软件有限公司 一种快速图片预览系统和方法
CN103136208A (zh) * 2011-11-23 2013-06-05 腾讯科技(深圳)有限公司 一种显示图片的方法及装置
CN103714146A (zh) * 2013-12-26 2014-04-09 华为技术有限公司 存储方法及装置
US20150052178A1 (en) * 2012-05-24 2015-02-19 Huizhiu Tcl Mobile Communication Co., Ltd. Method and system for previewing file information

Family Cites Families (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7146416B1 (en) * 2000-09-01 2006-12-05 Yahoo! Inc. Web site activity monitoring system with tracking by categories and terms
US7139779B1 (en) * 2003-05-29 2006-11-21 Microsoft Corporation Method and system for developing extract transform load systems for data warehouses
US7469380B2 (en) * 2004-06-15 2008-12-23 Microsoft Corporation Dynamic document and template previews
US7558822B2 (en) 2004-06-30 2009-07-07 Google Inc. Accelerating user interfaces by predicting user actions
US7899833B2 (en) * 2004-11-02 2011-03-01 Ab Initio Technology Llc Managing related data objects
US9141713B1 (en) * 2005-12-30 2015-09-22 Amazon Technologies, Inc. System and method for associating keywords with a web page
US8065275B2 (en) 2007-02-15 2011-11-22 Google Inc. Systems and methods for cache optimization
US7702633B2 (en) * 2007-03-05 2010-04-20 Microsoft Corporation Previews providing viewable regions for protected electronic documents
US8260687B2 (en) * 2007-04-16 2012-09-04 Ebay Inc. Distributed commerce application-widget
JP5444477B2 (ja) 2009-12-16 2014-03-19 テレフオンアクチーボラゲット エル エム エリクソン(パブル) キャッシングのための方法、サーバ、コンピュータプログラム及びコンピュータプログラム製品
US20110173569A1 (en) * 2010-01-13 2011-07-14 Rockmelt, Inc. Preview Functionality for Increased Browsing Speed
US8452806B2 (en) * 2010-10-26 2013-05-28 Cbs Interactive Inc. Automatic catalog search preview
CN102033917A (zh) 2010-12-09 2011-04-27 广州市动景计算机科技有限公司 移动终端的网页浏览方法及应用该方法的移动终端
US20130144712A1 (en) * 2011-06-07 2013-06-06 Fernando Ruarte Systems and methods for group delivery, group counting and group pacing of ad delivery on the world wide web
WO2013189038A1 (zh) * 2012-06-20 2013-12-27 华为技术有限公司 内容处理的方法和网络侧设备
US20140089135A1 (en) * 2012-09-27 2014-03-27 Bonfire Holdings, Inc. System and method for enabling a real time shared shopping experience
US10095663B2 (en) * 2012-11-14 2018-10-09 Amazon Technologies, Inc. Delivery and display of page previews during page retrieval events
US9501549B1 (en) * 2014-04-28 2016-11-22 Google Inc. Scoring criteria for a content item
CN104572870B (zh) * 2014-12-22 2018-04-20 北京京东尚科信息技术有限公司 提供文档在线阅读的方法和装置以及系统
CN104573025B (zh) 2015-01-12 2018-09-04 北京京东尚科信息技术有限公司 一种提高页面加载速度的方法及系统
CN104615391A (zh) * 2015-02-03 2015-05-13 九玉(北京)科技有限公司 一种文件预览方法、装置及系统
CN104915454A (zh) * 2015-07-01 2015-09-16 北京京东尚科信息技术有限公司 一种文件预览系统及方法
CN105183393A (zh) * 2015-09-21 2015-12-23 上海维宏电子科技股份有限公司 基于磁盘缓存实现文件快速预览的方法
CN105975601A (zh) * 2016-05-11 2016-09-28 无锡永中软件有限公司 网页文档在线预览的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184177A (zh) * 2011-01-04 2011-09-14 北京开心人信息技术有限公司 一种预览文件的方法与系统
CN102508892A (zh) * 2011-10-25 2012-06-20 深圳市万兴软件有限公司 一种快速图片预览系统和方法
CN103136208A (zh) * 2011-11-23 2013-06-05 腾讯科技(深圳)有限公司 一种显示图片的方法及装置
US20150052178A1 (en) * 2012-05-24 2015-02-19 Huizhiu Tcl Mobile Communication Co., Ltd. Method and system for previewing file information
CN103714146A (zh) * 2013-12-26 2014-04-09 华为技术有限公司 存储方法及装置

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113779028A (zh) * 2021-08-31 2021-12-10 珠海市新德汇信息技术有限公司 融合主键索引基因的入库方法、查询方法、电子设备及存储介质
CN114844947A (zh) * 2022-04-29 2022-08-02 北京达佳互联信息技术有限公司 请求的处理方法、装置、电子设备及计算机可读介质
CN114844947B (zh) * 2022-04-29 2024-03-26 北京达佳互联信息技术有限公司 请求的处理方法、装置、电子设备及计算机可读介质
CN116861847A (zh) * 2023-06-21 2023-10-10 三峡高科信息技术有限责任公司 一种Office文件在线预览的方法及系统
CN116861847B (zh) * 2023-06-21 2024-02-13 三峡高科信息技术有限责任公司 一种Office文件在线预览的方法及系统

Also Published As

Publication number Publication date
RU2729053C1 (ru) 2020-08-04
CN108090078B (zh) 2021-11-30
US20190347307A1 (en) 2019-11-14
US11256773B2 (en) 2022-02-22
CN108090078A (zh) 2018-05-29

Similar Documents

Publication Publication Date Title
WO2018095187A1 (zh) 文档在线预览方法及装置
US10803016B2 (en) Predictive models of file access patterns by application and file type
KR102097300B1 (ko) 클라우드-기반 파일 시스템 내에서의 파일 핸들링
US10043220B2 (en) Method, device and storage medium for data processing
CN107273392B (zh) 用于搜索图像的计算机实现方法、装置及数据处理系统
US11392545B1 (en) Tracking access pattern of inodes and pre-fetching inodes
CN111831618A (zh) 数据写入方法、数据读取方法、装置、设备及存储介质
CN106484691B (zh) 移动终端的数据存储方法和装置
CN110352410B (zh) 跟踪索引节点的访问模式以及预提取索引节点
US10235293B2 (en) Tracking access pattern of inodes and pre-fetching inodes
US20200137141A1 (en) Offloading upload processing of a file in a distributed system using a key that includes a hash created using attribute(s) of a requestor and/or the file
CN109815194B (zh) 索引方法、索引装置、计算机可读存储介质及电子设备
CN110110184A (zh) 信息查询方法、系统、计算机系统及存储介质
CN110109912A (zh) 一种标识符生成方法和装置
CN113051244B (zh) 数据访问方法和装置、数据获取方法和装置
CN115587090A (zh) 一种基于Doris的数据存储方法、装置、设备及介质
US10616291B2 (en) Response caching
CN110020373A (zh) 静态页面存储、浏览的方法和装置
CN113127416B (zh) 数据查询方法和装置
US9529812B1 (en) Timestamp handling for partitioned directories
CN115374078A (zh) 一种数据存储与读取系统及其工作方法
US20150134676A1 (en) Amorphous data query formulation
CN114896206B (zh) 一种对象存储文件系统的检索方法和装置
CN106326340B (zh) 一种数据处理方法及装置
CN111309800A (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: 17872941

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2019113516

Country of ref document: RU

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 06.09.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17872941

Country of ref document: EP

Kind code of ref document: A1