WO2018032698A1 - 一种翻页方法、装置及书写终端 - Google Patents

一种翻页方法、装置及书写终端 Download PDF

Info

Publication number
WO2018032698A1
WO2018032698A1 PCT/CN2016/113340 CN2016113340W WO2018032698A1 WO 2018032698 A1 WO2018032698 A1 WO 2018032698A1 CN 2016113340 W CN2016113340 W CN 2016113340W WO 2018032698 A1 WO2018032698 A1 WO 2018032698A1
Authority
WO
WIPO (PCT)
Prior art keywords
page
object data
serialized
current memory
jump
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/CN2016/113340
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.)
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shirui Electronics 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 Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shirui Electronics Co Ltd
Publication of WO2018032698A1 publication Critical patent/WO2018032698A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/041Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0661Format or protocol conversion arrangements
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs

Definitions

  • the present invention relates to the field of writing software, and in particular, to a page turning method, device and writing terminal.
  • each writing stroke is stored as an object in the memory.
  • This object of writing the handwriting includes a plurality of objects constituting the point of the handwriting, the number of points and the handwriting. The length is positively correlated, and the longer the handwriting, the more points; at the same time, the generation of the handwriting points is related to the touch event. The slower the writing, the more touch events are generated, and the more points that constitute the handwriting.
  • write a stroke of a word that will contain at least 50 points and will produce 50 point objects in memory.
  • the system has an automatic garbage collection mechanism. This is a feature that inherits from the Java language.
  • system resources system memory
  • the system automatically reclaims resources that are no longer used.
  • recycling the system temporarily stops the application running until the recycling is completed, which will cause the application to be stuck.
  • the system needs to traverse the objects in memory, so the more objects stored in the memory, the more objects that need to be traversed when a garbage collection occurs, the longer the recovery time, the resulting The more obvious. Therefore, when the whiteboard writing content is more and more, the application will become more and more stuck. Even if the user newly adds a page and writes on the new page, since the previous object still exists in the memory, there will still be obvious. Caton affects the user experience.
  • an object of the present invention is to provide a page turning method, apparatus, and writing terminal that can avoid the problem of stuttering due to garbage collection during continuous writing.
  • the invention provides a page turning method, comprising the following steps:
  • the serializing processing the predetermined object data currently stored in the memory is specifically:
  • the serializing processing the predetermined object data currently stored in the memory is specifically:
  • the first threshold is generated according to an average number of object data of each page and a maximum number of object data that can be tolerated by the current memory.
  • the serializing processing the predetermined object data currently stored in the memory is specifically:
  • the invention also provides a page turning device comprising:
  • a page turning listening unit configured to monitor a page turning instruction sent by the user to jump from the currently open page to the target page
  • a serialization unit configured to serialize predetermined object data stored in the current memory
  • a deserialization unit configured to deserialize the serialized data into object data after querying the serialized data corresponding to the target page, and draw the object data to display the target page .
  • the serialization unit is configured to acquire object data corresponding to the currently open page stored in the current memory, and serialize the object data corresponding to the currently open page into serialized data.
  • the serializing unit specifically includes:
  • a page number obtaining module configured to acquire all object data stored in the current memory and a page corresponding to each object data, to obtain a number of pages that are not serialized
  • a first determining module configured to determine whether the number of the pages that are not serialized is greater than a preset first threshold; if yes, notify the first serialization sub-module; if not, notify the jump unit;
  • the first serialization submodule is configured to serialize object data corresponding to the page with the earliest storage time into serialized data.
  • the serializing unit specifically includes:
  • An object obtaining module configured to acquire all object data stored in the current memory and a page corresponding to each object data
  • a second determining module configured to determine whether the quantity of all object data stored in the current memory is greater than a preset second threshold; if yes, notify the second serialization sub-module; if not, notify the jump unit ;
  • the second serialization submodule is configured to serialize object data corresponding to the page with the earliest storage time into serialized data.
  • the present invention also provides a writing terminal comprising the above-described page turning device.
  • the page turning method, device and writing terminal provided by the invention reduce the predetermined object data into serialized data by serializing the predetermined object data stored in the current memory during page turning, thereby reducing the The amount of object data stored in memory, which shortens the time required to traverse the object during garbage collection, and avoids the obvious stuck of the application due to too many objects traversed.
  • the invention can improve the flow of writing and improve the user experience.
  • FIG. 1 is a schematic flow chart of a page turning method according to an embodiment of the present invention.
  • FIG. 2 is another schematic flowchart of a page turning method according to an embodiment of the present invention.
  • FIG. 3 is another schematic flowchart of a page turning method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a page turning device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural view of the serialization unit of FIG. 4.
  • Figure 6 is a schematic diagram showing the structure of the serialization unit of Figure 4.
  • an embodiment of the present invention provides a page turning method for performing page turning control on writing software in a writing terminal (such as an electronic whiteboard) having a writing function, in particular, writing software based on an Android platform, at least Including the following steps:
  • the page turning operation when the user writes using the electronic whiteboard or other writing terminal, the page turning operation is performed, and when the user performs the page turning operation, the corresponding page turning instruction is generated.
  • the page turning instruction may include an instruction to scroll forward from the currently open page, an instruction to scroll backward from the currently open page, and an instruction to jump forward from the currently open page to the specified page. And an instruction to jump backward from the currently open page to the specified page.
  • a new page is generated when an instruction to page backward is executed.
  • the new page is a blank page or a page generated according to a predetermined template. Before the new page is generated, in order to prevent the phenomenon that the card is stuck or not smooth when editing on the newly created page, the predetermined object data stored in the current memory needs to be serialized.
  • the object data corresponding to the currently open page may be serialized, so that the object data is serialized into serialized data of a common data type, and the serialized data is serialized data. It is saved in memory or in a file. Since these serialized data are not object data, the system does not need to traverse these serialized data during garbage collection, so the traversal time required for garbage collection can be significantly reduced, thereby avoiding obvious stagnation during garbage collection or The problem of waiting for a long time.
  • the user needs to jump to the 12th page to continue writing and editing after completing the writing and editing of the 11th page.
  • the edited page if it is, generates a new page and serializes all object data on page 11 into serialized data. After serialization, it jumps and generates a new page 12.
  • the user needs to jump to the previous page when editing or reading the content of the 11th page, such as page 10 (which may also be the page after the 11th page, But to ensure that the following page is not a new page) to refer to the content on page 10, then, at this time, the object data corresponding to the 11th page is serialized into serialized data; then jump to page 10, and After deserializing the serialized data corresponding to page 10 into object data, The object data is converted into a corresponding handwriting, and the handwriting is drawn on a display screen to display the target page.
  • page 10 which may also be the page after the 11th page, But to ensure that the following page is not a new page
  • the page turning method provided by the embodiment of the present invention reduces the in-memory data of the currently open page by serializing the currently opened page when the page is turned.
  • the amount of object data stored which in turn reduces the time required to traverse objects during garbage collection, avoiding the appearance of significant stagnation or long waits.
  • the embodiment of the invention can improve the flow of writing and improve the user experience.
  • step S102 of the above embodiment if the current open page is serialized each time the target page is jumped, when the user needs to return from the target page to the currently open page for data reference (specially, if If the target page is a new page, since it is generally necessary to refer to the content of the previous page when editing the new page, it may be more frequent to return to the currently open page for data reference. It is also necessary to serialize the target page first. And deserializing the currently open page to display the currently open page normally. Since serialization and deserialization take time, this can cause additional waiting time for the user.
  • step S102 is specifically:
  • S1021 Acquire all object data stored in the current memory and a page corresponding to each object data to obtain a number of pages that are not serialized.
  • the serialization of the currently open page is not performed every time the page turning instruction is executed, but a certain number of pages are not serialized, wherein the pages are newly stored to
  • the page in memory can also be understood as the object data in the page that the user has operated in the most recent time is not serialized first, so that the user can turn the page back and forth.
  • the first threshold is 2
  • the user needs to jump to the 12th page (new page) to continue editing after completing the editing of the 11th page.
  • First get all the object data stored in the current memory and the page corresponding to each object data, assuming that the object data in page 9, page 10 and page 11 has not been serialized (and assume that these 3 pages are in The storage time in memory is in order of page 9, page 10, 11), that is, the object data of 3 pages is not serialized. Since 3 is larger than the first threshold 2, when jumping to the 12th page, it is necessary to correspond to the page with the earliest storage time (page 9).
  • the object data is serialized into serialized data.
  • the first threshold is generated according to an average number of object data of each page and a maximum number of object data that can be tolerated by the current memory, so that too many pages are avoided.
  • the problem of writing stuck and not flowing caused by serialization For example, assuming that the average number of object data per page is 1000, and the number of maximum object data that can be tolerated by the current memory is 5000, the first threshold is preferably an integer of 4 or less. In this way, the problem of re-serialization and repeated deserialization caused by frequent page turning is solved, and writing and use are smoothed.
  • Step S102 is specifically:
  • S1025 Determine whether the quantity of the object data stored in the current memory is greater than a preset second threshold; if yes, execute S1026; if not, execute S103.
  • the object data corresponding to the page with the earliest storage time is serialized into serialized data.
  • the preferred embodiment it is determined whether the number of object data currently stored in the memory is greater than a preset second threshold. That is, the serialization of the currently open page is not necessarily performed every time the page turning instruction is executed, but a certain amount of object data is not serialized, wherein the object data is the latest object stored in the memory. data. It can also be understood that the object data in the page that the user has operated recently has not been serialized first, so that the user can view it.
  • the second threshold is 5000
  • the user needs to jump to the 12th page (new page) to continue editing after completing the editing of the 11th page.
  • an embodiment of the present invention further provides a page turning device 100, including:
  • the page turning monitoring unit 10 is configured to monitor a page turning instruction issued by the user to jump from the currently open page to the target page.
  • the serializing unit 20 is configured to serialize predetermined object data stored in the current memory.
  • the serialization unit 20 is specifically configured to acquire object data corresponding to the currently open page stored in the current memory, and serialize the object data corresponding to the currently open page into serialized data.
  • the jump unit 30 is configured to jump to the target page.
  • the deserialization unit 40 is configured to, after querying the serialized data corresponding to the target page, deserialize the serialized data into object data, and draw the object data to display the target page.
  • the page turning device 100 provided by the embodiment of the present invention serializes the currently open page by the serialization unit 20 when the page is turned over, so that the object data of the currently opened page is converted into serialized data, thereby reducing The amount of object data stored in memory, which shortens the time required to traverse objects in garbage collection, and avoids the appearance of obvious stagnation.
  • the embodiment of the invention can improve the flow of writing and improve the user experience.
  • the serialization unit 20 specifically includes:
  • the page number obtaining module 21 is configured to acquire all object data stored in the current memory and a page corresponding to each object data.
  • the first determining module 22 is configured to determine whether the number of pages in the current memory in which the object data is stored is greater than a preset first threshold; if yes, notify the first serialization sub-module 23; if not, notify the Jump unit 30.
  • the first serialization sub-module 23 is configured to serialize object data corresponding to the page with the earliest storage time into serialized data.
  • the preferred embodiment can solve the problem of repeated serialization and repeated deserialization caused by frequent page turning under the premise of ensuring smooth use, reducing the waiting time of the user and improving the user experience.
  • the serialization unit 20 specifically includes:
  • the object obtaining module 24 is configured to acquire all object data stored in the current memory and a page corresponding to each object data.
  • the second determining module 25 is configured to determine whether the quantity of all the object data stored in the current memory is greater than a preset second threshold; if yes, notify the second serialization sub-module 26; if not, notify the hop Turn unit 30.
  • the second serialization sub-module 26 is configured to serialize object data corresponding to the page with the earliest storage time into serialized data.
  • the preferred embodiment can solve the problem of repeated serialization and repeated deserialization caused by frequent page turning under the premise of ensuring smooth use, reducing the waiting time of the user and improving the user experience.
  • the embodiment of the invention further provides a writing terminal, which comprises the page turning device 100 according to any of the above embodiments.
  • the writing terminal is an electronic whiteboard.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种翻页方法、翻页装置及书写终端,该方法包括如下步骤:监听用户发出的从当前打开页面跳转到目标页面的翻页指令(S101);对当前内存中存储的预定的对象数据进行序列化处理(S102);跳转到所述目标页面(S103);当查询到与所述目标页面对应的序列化数据后,将所述序列化数据反序列化为对象数据,并对所述对象数据进行绘制,以显示所述目标页面(S104)。可以避免在回收垃圾而造成的卡顿和书写不流畅的问题。

Description

一种翻页方法、装置及书写终端 技术领域
本发明涉及书写软件领域,尤其涉及一种翻页方法、装置及书写终端。
背景技术
在白板软件或其他书写软件中,每一笔书写笔迹被当作一个对象存储在内存中,这一个书写笔迹的对象又包括很多个构成这个笔迹的点的对象,点对象的个数与笔迹的长度成正相关,笔迹越长,点越多;同时笔迹点的生成与触摸事件相关,书写越慢,产生的触摸事件越多,构成这个笔迹的点也就越多。通常来说,写一个字的一个笔划,这个笔划至少会包含50个点,也就会在内存中产生50个点对象。
在Android平台上,系统有自动垃圾回收机制,这是继承自Java语言的特性,当系统资源(系统内存)不够时,系统会自动回收那些不再使用的资源。在进行回收时,系统会暂时停止应用的运行,直到回收完成,这个过程会对应用造成卡顿。
由于在回收时,系统需要对内存中的对象进行遍历,这样当存储在内存中的对象越多,发生一次垃圾回收时需要遍历的对象越多,回收的时间越长,造成的卡顿也就越明显。因此当白板书写内容越来越多时,应用就会变得越来越卡,即使用户新添加一页,在新页面上书写时,由于之前的对象仍然存在于内存之中,仍然会有明显的卡顿,影响了用户的使用体验。
发明内容
针对上述问题,本发明的目的在于提供一种翻页方法、装置及书写终端,可避免在连续书写时,由于回收垃圾而造成的卡顿的问题。
本发明提供了一种翻页方法,包括如下步骤:
监听用户发出的从当前打开页面跳转到目标页面的翻页指令;
对当前内存中存储的预定的对象数据进行序列化处理;
跳转到所述目标页面;
当查询到与所述目标页面对应的序列化数据后,将所述序列化数据反序列化为对象数据, 并对所述对象数据进行绘制,以显示所述目标页面。
优选地,所述对当前内存中存储的预定的对象数据进行序列化处理,具体为:
获取当前内存中存储的与所述当前打开页面对应的对象数据,并将与所述当前打开页面对应的对象数据序列化为序列化数据。
优选地,所述对当前内存中存储的预定的对象数据进行序列化处理,具体为:
获取当前内存中存储的所有对象数据及与每个对象数据对应的页面,以获得未被序列化的页面的数量;
判断所述未被序列化的页面的数量是否大于预设的第一阈值;
若是,则将与存储时间最早的页面对应的对象数据序列化为序列化数据;
若否,则执行步骤:跳转到所述目标页面。
优选地,所述第一阈值根据每个页面的对象数据的平均个数及当前内存可容忍的最大对象数据的个数生成。
优选地,所述对当前内存中存储的预定的对象数据进行序列化处理,具体为:
获取当前内存中存储的所有对象数据及与每个对象数据对应的页面;
判断所述当前内存中存储的所有对象数据的数量是否大于预设的第二阈值;
若是,则将与存储时间最早的页面对应的对象数据序列化为序列化数据;
若否,则执行步骤:跳转到所述目标页面。
本发明还提供一种翻页装置,包括:
翻页监听单元,用于监听用户发出的从当前打开页面跳转到目标页面的翻页指令;
序列化单元,用于对当前内存中存储的预定的对象数据进行序列化处理;
跳转单元,用于跳转到所述目标页面;
反序列化单元,用于当查询到与所述目标页面对应的序列化数据后,将所述序列化数据反序列化为对象数据,并对所述对象数据进行绘制,以显示所述目标页面。
优选地,所述序列化单元具体用于,获取当前内存中存储的与所述当前打开页面对应的对象数据,并将与所述当前打开页面对应的对象数据序列化为序列化数据。
优选地,所述序列化单元具体包括:
页面数量获取模块,用于获取当前内存中存储的所有对象数据及与每个对象数据对应的页面,以获得未被序列化的页面的数量;
第一判断模块,用于判断所述未被序列化的页面的数量是否大于预设的第一阈值;若是,则通知第一序列化子模块;若否,则通知所述跳转单元;
所述第一序列化子模块,用于将与存储时间最早的页面对应的对象数据序列化为序列化数据。
优选地,所述序列化单元具体包括:
对象获取模块,用于获取当前内存中存储的所有对象数据及与每个对象数据对应的页面;
第二判断模块,用于判断所述当前内存中存储的所有对象数据的数量是否大于预设的第二阈值;若是,则通知第二序列化子模块;若否,则通知所述跳转单元;
所述第二序列化子模块,用于将与存储时间最早的页面对应的对象数据序列化为序列化数据。
本发明还提供一种书写终端,包括上述的翻页装置。
本发明提供的翻页方法、装置及书写终端,通过在翻页时,对当前内存中存储的预定的对象数据进行序列化处理,使得所述预定的对象数据转化为序列化数据,从而减少了内存中存储的对象数据的数量,进而缩短了在垃圾回收时遍历对象所需的时间,避免了由于遍历的对象过多而导致的应用出现明显卡顿的现象。本发明可提高书写的流程性,提高用户的使用体验。
附图说明
为了更清楚地说明本发明的技术方案,下面将对实施方式中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本发明实施例提供的翻页方法的一种流程示意图。
图2是本发明实施例提供的翻页方法的另一种流程示意图。
图3是本发明实施例提供的翻页方法的另一种流程示意图。
图4是本发明实施例提供的翻页装置的结构示意图。
图5是图4的序列化单元的一种结构示意图。
图6是图4的序列化单元的一种结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
请参阅图1,本发明实施例提供一种翻页方法,用于对具有书写功能的书写终端(如电子白板)中的书写软件,特别是基于安卓平台的书写软件进行翻页控制,其至少包括如下步骤:
S101,监听用户发出的从当前打开页面跳转到目标页面的翻页指令。
S102,对当前内存中存储的预定的对象数据进行序列化处理。
S103,跳转到所述目标页面。
S104,当查询到与所述目标页面对应的序列化数据后,将所述序列化数据反序列化为对象数据,并对所述对象数据进行绘制,以显示所述目标页面。
具体地,在本发明实施例中,用户在使用电子白板或其他的书写终端进行书写时,会进行翻页操作,当用户执行翻页操作时,即生成相应的翻页指令。其中,所述翻页指令可包括从当前打开页面向前翻一页的指令,从所述当前打开页面向后翻一页的指令,从所述当前打开页面向前跳转到指定页面的指令及从所述当前打开页面向后跳转到指定页面的指令。若所述当前打开页面为最后一张被编辑的页面,则在执行向后翻一页的指令时,会生成一个新建页面。其中,一般的,新建页面为一张空白的页面或者是按照预定的模板生成的页面。在生成所述新建页面前,为了防止在所述新建页面上编辑时出现卡顿或不流畅的现象,需对当前内存中存储的预定的对象数据进行序列化处理。
在本发明实施例中,在翻页时,可先对与所述当前打开页面对应的对象数据进行序列化处理,使得所述对象数据序列化为普通数据类型的序列化数据,这些序列化数据被保存在内存中或者文件中。由于这些序列化数据不是对象数据,在进行垃圾回收时,系统不需要对这些序列化数据进行遍历,因此可明显减少垃圾回收所需的遍历时间,进而避免了在垃圾回收时出现明显卡顿或长时间等待的问题。
为了便于对本实施例的理解,下面将以一些具体的例子说明本实施例的应用。
例如,假设所述当前打开页面为第11页,用户在完成第11页的书写编辑后,需要跳转到第12页继续进行书写编辑,则此时,先判断第11页是否为最后一个被编辑的页面,如果是,则生成一个新建页面,并将第11页内的所有对象数据序列化为序列化数据,在完成序列化后,跳转并生成一个新建的第12页。
再例如,假设所述当前打开页面为第11页,用户在编辑或阅读第11页的内容时,需要跳转到前面的页面,如第10页(也可以是在第11页后面的页面,但需保证后面的页面不是一个新建页面)来参考第10页内的内容,则此时,先将与第11页对应的对象数据序列化为序列化数据;再跳转到第10页,并将与第10页对应的序列化数据反序列化为对象数据后, 将所述对象数据转化为对应的笔迹,并将所述笔迹绘制在显示屏上,从而显示所述目标页面。
需要说明的是,在进行序列化和反序列化时,都需要一定的等待时间,因而在进行跳转时,会生成一个等待的页面或标志,待序列化和反序列化完成时,再跳转到目标页面。
综上所述,本发明实施例提供的翻页方法,通过在翻页时,对当前打开页面进行序列化处理,使得所述当前打开页面的对象数据转化为序列化数据,从而减少了内存中存储的对象数据的数量,进而缩短了在垃圾回收时遍历对象所需的时间,避免了出现明显卡顿或长时间等待的现象。本发明实施例可提高书写的流程性,提高用户的使用体验。
为了便于对本发明的理解,下面将对本发明的一些优选实施例做更进一步的描述。
第一个优选实施例:
针对上述实施例的步骤S102,如果在每次跳转到目标页面时,都将当前打开页面进行序列化,当用户需要从目标页面返回到所述当前打开页面进行资料参考时(特别的,如果目标页面是新建页面的话,由于在编辑新建页面的时候一般需要参考前面页面的内容,因而可能会较频繁的需要返回到所述当前打开页面进行资料参考),还需要首先对目标页面进行序列化,并对所述当前打开页面反序列化才能正常显示所述当前打开页面。由于序列化和反序列化是需要时间的,这样就可能造成用户额外的等待时间。
为此,请参阅图2,在本优选实施例中,所述步骤S102具体为:
S1021,获取当前内存中存储的所有对象数据及与每个对象数据对应的页面,以获得未被序列化的页面的数量。
其中,所述的所有对象特指当前编辑的文件的对象数据。
S1022,判断所述未被序列化的页面的数量是否大于预设的第一阈值;若是,则执行S1023,若否,则执行S103。
S1023,则将与存储时间最早的页面对应的对象数据序列化为序列化数据。
在本优选实施例中,并不会在每次执行翻页指令的时候都对所述当前打开页面执行序列化,而是允许一定数量的页面不进行序列化,其中,这些页面是最新存储到内存中的页面,也可以理解为对用户最近时间操作过的页面内的对象数据先不进行序列化,以方便用户来回翻页查看。
例如,设所述第一阈值为2,假如所述当前打开页面为第11页,用户在完成第11页的编辑后,需要跳转到第12页(新建页面)继续进行编辑,则此时,先获取当前内存中存储的所有对象数据及与每个对象数据对应的页面,假设检测到第9页,第10页和第11页中的对象数据尚未被序列化(且假设这3页在内存中的存储时间的先后顺序依次为第9页、第10页、 第11),即有3张页面的对象数据没有被序列化,由于3大于第一阈值2,因而在跳转到第12页的时候,需要将与存储时间最早的页面(第9页)对应的对象数据序列化为序列化数据。在对12页进行编辑的过程中,若需要返回到第11页,由于此时,第10、11、12页的对象数据没有被序列化,因而在跳转到第11页的时候,需要将与存储时间最早的页面(第10页)对应的对象数据序列化为序列化数据,而第11页和第12页不需要进行序列化。此后,若用户再次从第11页翻页到第12页进行编辑,由于此时只有第11和12页的对象数据没有被序列化,因而在跳转到第12页的时候,一方面,不需要对第11页内的对象数据进行序列化,另一方面,由于第12页的对象数据也没有被序列化成序列化数据,因此也无需进行反序列化。如此,即在保证使用顺畅的前提下,解决了在频繁翻页时造成的重复序列化和重复反序列化的问题,减少了用户的等待时间,提升了用户的使用体验。
需要说明的是,在本发明实施例中,所述第一阈值根据每个页面的对象数据的平均个数及当前内存可容忍的最大对象数据的个数生成,这样,可避免太多页面没有被序列化而造成的书写卡顿和不流程的问题。例如,假设每个页面的对象数据的平均个数是1000个,而当前内存可容忍的最大对象数据的个数是5000个,则所述第一阈值优选为4或小于4的整数。如此,在解决频繁翻页时造成的重新序列化和重复反序列化的问题的同时,保证了书写和使用的顺畅。
第二个优选实施例。
针对与第一个优选实施例相同的问题,请参阅图3,在本优选实施例中:
步骤S102具体为:
S1024,获取当前内存中存储的所有对象数据及与每个对象数据对应的页面;
S1025,判断所述当前内存中存储有对象数据的数量是否大于预设的第二阈值;若是,则执行S1026,若否,则执行S103。
S1026,则将与存储时间最早的页面对应的对象数据序列化为序列化数据。
与第一个优选实施例不同的是,在本优选实施例中,判断的是当前内存中存储的对象数据的数量是否大于预设的第二阈值。即不一定会在每次执行翻页指令的时候都对所述当前打开页面执行序列化,而是允许一定数量的对象数据不进行序列化,其中,这些对象数据是最新存储到内存中的对象数据。也可以理解为对用户最近时间操作过的页面内的对象数据先不进行序列化,以方便用户查看。
例如,设所述第二阈值为5000,假如所述当前打开页面为第11页,用户在完成第11页的编辑后,需要跳转到第12页(新建页面)继续进行编辑,则此时,先获取当前内存中存储 的所有对象数据及与每个对象数据对应的页面,假设检测到第8页(包含1000个对象数据)、第9页(包含1500个对象数据),第10页(1000个对象数据)和第11页(包括1100个对象数据)中的对象数据均没有被序列化(且假设这四页在内存中的存储时间的先后顺序依次为第8页,第9页、第10页、第11),由于这4页的全部对象数据之和(4600)小于所述第二阈值5000,因而在跳转到第12页的时候,不需要进行序列化。在对12页进行编辑的过程中(编辑产生了2000个对象数据),若需要返回到第11页,由于此时,这5页的全部对象数据之和(6600)大于所述第二阈值5000,因而在跳转到第11页的时候,需要将与存储时间最早的页面(第8页)对应的对象数据序列化为序列化数据。在对第8页完成序列化后,由于剩下的4页的全部对象数据之和(5600)仍然大于所述第二阈值,因而还需要继续将与存储时间最早的页面(第9页)对应的对象数据序列化为序列化数据,而第10、11页和第12页不需要进行序列化。此后,若用户再次从第11页翻页到第12页进行编辑,由于第10、11页和第12页这3页内的数据对象之和小于所述第二阈值,因而在跳转到第12页的时候,一方面,不需要对第11页内的对象数据进行序列化,另一方面,由于第12页的对象数据也没有被序列化成序列化数据,因此也无需进行反序列化。如此,即在保证使用顺畅的前提下,解决了在频繁翻页时造成的重复序列化和重复反序列化的问题,减少了用户的等待时间,提升了用户的使用体验。
请参阅图4,本发明实施例还提供了一种翻页装置100,包括:
翻页监听单元10,用于监听用户发出的从当前打开页面跳转到目标页面的翻页指令。
序列化单元20,用于对当前内存中存储的预定的对象数据进行序列化处理。
其中,所述序列化单元20具体用于,获取当前内存中存储的与所述当前打开页面对应的对象数据,并将与所述当前打开页面对应的对象数据序列化为序列化数据。
跳转单元30,用于跳转到所述目标页面。
反序列化单元40,用于当查询到与所述目标页面对应的序列化数据后,将所述序列化数据反序列化为对象数据,并对所述对象数据进行绘制,以显示所述目标页面。
本发明实施例提供的翻页装置100,通过在翻页时,由所述序列化单元20对当前打开页面进行序列化处理,使得所述当前打开页面的对象数据转化为序列化数据,从而减少了内存中存储的对象数据的数量,进而缩短了在垃圾回收时遍历对象所需的时间,避免了出现明显卡顿的现象。本发明实施例可提高书写的流程性,提高用户的使用体验。
请参阅图5,优选地,所述序列化单元20具体包括:
页面数量获取模块21,用于获取当前内存中存储的所有对象数据及与每个对象数据对应的页面。
第一判断模块22,用于判断所述当前内存中存储有对象数据的页面的数量是否大于预设的第一阈值;若是,则通知第一序列化子模块23;若否,则通知所述跳转单元30。
所述第一序列化子模块23,用于将与存储时间最早的页面对应的对象数据序列化为序列化数据。
本优选实施例可在保证使用顺畅的前提下,解决了在频繁翻页时造成的重复序列化和重复反序列化的问题,减少了用户的等待时间,提升了用户的使用体验。
请参阅图6,优选地,所述序列化单元20具体包括:
对象获取模块24,用于获取当前内存中存储的所有对象数据及与每个对象数据对应的页面。
第二判断模块25,用于判断所述当前内存中存储的所有对象数据的数量是否大于预设的第二阈值;若是,则通知第二序列化子模块26;若否,则通知所述跳转单元30。
所述第二序列化子模块26,用于将与存储时间最早的页面对应的对象数据序列化为序列化数据。
本优选实施例可在保证使用顺畅的前提下,解决了在频繁翻页时造成的重复序列化和重复反序列化的问题,减少了用户的等待时间,提升了用户的使用体验。
本发明实施例还提供一种书写终端,所述书写终端包括上述任一实施例所述的翻页装置100。
其中,优选的,所述书写终端为电子白板。
以上所揭露的仅为本发明一种较佳实施例而已,当然不能以此来限定本发明之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于发明所涵盖的范围。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。

Claims (10)

  1. 一种翻页方法,其特征在于,包括如下步骤:
    监听用户发出的从当前打开页面跳转到目标页面的翻页指令;
    对当前内存中存储的预定的对象数据进行序列化处理;
    跳转到所述目标页面;
    当查询到与所述目标页面对应的序列化数据后,将所述序列化数据反序列化为对象数据,并对所述对象数据进行绘制,以显示所述目标页面。
  2. 根据权利要求1所述的翻页方法,其特征在于,所述对当前内存中存储的预定的对象数据进行序列化处理,具体为:
    获取当前内存中存储的与所述当前打开页面对应的对象数据,并将与所述当前打开页面对应的对象数据序列化为序列化数据。
  3. 根据权利要求1所述的翻页方法,其特征在于,所述对当前内存中存储的预定的对象数据进行序列化处理,具体为:
    获取当前内存中存储的所有对象数据及与每个对象数据对应的页面,以获得未被序列化的页面的数量;
    判断所述未被序列化的页面的数量是否大于预设的第一阈值;
    若是,则将与存储时间最早的页面对应的对象数据序列化为序列化数据;
    若否,则执行步骤:跳转到所述目标页面。
  4. 根据权利要求3所述的翻页方法,其特征在于,所述第一阈值根据每个页面的对象数据的平均个数及当前内存可容忍的最大对象数据的个数生成。
  5. 根据权利要求1所述的翻页方法,其特征在于,所述对当前内存中存储的预定的对象数据进行序列化处理,具体为:
    获取当前内存中存储的所有对象数据及与每个对象数据对应的页面;
    判断所述当前内存中存储的所有对象数据的数量是否大于预设的第二阈值;
    若是,则将与存储时间最早的页面对应的对象数据序列化为序列化数据;
    若否,则执行步骤:跳转到所述目标页面。
  6. 一种翻页装置,其特征在于,包括:
    翻页监听单元,用于监听用户发出的从当前打开页面跳转到目标页面的翻页指令;
    序列化单元,用于对当前内存中存储的预定的对象数据进行序列化处理;
    跳转单元,用于跳转到所述目标页面;
    反序列化单元,用于当查询到与所述目标页面对应的序列化数据后,将所述序列化数据反序列化为对象数据,并对所述对象数据进行绘制,以显示所述目标页面。
  7. 根据权利要求6所述的翻页装置,其特征在于,所述序列化单元具体用于,获取当前内存中存储的与所述当前打开页面对应的对象数据,并将与所述当前打开页面对应的对象数据序列化为序列化数据。
  8. 根据权利要求6所述的翻页装置,其特征在于,所述序列化单元具体包括:
    页面数量获取模块,用于获取当前内存中存储的所有对象数据及与每个对象数据对应的页面,以获得未被序列化的页面的数量;
    第一判断模块,用于判断所述未被序列化的页面的数量是否大于预设的第一阈值;若是,则通知第一序列化子模块;若否,则通知所述跳转单元;
    所述第一序列化子模块,用于将与存储时间最早的页面对应的对象数据序列化为序列化数据。
  9. 根据权利要求6所述的翻页装置,其特征在于,所述序列化单元具体包括:
    对象获取模块,用于获取当前内存中存储的所有对象数据及与每个对象数据对应的页面;
    第二判断模块,用于判断所述当前内存中存储的所有对象数据的数量是否大于预设的第二阈值;若是,则通知第二序列化子模块;若否,则通知所述跳转单元;
    所述第二序列化子模块,用于将与存储时间最早的页面对应的对象数据序列化为序列化数据。
  10. 一种书写终端,其特征在于,包括如权利要求6至9任意一项所述的翻页装置。
PCT/CN2016/113340 2016-08-16 2016-12-30 一种翻页方法、装置及书写终端 Ceased WO2018032698A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610673260.4 2016-08-16
CN201610673260.4A CN106250063B (zh) 2016-08-16 2016-08-16 一种翻页方法、装置及书写终端

Publications (1)

Publication Number Publication Date
WO2018032698A1 true WO2018032698A1 (zh) 2018-02-22

Family

ID=57593141

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/113340 Ceased WO2018032698A1 (zh) 2016-08-16 2016-12-30 一种翻页方法、装置及书写终端

Country Status (2)

Country Link
CN (1) CN106250063B (zh)
WO (1) WO2018032698A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112446191A (zh) * 2019-08-12 2021-03-05 珠海金山办公软件有限公司 一种文本处理方法、装置、设备及存储介质
CN112861051A (zh) * 2019-11-28 2021-05-28 北京沃东天骏信息技术有限公司 页面操作的控制方法、装置、电子设备和存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250063B (zh) * 2016-08-16 2019-11-29 广州视睿电子科技有限公司 一种翻页方法、装置及书写终端
CN110020330B (zh) * 2017-07-17 2021-07-09 北京嘀嘀无限科技发展有限公司 页面跳转方法及页面跳转装置、设备和存储介质
CN107491249B (zh) * 2017-08-21 2020-11-06 广州视源电子科技股份有限公司 一种智能平板的控制方法、装置、设备及存储介质
CN111352554A (zh) * 2018-12-24 2020-06-30 杭州海康威视数字技术股份有限公司 一种在电子设备上进行翻页的方法及装置
CN109739575A (zh) * 2018-12-29 2019-05-10 上海掌门科技有限公司 信息处理方法、电子设备和计算机可读介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008005830A2 (en) * 2006-06-30 2008-01-10 E-Book Systems, Inc. Method, system, and computer-readable instructions for advertisement using a multi-flipbook system
CN102043583A (zh) * 2010-11-30 2011-05-04 汉王科技股份有限公司 页面跳转方法、页面跳转装置及电子阅读装置
CN102136251A (zh) * 2010-01-26 2011-07-27 上海易狄欧电子科技有限公司 电子书的翻页方法及电子书阅读器
CN104461745A (zh) * 2014-12-23 2015-03-25 中科创达软件股份有限公司 一种内存优化方法及装置
CN104808889A (zh) * 2014-01-24 2015-07-29 贝壳网际(北京)安全技术有限公司 页面切换方法及电子设备
CN105095250A (zh) * 2014-05-05 2015-11-25 北京大学 页面调度的处理方法和装置
CN106250063A (zh) * 2016-08-16 2016-12-21 广州视睿电子科技有限公司 一种翻页方法、装置及书写终端

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7693955B2 (en) * 2002-02-22 2010-04-06 Bea Systems, Inc. System and method for deploying a web service
CN102841901B (zh) * 2011-06-23 2015-09-09 腾讯科技(深圳)有限公司 一种网页显示的方法和装置

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008005830A2 (en) * 2006-06-30 2008-01-10 E-Book Systems, Inc. Method, system, and computer-readable instructions for advertisement using a multi-flipbook system
CN102136251A (zh) * 2010-01-26 2011-07-27 上海易狄欧电子科技有限公司 电子书的翻页方法及电子书阅读器
CN102043583A (zh) * 2010-11-30 2011-05-04 汉王科技股份有限公司 页面跳转方法、页面跳转装置及电子阅读装置
CN104808889A (zh) * 2014-01-24 2015-07-29 贝壳网际(北京)安全技术有限公司 页面切换方法及电子设备
CN105095250A (zh) * 2014-05-05 2015-11-25 北京大学 页面调度的处理方法和装置
CN104461745A (zh) * 2014-12-23 2015-03-25 中科创达软件股份有限公司 一种内存优化方法及装置
CN106250063A (zh) * 2016-08-16 2016-12-21 广州视睿电子科技有限公司 一种翻页方法、装置及书写终端

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112446191A (zh) * 2019-08-12 2021-03-05 珠海金山办公软件有限公司 一种文本处理方法、装置、设备及存储介质
CN112861051A (zh) * 2019-11-28 2021-05-28 北京沃东天骏信息技术有限公司 页面操作的控制方法、装置、电子设备和存储介质

Also Published As

Publication number Publication date
CN106250063A (zh) 2016-12-21
CN106250063B (zh) 2019-11-29

Similar Documents

Publication Publication Date Title
WO2018032698A1 (zh) 一种翻页方法、装置及书写终端
US8762871B2 (en) Dynamic preview of diagram elements to be inserted into a diagram
US10140270B2 (en) Digital document change conflict resolution
US8607239B2 (en) Lock mechanism to reduce waiting of threads to access a shared resource by selectively granting access to a thread before an enqueued highest priority thread
CN110865888A (zh) 一种资源加载方法、装置、服务器及存储介质
CN107729516A (zh) 单页应用展示方法和装置、服务器、设备及可读介质
US20170103052A1 (en) Latency reduction in collaborative presentation sharing environment
KR20140003419A (ko) 문서 편집 명령 직렬화
CN114238213A (zh) 多线程文件解析方法及装置
CN106598508A (zh) 一种固态硬盘及其写入仲裁方法、系统
CN113730917B (zh) 游戏脚本生成方法、装置、计算机设备和存储介质
US20140250251A1 (en) Automatically and transparently preserving testing state across sessions
CN108198582B (zh) 一种NAND Flash控制方法、装置及SSD
CN116431606A (zh) 数据迁移方法、装置、存储介质及电子设备
CN111881212A (zh) 执行检查点操作的方法、装置、设备及存储介质
CN110109881B (zh) 文件拆分的方法、装置、电子设备及存储介质
WO2021238261A1 (zh) 一种基于lookup操作的多线程消息处理方法
WO2023060833A1 (zh) 数据交互方法、电子设备、存储介质
CN114647411A (zh) 编程界面加载方法、装置、电子设备及存储介质
CN118069589B (zh) 文件访问方法、装置、计算机设备及程序产品
US20130179896A1 (en) Multi-thread processing of an XML document
US20130290657A1 (en) Storing data in containers
US20230409824A1 (en) Using operational transforms to perform operations on parallel copies of a document model
CN113778624B (zh) 对象的处理方法和装置、智能终端及存储介质
CN104461636A (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: 16913450

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

Country of ref document: EP

Kind code of ref document: A1