CN111352909A - A file saving and loading method, device, electronic device and storage medium - Google Patents
A file saving and loading method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN111352909A CN111352909A CN201910376123.8A CN201910376123A CN111352909A CN 111352909 A CN111352909 A CN 111352909A CN 201910376123 A CN201910376123 A CN 201910376123A CN 111352909 A CN111352909 A CN 111352909A
- Authority
- CN
- China
- Prior art keywords
- list
- file
- storage
- operation information
- saving
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/113—Details of archiving
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及计算机技术领域,特别是指一种文件保存及加载方法、设备、电子设备及存储介质。The present invention relates to the field of computer technology, in particular to a file saving and loading method, device, electronic device and storage medium.
背景技术Background technique
在现代教学过程中越来越多的运用交互式处理的方式进行交互式学习,交互式学习是一种强调结合交际合作和电脑使用的新型教学方式。当代高速发展的电子科技和多媒体交互促使了交互式学习的产生。21世纪之初到现在,越来越多的学生进入高等教育的学堂,期望着能够享受到结合高科技的使用的(交互式学习)的教育方式。由于新时代的学生们早已在生活中接触到各种高科技产品和理念,这种新兴的教学方式对于这些新时代的学子,就像铅笔和白纸对于传统课堂的学生一样。In the modern teaching process, more and more interactive learning methods are used. Interactive learning is a new teaching method that emphasizes the combination of communication, cooperation and computer use. The rapid development of contemporary electronic technology and multimedia interaction has prompted the emergence of interactive learning. From the beginning of the 21st century to the present, more and more students have entered the classrooms of higher education, expecting to enjoy the education method (interactive learning) combined with the use of high technology. Since students in the new era have already been exposed to various high-tech products and concepts in their lives, this new teaching method is like pencil and white paper to students in traditional classrooms.
目前在生活中的交互式教学过程中经常会使用到电子白板,比如学校教室大屏教学的电子白板,会议大屏的电子白板,QQ的演示白板。可以说电子白板软件已经渗透到我们工作、生活的方法面面。At present, electronic whiteboards are often used in the interactive teaching process in life, such as electronic whiteboards for large-screen teaching in school classrooms, electronic whiteboards for large-screen conferences, and QQ presentation whiteboards. It can be said that electronic whiteboard software has penetrated into all aspects of our work and life.
而电子白板中,常用的一个功能就是撤销、恢复功能。目前撤销、恢复功能基本上都只有在软件打开的情况下缓存撤销和恢复的步骤。In the electronic whiteboard, a commonly used function is the undo and restore functions. At present, the undo and restore functions basically only cache the steps of undoing and restoring when the software is open.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明的目的在于提出一种可以将所有撤销和恢复步骤保存到文件中,下次打开软件后可以加载此文件,恢复所有的撤销、恢复步骤的文件保存及加载方法、设备、电子设备及存储介质。In view of this, the purpose of the present invention is to propose a file saving and loading method, device, Electronic equipment and storage media.
基于上述目的,第一方面,本发明提供了一种文件保存及加载方法,包括:Based on the above purpose, in the first aspect, the present invention provides a file saving and loading method, including:
获取保存主文件指令;Get the instruction to save the main file;
将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,将所述存储列表与所述主文件进行合并生成合并文件;Converting the cache list associated with the master file into a storage list to obtain a storage list, and merging the storage list with the master file to generate a merged file;
将所述合并文件进行保存。Save the merged file.
在一些实施方式中,所述将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,具体包括:In some implementation manners, the storage list is obtained by converting the cache list associated with the main file into a storage list, which specifically includes:
获取所述缓存列表中的所有操作信息;Obtain all operation information in the cache list;
将所述操作信息按照预设的定义标准进行分类定义,并标记排序时点;classifying and defining the operation information according to a preset definition standard, and marking the sorting time point;
根据所述分类定义以及所述排序时点对所述操作信息进行可存化转换生成可存信息;Perform storable conversion on the operation information according to the classification definition and the sorting time point to generate storable information;
整合所述可存信息生成所述存储列表。The storage list is generated by integrating the storable information.
在一些实施方式中,所述整合所述可存信息生成所述存储列表,具体包括:In some embodiments, the integration of the storable information to generate the storage list specifically includes:
将所述可存信息按照所述分类定义进行分类,生成不同类型的可存组;classifying the storable information according to the classification definition to generate storable groups of different types;
将所述可存组按照分类定义合并成存储列表。The storable groups are merged into a storage list according to the classification definition.
在一些实施方式中,所述将所述存储列表与所述主文件进行合并生成合并文件,具体包括:In some implementation manners, generating a merged file by merging the storage list with the main file specifically includes:
所述存储列表合并于所述主文件之中。The storage list is incorporated into the master file.
在一些实施方式中,所述获取保存主文件指令之前,还包括:In some embodiments, before the acquiring and saving the master file instruction, further includes:
生成控制底板,创建所述缓存列表,所述缓存列表至少包括:撤销链表;generating a control backplane, and creating the cache list, where the cache list at least includes: a revocation linked list;
获取用户的操作信息;Obtain the user's operation information;
根据所述分类定义将所述操作信息添加于所述撤销链表。The operation information is added to the revocation list according to the classification definition.
在一些实施方式中,所述根据所述功能子类将所述操作信息添加于所述撤销链表之后,还包括:In some implementation manners, the adding the operation information after the revocation list according to the function subclass further includes:
所述缓存列表还包括:恢复链表;The cache list further includes: restoring the linked list;
当所述操作信息为撤销操作时,将所述撤销链表中最后一个所述操作信息去除并添加到恢复链表的末尾。When the operation information is an undo operation, the last piece of the operation information in the undo linked list is removed and added to the end of the recovery linked list.
当所述操作信息为恢复操作时,将所述恢复链表中最后一个所述操作信息去除并添加到撤销链表的末尾。When the operation information is a recovery operation, the last operation information in the recovery linked list is removed and added to the end of the revocation linked list.
在一些实施方式中,所述将所述合并文件进行保存之后,还包括:In some embodiments, after saving the combined file, the method further includes:
当再次读取所述合并文件时,优先读取所述存储列表,对所述存储列表进行反可存化转换生成所述缓存列表。When the merged file is read again, the storage list is preferentially read, and the storage list is de-storable and converted to generate the cache list.
在一些实施方式中,所述方法至少应用于:交互式屏幕、交互式白板和交互式投屏。In some embodiments, the method applies at least to: interactive screens, interactive whiteboards, and interactive projection screens.
第二方面,本发明还提供了一种文件保存及加载设备,包括:In a second aspect, the present invention also provides a file saving and loading device, including:
获取模块,获取保存主文件指令;Get the module, get the instruction to save the main file;
合并模块,将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,将所述存储列表与所述主文件进行合并生成合并文件;a merging module, which converts the cache list associated with the master file into a storage list, and merges the storage list with the master file to generate a merged file;
存储模块,将所述合并文件进行保存。The storage module saves the merged file.
在一些实施方式中,所述合并模块将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,具体包括:In some implementations, the merging module converts the cache list associated with the main file into a storage list to obtain a storage list, which specifically includes:
获取所述缓存列表中的所有操作信息;Obtain all operation information in the cache list;
将所述操作信息按照预设的定义标准进行分类定义,并标记排序时点;classifying and defining the operation information according to a preset definition standard, and marking the sorting time point;
根据所述分类定义以及所述排序时点对所述操作信息进行可存化转换生成可存信息;Perform storable conversion on the operation information according to the classification definition and the sorting time point to generate storable information;
整合所述可存信息生成所述存储列表。The storage list is generated by integrating the storable information.
在一些实施方式中,所述合并模块整合所述可存信息生成所述存储列表,具体包括:In some embodiments, the merging module integrates the storable information to generate the storage list, which specifically includes:
将所述可存信息按照所述分类定义进行分类,生成不同类型的可存组;classifying the storable information according to the classification definition to generate storable groups of different types;
将所述可存组按照分类定义合并成存储列表。The storable groups are merged into a storage list according to the classification definition.
在一些实施方式中,所述合并模块将所述存储列表与所述主文件进行合并生成合并文件,具体包括:In some embodiments, the merging module merges the storage list with the main file to generate a merged file, which specifically includes:
所述存储列表合并于所述主文件之中。The storage list is incorporated into the master file.
在一些实施方式中,所述获取模块获取保存主文件指令之前,还包括:In some embodiments, before the obtaining module obtains the instruction to save the master file, it further includes:
生成控制底板,创建所述缓存列表,所述缓存列表至少包括:撤销链表;generating a control backplane, and creating the cache list, where the cache list at least includes: a revocation linked list;
获取用户的操作信息;Obtain the user's operation information;
根据所述分类定义将所述操作信息添加于所述撤销链表。The operation information is added to the revocation list according to the classification definition.
在一些实施方式中,所述获取模块根据所述功能子类将所述操作信息添加于所述撤销链表之后,还包括:In some embodiments, the obtaining module adds the operation information to the revocation list according to the function subclass, and further includes:
所述缓存列表还包括:恢复链表;The cache list further includes: restoring the linked list;
当所述操作信息为撤销操作时,将所述撤销链表中最后一个所述操作信息去除并添加到恢复链表的末尾。When the operation information is an undo operation, the last piece of the operation information in the undo linked list is removed and added to the end of the recovery linked list.
当所述操作信息为恢复操作时,将所述恢复链表中最后一个所述操作信息去除并添加到撤销链表的末尾。When the operation information is a recovery operation, the last operation information in the recovery linked list is removed and added to the end of the revocation linked list.
在一些实施方式中,所述存储模块将所述合并文件进行保存之后,还包括:In some embodiments, after the storage module saves the merged file, it further includes:
当再次读取所述合并文件时,优先读取所述存储列表,对所述存储列表进行反可存化转换生成所述缓存列表。When the merged file is read again, the storage list is preferentially read, and the storage list is de-storable and converted to generate the cache list.
在一些实施方式中,所述设备至少应用于:交互式屏幕、交互式白板和交互式投屏。In some embodiments, the apparatus is applied to at least: interactive screens, interactive whiteboards, and interactive projection screens.
第三方面,本发明还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上所述的文件保存及加载方法。In a third aspect, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implements the above-mentioned file when executing the program Save and load methods.
第四方面,本发明还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备执行权利要求如上所述的文件保存及加载方法。In a fourth aspect, the present invention also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is made to execute the claims as described above. How to save and load files as described.
从上面所述可以看出,本发明提供的文件保存及加载方法、设备、电子设备及存储介质,包括:获取保存主文件指令;将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,将所述存储列表与所述主文件进行合并生成合并文件;将所述合并文件进行保存。通过应用本申请的技术方案,用户在使用电子设备的过程中,可以保存所有的操作步骤,并且可以在不同的设备上加载,重现所有的操作步骤,非常方便编写教案,制作会议文档,减少了用户制作文档的时间,提高了用户体验和使用效率。As can be seen from the above, the file saving and loading method, device, electronic device and storage medium provided by the present invention include: obtaining an instruction for saving a master file; converting a cache list associated with the master file to a storable conversion Obtaining a storage list, merging the storage list with the main file to generate a merged file; and saving the merged file. By applying the technical solution of the present application, the user can save all the operation steps in the process of using the electronic device, and can load and reproduce all the operation steps on different devices, which is very convenient for writing lesson plans, making meeting documents, reducing It saves the time for users to make documents, and improves the user experience and usage efficiency.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative efforts.
图1为本发明实施例提出的一种文件保存及加载方法的流程示意图;1 is a schematic flowchart of a file saving and loading method proposed by an embodiment of the present invention;
图2为本发明实施例提出的一种文件保存及加载设备的结构示意图。FIG. 2 is a schematic structural diagram of a file saving and loading device according to an embodiment of the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具体实施例,并参照附图,对本发明进一步详细说明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings.
本发明实施例提供了一种文件保存及加载方法,需要说明的是,本发明实施例中文件保存及加载是建立在文件系统中的存储及读取功能,文件系统是操作系统用于明确存储设备(常见的是磁盘,也有基于NAND Flash的固态硬盘)或分区上的文件的方法和数据结构;即在存储设备上组织文件的方法。操作系统中负责管理和存储文件信息的软件机构称为文件管理系统,简称文件系统。而所述文件系统可以存在于可使用存储设备的电子设备中,例如:个人计算机、智能移动设备、交互设备、智能家用设备等。不同的设备只要能完成文件系统的相应功能,其设备均不会影响本发明的保护范围。The embodiment of the present invention provides a file saving and loading method. It should be noted that, in the embodiment of the present invention, the file saving and loading are storage and reading functions established in the file system, and the file system is used by the operating system to explicitly store Methods and data structures for files on a device (commonly a disk, but also NAND Flash-based solid-state drives) or partitions; that is, a method for organizing files on a storage device. The software organization responsible for managing and storing file information in the operating system is called a file management system, or file system for short. The file system may exist in an electronic device that can use a storage device, such as a personal computer, a smart mobile device, an interactive device, a smart home device, and the like. As long as different devices can complete the corresponding functions of the file system, their devices will not affect the protection scope of the present invention.
进一步的,为了在交互式处理的过程中有效利用文件保存加载功能,将用户在投屏或电子白板上的操作存储下来以便下次利用,在具体应用场景中,所述方法至少应用于:交互式屏幕、交互式白板和交互式投屏。Further, in order to effectively utilize the file saving and loading function in the process of interactive processing, the user's operations on the screen or electronic whiteboard are stored for next use. In a specific application scenario, the method is at least applied to: interactive screen, interactive whiteboard, and interactive projection.
如图1所示,为本发明实施例提出的一种文件保存及加载方法的流程示意图。该方法具体包括以下步骤:As shown in FIG. 1 , it is a schematic flowchart of a file saving and loading method provided by an embodiment of the present invention. The method specifically includes the following steps:
步骤101,获取保存主文件指令。
本步骤旨在获得用户进行保存的指令。其中获取指令的方式可以为很多种,如:获取用户的点击指令、获取用户的手势指令、获取用户的声音指令等,其不同的获取指令方法只要能达到获取保存指令的目的,不同的方法均不会影响本发明的保护范围。The purpose of this step is to obtain instructions from the user to save. There are many ways to obtain the instruction, such as: obtaining the user's click command, obtaining the user's gesture command, obtaining the user's voice command, etc., as long as the different methods of obtaining the command can achieve the purpose of obtaining the saving command, different methods are used. It will not affect the protection scope of the present invention.
进一步的,为了有效记录用户的全部操作,以使用户在需要回溯操作过程的时候有迹可循,在本申请的优选实施例中,所述获取保存主文件指令之前,还包括:Further, in order to effectively record all the operations of the user, so that the user has traces to follow when the operation process needs to be traced back, in a preferred embodiment of the present application, before the acquiring and saving the master file instruction, it also includes:
生成控制底板,创建所述缓存列表,所述缓存列表至少包括:撤销链表;generating a control backplane, and creating the cache list, where the cache list at least includes: a revocation linked list;
获取用户的操作信息;Obtain the user's operation information;
根据所述分类定义将所述操作信息添加于所述撤销链表。The operation information is added to the revocation list according to the classification definition.
进一步的,为了将撤销操作的过程进行记录,并在用户需要回复已撤销的操作时可以进行回复操作,在本申请的优选实施例中,所述根据所述功能子类将所述操作信息添加于所述撤销链表之后,还包括:Further, in order to record the process of undoing the operation, and the user can perform the reply operation when the user needs to reply to the revoked operation, in a preferred embodiment of the present application, the operation information is added according to the function subclass. After the revocation list, it also includes:
所述缓存列表还包括:恢复链表;The cache list further includes: restoring the linked list;
当所述操作信息为撤销操作时,将所述撤销链表中最后一个所述操作信息去除并添加到恢复链表的末尾。When the operation information is an undo operation, the last piece of the operation information in the undo linked list is removed and added to the end of the recovery linked list.
当所述操作信息为恢复操作时,将所述恢复链表中最后一个所述操作信息去除并添加到撤销链表的末尾。When the operation information is a recovery operation, the last operation information in the recovery linked list is removed and added to the end of the revocation linked list.
在具体应用场景中,创建一个版本控制底板,对应于每种应用方法,在版本控制底板的基础上,创建相应的子类,并实现对应的方法。创建两个版本控制链表,备份每种操作行为,一个链表用于撤销操作,一个链表用于恢复操作。当发生撤销操作时,我们将撤销链表最后一个操作行为去除并添加到恢复链表的末尾。当发生恢复操作时,我们将恢复链表最后一个操作行为去除并添加到撤销链表的末尾。当用户需要对文件进行保存是会做出相应保存指示:点击保存按钮、指向保存按钮等。In a specific application scenario, a version control backplane is created, corresponding to each application method, on the basis of the version control backplane, corresponding subclasses are created, and corresponding methods are implemented. Create two version control linked lists to back up each operation behavior, one linked list for undo operations and one linked list for restore operations. When an undo operation occurs, we remove the last action of the undo list and add it to the end of the restore list. When a restore operation occurs, we remove and add the last operation behavior of the restore list to the end of the undo list. When the user needs to save the file, a corresponding save instruction will be given: click the save button, point to the save button, and so on.
步骤102,将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,将所述存储列表与所述主文件进行合并生成合并文件。
本步骤旨在将缓存列表进行可存化转换得到可以存储的列表,并且将列表和主文件合并存储。其中,将缓存列表转换成可存储列表的方式有很多种,如:将缓存列表逐条转换成存储列表、将缓存列表内元素进行分类再进行转换、将缓存列表中的元素按照重要性排序再进行转换等,同时,将存储列表与主文件合并成合并文件的方式有很多种,如:将存储列表接在主文件之后成为单一保存文件、将存储列表放在主文件之前成为单一保存文件、将存储列表和主文件保存成两个相关联的文件后合并为一个文件包等。其不同的转换方法和不同的合并方法只要能达到相应的目的,不同的方法均不会影响本发明的保护范围。The purpose of this step is to convert the cache list into a storable list to obtain a storable list, and store the list and the main file together. Among them, there are many ways to convert the cache list into a storable list, such as: converting the cache list into a storage list one by one, classifying the elements in the cache list and then converting, sorting the elements in the cache list according to their importance At the same time, there are many ways to combine the storage list and the main file into a combined file, such as: connecting the storage list after the main file to form a single save file, placing the storage list before the main file to form a single save file, The storage list and the main file are saved as two associated files and then merged into one file package, etc. As long as the different conversion methods and different combining methods can achieve the corresponding purpose, the different methods will not affect the protection scope of the present invention.
进一步的,为了将操作信息按照不同的操作类型进行分类以方便存储,同时为了防止操作信息顺序的错乱导致读取时无法有序读取操作信息。在本申请的优选实施例中,所述将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,具体包括:Further, in order to classify the operation information according to different operation types to facilitate storage, and at the same time, in order to prevent the operation information from being disordered in order, the operation information cannot be read in an orderly manner during reading. In a preferred embodiment of the present application, the storage list obtained by converting the cache list associated with the master file into a storage list specifically includes:
获取所述缓存列表中的所有操作信息;Obtain all operation information in the cache list;
将所述操作信息按照预设的定义标准进行分类定义,并标记排序时点;classifying and defining the operation information according to a preset definition standard, and marking the sorting time point;
根据所述分类定义以及所述排序时点对所述操作信息进行可存化转换生成可存信息;Perform storable conversion on the operation information according to the classification definition and the sorting time point to generate storable information;
整合所述可存信息生成所述存储列表。The storage list is generated by integrating the storable information.
进一步的,为了将可存信息按照不同类型进行分类管理,并在创建存储列表时可以按照类型快速存储节约逐条存储的时间。在本申请的优选实施例中,所述整合所述可存信息生成所述存储列表,具体包括:Further, in order to classify and manage the storable information according to different types, and when creating a storage list, it can be quickly stored according to the type to save the time of item-by-item storage. In a preferred embodiment of the present application, the integration of the storable information to generate the storage list specifically includes:
将所述可存信息按照所述分类定义进行分类,生成不同类型的可存组;classifying the storable information according to the classification definition to generate storable groups of different types;
将所述可存组按照分类定义合并成存储列表。The storable groups are merged into a storage list according to the classification definition.
进一步的,为了有效节约存储资源,并在再次读取文件时可以快速读取存储列表中的内容节约读取时间。在本申请的优选实施例中,所述将所述存储列表与所述主文件进行合并生成合并文件,具体包括:Further, in order to effectively save storage resources, and when the file is read again, the content in the storage list can be quickly read to save reading time. In a preferred embodiment of the present application, the combination of the storage list and the main file to generate a combined file specifically includes:
所述存储列表合并于所述主文件之中。The storage list is incorporated into the master file.
在具体应用场景中,对应每种操作,创建不同的版本控制子类,记录其创建的时点,并添加到撤销操作链表中。当用户需要保存所有的操作步骤到文件时,需要遍历撤销链表以及恢复链表中的的所有操作信息,将每个操作信息变成可序列化的对象。在链表中根据不同操作行为的类型的不同划分到不同的控制子类名下,并在存储时以子类分组的方式对每种操作行为进行存储同时标记每个操作行为的时点。在完成存储列表的建立之后,将序列化后的两个新链表用文件操作方法写入相应的文件中,将存储列表接于主文件之后生成单一合并文件进行存储。In a specific application scenario, corresponding to each operation, create a different version control subclass, record the time point of its creation, and add it to the undo operation list. When the user needs to save all the operation steps to the file, he needs to traverse the undo linked list and restore all the operation information in the linked list, and turn each operation information into a serializable object. In the linked list, it is divided into different control subclass names according to the type of different operation behaviors, and each operation behavior is stored in a subclass grouping manner during storage, and the time point of each operation behavior is marked. After the establishment of the storage list is completed, the two serialized new linked lists are written into the corresponding files by using the file operation method, and the storage list is connected to the main file to generate a single merged file for storage.
步骤103,将所述合并文件进行保存。Step 103: Save the merged file.
进一步的,为了在再次读取文件时能快速的将存储列表恢复到链表状态并减少读取全文件的时间。在本申请的优选实施例中,所述将所述合并文件进行保存之后,还包括:Further, in order to quickly restore the storage list to the linked list state and reduce the time for reading the entire file when the file is read again. In a preferred embodiment of the present application, after saving the merged file, the method further includes:
当再次读取所述合并文件时,优先读取所述存储列表,对所述存储列表进行反可存化转换生成所述缓存列表。When the merged file is read again, the storage list is preferentially read, and the storage list is de-storable and converted to generate the cache list.
在具体应用场景中,用户完成存储文件之后,当用户需要加载已经存在的文件恢复操作现场时,从文件中读出序列化后的两个链表,然后遍历这两个链表中的所有子类以及子类中的所有操作信息,对每个操作信息进行反序列化,生成对应的撤销、恢复链表。有了撤销和恢复链表后,为了快速生成之前的操作步骤,只需要按撤销链表根据其中每个子类中不同操作信息的不同时点重新执行每个操作信息,即可恢复用户上次操作的现场。In a specific application scenario, after the user finishes storing the file, when the user needs to load the existing file to restore the operation site, read the serialized two linked lists from the file, and then traverse all the subclasses in the two linked lists and For all operation information in the subclass, deserialize each operation information to generate the corresponding undo and restore linked list. With the undo and restore linked list, in order to quickly generate the previous operation steps, it is only necessary to re-execute each operation information according to the different time points of the different operation information in each subclass according to the undo linked list, and then the scene of the user's last operation can be restored. .
通过应用本申请的技术方案,该方案通过获取保存主文件指令;将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,将所述存储列表与所述主文件进行合并生成合并文件;将所述合并文件进行保存。通过应用本申请的技术方案,用户在使用电子设备的过程中,可以保存所有的操作步骤,并且可以在不同的设备上加载,重现所有的操作步骤,非常方便编写教案,制作会议文档,减少了用户制作文档的时间,提高了用户体验和使用效率。By applying the technical solution of the present application, the solution obtains an instruction to save the master file; converts the cache list associated with the master file into a storage list to obtain a storage list, and combines the storage list and the master file to generate Merge files; save the merged files. By applying the technical solution of the present application, the user can save all the operation steps in the process of using the electronic device, and can load and reproduce all the operation steps on different devices, which is very convenient for writing lesson plans, making meeting documents, reducing It saves the time for users to make documents, and improves the user experience and usage efficiency.
为了进一步阐述本发明的技术思想,现结合具体的应用场景,对本发明的技术方案进行说明。In order to further illustrate the technical idea of the present invention, the technical solutions of the present invention are now described with reference to specific application scenarios.
在本具体应用场景中,在阐述本方法之前,先给出电子白板中所有有撤销、恢复功能的操作:1.笔迹书写、2.笔迹擦除、3.笔迹剪切、4.对象创建、5.对象复制、6.对象移动、7.对象删除、8.对象组合、9.对象解除组合、10.对象层级调整、11.对象文字的变更、12.清屏等。In this specific application scenario, before explaining this method, all operations with undo and redo functions in the electronic whiteboard are given: 1. Handwriting writing, 2. Handwriting erasing, 3. Handwriting cutting, 4. Object creation, 5. Object copying, 6. Object moving, 7. Object deletion, 8. Object grouping, 9. Object ungrouping, 10. Object level adjustment, 11. Object text change, 12. Clear screen, etc.
具体实现方法如下:The specific implementation method is as follows:
创建一个版本控制基类BrushesVersion。Create a version control base class BrushesVersion.
对应于每种对象,继承版本控制基类BrushesVersion,创建相应的子类,并实现对应的方法。Corresponding to each object, inherit the version control base class BrushesVersion, create corresponding subclasses, and implement corresponding methods.
创建两个版本控制链表,备份每种操作对象,一个链表用于撤销操作,一个链表用于恢复操作。Create two version control linked lists, back up each operation object, one linked list for undo operations, and one linked list for restore operations.
对应每种操作,创建不同的版本控制子类对象,并添加到撤销操作链表中。For each operation, create a different version control subclass object and add it to the undo operation list.
当发生撤销操作时,我们将撤销链表最后一个元素去除并添加到恢复链表的末尾。When an undo operation occurs, we remove the last element of the undo list and add it to the end of the restore list.
当发生恢复操作时,我们将恢复链表最后一个元素去除并添加到撤销链表的末尾。When a restore operation occurs, we remove the last element of the restore list and add it to the end of the undo list.
当用户需要保存所有的操作步骤到文件时,我们需要遍历这两个链表的所有元素,将每个元素变成可序列化的对象。序列化(Serialization)是将对象的状态信息转换为可以存储或传输的形式的过程。因此,我们需要定义上述对象对应的可序列化对象。When the user needs to save all the operation steps to the file, we need to traverse all the elements of the two linked lists and turn each element into a serializable object. Serialization is the process of converting the state information of an object into a form that can be stored or transmitted. Therefore, we need to define the serializable object corresponding to the above object.
我们将序列化后的两个新链表用文件操作方法写入相应的文件中。We write the serialized two new linked lists into the corresponding files using the file operation method.
当用户需要加载已经存在的文件恢复操作现场时,我们从文件中读出序列化后的两个链表,然后遍历这两个链表中的所有元素,对每个元素进行反序列化,生成对应的撤销、恢复链表。反序列化(Deserialize)是将存储或传输的数据转换为对象的过程。When the user needs to load an existing file to restore the operation site, we read the serialized two linked lists from the file, then traverse all the elements in the two linked lists, deserialize each element, and generate the corresponding Undo and restore linked lists. Deserialize is the process of converting stored or transmitted data into objects.
有了撤销和恢复队列后,只需要按撤销队列重新执行每个元素操作,即可恢复用户上次操作的现场了。With the undo and restore queues, you only need to re-execute each element operation according to the undo queue to restore the scene of the user's last operation.
通过应用本申请的技术方案,该方案通过获取保存主文件指令;将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,将所述存储列表与所述主文件进行合并生成合并文件;将所述合并文件进行保存。通过应用本申请的技术方案,用户在使用电子设备的过程中,可以保存所有的操作步骤,并且可以在不同的设备上加载,重现所有的操作步骤,非常方便编写教案,制作会议文档,减少了用户制作文档的时间,提高了用户体验和使用效率。By applying the technical solution of the present application, the solution obtains an instruction to save the master file; converts the cache list associated with the master file into a storage list to obtain a storage list, and combines the storage list and the master file to generate Merge files; save the merged files. By applying the technical solution of the present application, the user can save all the operation steps in the process of using the electronic device, and can load and reproduce all the operation steps on different devices, which is very convenient for writing lesson plans, making meeting documents, reducing It saves the time for users to make documents, and improves the user experience and usage efficiency.
基于同一发明构思,本发明实施例还提供了一种文件保存及加载设备,如图2所示,包括:Based on the same inventive concept, an embodiment of the present invention also provides a file saving and loading device, as shown in FIG. 2 , including:
获取模块201,获取保存主文件指令;Obtaining
合并模块202,将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,将所述存储列表与所述主文件进行合并生成合并文件;The merging
存储模块203,将所述合并文件进行保存。The
在具体的应用场景中,所述合并模块202将与所述主文件相关联的缓存列表进行可存化转换得到存储列表,具体包括:In a specific application scenario, the merging
获取所述缓存列表中的所有操作信息;Obtain all operation information in the cache list;
将所述操作信息按照预设的定义标准进行分类定义,并标记排序时点;classifying and defining the operation information according to a preset definition standard, and marking the sorting time point;
根据所述分类定义以及所述排序时点对所述操作信息进行可存化转换生成可存信息;Perform storable conversion on the operation information according to the classification definition and the sorting time point to generate storable information;
整合所述可存信息生成所述存储列表。The storage list is generated by integrating the storable information.
在具体的应用场景中,所述合并模块202整合所述可存信息生成所述存储列表,具体包括:In a specific application scenario, the merging
将所述可存信息按照所述分类定义进行分类,生成不同类型的可存组;classifying the storable information according to the classification definition to generate storable groups of different types;
将所述可存组按照分类定义合并成存储列表。The storable groups are merged into a storage list according to the classification definition.
在具体的应用场景中,所述合并模块202将所述存储列表与所述主文件进行合并生成合并文件,具体包括:In a specific application scenario, the merging
所述存储列表合并于所述主文件之中。The storage list is incorporated into the master file.
在具体的应用场景中,所述获取模块201获取保存主文件指令之前,还包括:In a specific application scenario, before the obtaining
生成控制底板,创建所述缓存列表,所述缓存列表至少包括:撤销链表;generating a control backplane, and creating the cache list, where the cache list at least includes: a revocation linked list;
获取用户的操作信息;Obtain the user's operation information;
根据所述分类定义将所述操作信息添加于所述撤销链表。The operation information is added to the revocation list according to the classification definition.
在具体的应用场景中,所述获取模块201根据所述功能子类将所述操作信息添加于所述撤销链表之后,还包括:In a specific application scenario, the obtaining
所述缓存列表还包括:恢复链表;The cache list further includes: restoring the linked list;
当所述操作信息为撤销操作时,将所述撤销链表中最后一个所述操作信息去除并添加到恢复链表的末尾。When the operation information is an undo operation, the last piece of the operation information in the undo linked list is removed and added to the end of the recovery linked list.
当所述操作信息为恢复操作时,将所述恢复链表中最后一个所述操作信息去除并添加到撤销链表的末尾。When the operation information is a recovery operation, the last operation information in the recovery linked list is removed and added to the end of the revocation linked list.
在具体的应用场景中,所述存储模块203将所述合并文件进行保存之后,还包括:In a specific application scenario, after the
当再次读取所述合并文件时,优先读取所述存储列表,对所述存储列表进行反可存化转换生成所述缓存列表。When the merged file is read again, the storage list is preferentially read, and the storage list is de-storable and converted to generate the cache list.
在具体的应用场景中,所述设备至少应用于:交互式屏幕、交互式白板和交互式投屏。In a specific application scenario, the device is at least applied to: an interactive screen, an interactive whiteboard, and an interactive projection screen.
上述实施例的设备用于实现前述实施例中相应的方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The devices in the foregoing embodiments are used to implement the corresponding methods in the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
基于同一发明构思,本发明实施例还提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现如上所述的文件保存及加载方法。Based on the same inventive concept, an embodiment of the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, the processor implements the above when executing the program How to save and load files as described.
上述实施例的电子设备用于实现前述实施例中相应的方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The electronic devices in the foregoing embodiments are used to implement the corresponding methods in the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
基于同一发明构思,本发明实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备执行如上所述的文件保存及加载方法。Based on the same inventive concept, an embodiment of the present invention also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is made to execute the above The described file saving and loading method.
上述实施例的存储介质用于实现前述实施例中相应的方法,并且具有相应的方法实施例的有益效果,在此不再赘述。The storage medium of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
需要说明的是,以上实施例仅为用以说明本发明的技术方案,而非对其的限制。尽管参照前述实施例对发明的进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明的实施例技术方案的精神和保护范围。It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them. Although the invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements to some of the technical features; and these Modifications or substitutions do not make the essence of the corresponding technical solutions depart from the spirit and protection scope of the technical solutions of the embodiments of the present invention.
所属领域的普通技术人员应当理解:以上任何实施例的讨论仅为示例性的,并非旨在暗示本公开的范围(包括权利要求)被限于这些例子;在本发明的思路下,以上实施例或者不同实施例中的技术特征之间也可以进行组合,步骤可以以任意顺序实现,并存在如上所述的本发明的不同方面的许多其它变化,为了简明它们没有在细节中提供。Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary, and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the spirit of the present invention, the above embodiments or There may also be combinations between technical features in different embodiments, steps may be carried out in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity.
另外,为简化说明和讨论,并且为了不会使本发明难以理解,在所提供的附图中可以示出或可以不示出与集成电路(IC)芯片和其它部件的公知的电源/接地连接。此外,可以以框图的形式示出装置,以便避免使本发明难以理解,并且这也考虑了以下事实,即关于这些框图装置的实施方式的细节是高度取决于将要实施本发明的平台的(即,这些细节应当完全处于本领域技术人员的理解范围内)。在阐述了具体细节(例如,电路)以描述本发明的示例性实施例的情况下,对本领域技术人员来说显而易见的是,可以在没有这些具体细节的情况下或者这些具体细节有变化的情况下实施本发明。因此,这些描述应被认为是说明性的而不是限制性的。Additionally, well known power/ground connections to integrated circuit (IC) chips and other components may or may not be shown in the figures provided in order to simplify illustration and discussion, and in order not to obscure the present invention. . Furthermore, devices may be shown in block diagram form in order to avoid obscuring the present invention, and this also takes into account the fact that the details regarding the implementation of these block diagram devices are highly dependent on the platform on which the invention will be implemented (i.e. , these details should be fully within the understanding of those skilled in the art). Where specific details (eg, circuits) are set forth to describe exemplary embodiments of the invention, it will be apparent to those skilled in the art that these specific details may be used without or with changes The present invention is carried out below. Accordingly, these descriptions are to be considered illustrative rather than restrictive.
尽管已经结合了本发明的具体实施例对本发明进行了描述,但是根据前面的描述,这些实施例的很多替换、修改和变型对本领域普通技术人员来说将是显而易见的。例如,其它存储器架构(例如,动态RAM(DRAM))可以使用所讨论的实施例。Although the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations to these embodiments will be apparent to those of ordinary skill in the art from the foregoing description. For example, other memory architectures (eg, dynamic RAM (DRAM)) may use the discussed embodiments.
本发明的实施例旨在涵盖落入所附权利要求的宽泛范围之内的所有这样的替换、修改和变型。因此,凡在本发明的精神和原则之内,所做的任何省略、修改、等同替换、改进等,均应包含在本发明的保护范围之内。Embodiments of the present invention are intended to cover all such alternatives, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910376123.8A CN111352909A (en) | 2019-05-07 | 2019-05-07 | A file saving and loading method, device, electronic device and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910376123.8A CN111352909A (en) | 2019-05-07 | 2019-05-07 | A file saving and loading method, device, electronic device and storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111352909A true CN111352909A (en) | 2020-06-30 |
Family
ID=71196953
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910376123.8A Pending CN111352909A (en) | 2019-05-07 | 2019-05-07 | A file saving and loading method, device, electronic device and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111352909A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117591484A (en) * | 2023-11-29 | 2024-02-23 | 广东保伦电子股份有限公司 | A real-time storage method, device and medium for whiteboard content data |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060074939A1 (en) * | 2004-10-05 | 2006-04-06 | Mazzagatti Jane C | Saving and restoring an interlocking trees datastore |
| CN101201768A (en) * | 2006-12-11 | 2008-06-18 | 北京北大方正电子有限公司 | Method and module for data preservation, method and module for data restoration |
| CN102419716A (en) * | 2010-09-25 | 2012-04-18 | 上海无戒空间信息技术有限公司 | Operation method for generating dynamic media data |
| CN103106196A (en) * | 2011-11-09 | 2013-05-15 | 腾讯科技(深圳)有限公司 | Method and device for restoring browser webpage |
| CN104796390A (en) * | 2014-01-22 | 2015-07-22 | 华平信息技术(南昌)有限公司 | Electronic whiteboard whole-network synchronous undoing and recovering system and method thereof |
| CN105306861A (en) * | 2015-10-15 | 2016-02-03 | 深圳市时尚德源文化传播有限公司 | Online teaching recording and playing method and system |
| WO2017113317A1 (en) * | 2015-12-31 | 2017-07-06 | 深圳配天智能技术研究院有限公司 | File editing method and file editor |
| CN107870997A (en) * | 2017-11-03 | 2018-04-03 | 广州视源电子科技股份有限公司 | Conference blackboard-writing file management method and device, display device and storage medium |
-
2019
- 2019-05-07 CN CN201910376123.8A patent/CN111352909A/en active Pending
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20060074939A1 (en) * | 2004-10-05 | 2006-04-06 | Mazzagatti Jane C | Saving and restoring an interlocking trees datastore |
| CN101201768A (en) * | 2006-12-11 | 2008-06-18 | 北京北大方正电子有限公司 | Method and module for data preservation, method and module for data restoration |
| CN102419716A (en) * | 2010-09-25 | 2012-04-18 | 上海无戒空间信息技术有限公司 | Operation method for generating dynamic media data |
| CN103106196A (en) * | 2011-11-09 | 2013-05-15 | 腾讯科技(深圳)有限公司 | Method and device for restoring browser webpage |
| CN104796390A (en) * | 2014-01-22 | 2015-07-22 | 华平信息技术(南昌)有限公司 | Electronic whiteboard whole-network synchronous undoing and recovering system and method thereof |
| CN105306861A (en) * | 2015-10-15 | 2016-02-03 | 深圳市时尚德源文化传播有限公司 | Online teaching recording and playing method and system |
| WO2017113317A1 (en) * | 2015-12-31 | 2017-07-06 | 深圳配天智能技术研究院有限公司 | File editing method and file editor |
| CN107870997A (en) * | 2017-11-03 | 2018-04-03 | 广州视源电子科技股份有限公司 | Conference blackboard-writing file management method and device, display device and storage medium |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN117591484A (en) * | 2023-11-29 | 2024-02-23 | 广东保伦电子股份有限公司 | A real-time storage method, device and medium for whiteboard content data |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104360990A (en) | Content editing method | |
| CN111045580B (en) | Handwriting processing method and device and electronic equipment | |
| CN110941382B (en) | Display operation method, device, device and storage medium of intelligent interactive tablet | |
| CN106250063B (en) | A page turning method, device and writing terminal | |
| CN113741753A (en) | Revocation method, electronic device, storage medium, and computer program product | |
| US20180276191A1 (en) | Information processing apparatus | |
| CN107403411A (en) | Blackboard writing recording method, blackboard writing recording device, blackboard writing recording equipment and computer readable storage medium | |
| CN110688145A (en) | Android MVP code automatic generation method, device, medium and electronic equipment | |
| CN110297558B (en) | Multi-touch control method, device, intelligent interactive tablet and storage medium | |
| CN106598508A (en) | Solid-state hard disc and write-in arbitrating method and system thereof | |
| CN110989999A (en) | Code generation method and device, electronic equipment and medium | |
| CN111352909A (en) | A file saving and loading method, device, electronic device and storage medium | |
| CN102779076B (en) | Method and device for inter-process communication in browser | |
| CN103995706A (en) | Method and device for displaying picture thumbnail | |
| CN106933571A (en) | White board document storage method and system | |
| CN109933766B (en) | File generation method, device and storage medium | |
| CN101334990A (en) | Information display device, display system and information display method | |
| CN103714179A (en) | Multi-language supporting method and system for system blog | |
| CN107491363A (en) | A kind of Snapshot Method and device of the storage volume based on linux kernel | |
| CN116127935A (en) | Document creation method, device, electronic equipment and storage medium | |
| CN113849106B (en) | Page turning handwriting processing method, device, electronic device and storage medium | |
| CN112765110B (en) | PDF annotation data generation method, device, equipment and storage medium | |
| CN116011415A (en) | Document annotation generation method and device, network disk and storage medium | |
| CN114942935A (en) | A data processing method and device | |
| CN110147529B (en) | Method and device for recovering PDF comments |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200630 |