Detailed Description
The disclosure is described in further detail below with reference to the drawings and examples. It is to be understood that the specific examples described herein are intended to be illustrative of the relevant matter rather than limiting of the present disclosure. It should be further noted that, for convenience of description, only a portion relevant to the present disclosure is shown in the drawings.
In addition, embodiments of the present disclosure and features of the embodiments may be combined with each other without conflict. The technical aspects of the present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Currently, in the scenario of collaborative editing line PPT (PowerPoint), graphics, animations, and other content in PPT pages often rely on web page native DOM (document object model) rendering. However, each graph (such as rectangle and text) rendered by the native DOM is an independent node, and all attributes such as position, style, hierarchy and the like of the graph need to be synchronized, and element state redundancy results in large synchronous data volume, so that the data volume required to be transmitted when the content of the PPT is synchronized is large, and the synchronization efficiency is low. Furthermore, the adding and deleting operations of DOM elements trigger browser rearrangement (Reflow) and redrawing (Repaint), and if high-frequency data synchronization is required in collaborative editing, PPT page jam may be caused.
The embodiment of the disclosure provides a content synchronization method of an online PPT. The method can be executed by electronic equipment such as a mobile phone, a computer and the like. The content synchronization method of the online PPT of the embodiment of the disclosure provides a scheme for synchronizing the content of the online PPT on the basis of drawing graphics, animation and other contents of the online PPT based on Canvas elements (Canvas) of HTML 5.
When drawing elements in a PPT through Canvas elements, all elements may be drawn on a single Canvas. When updating, only Canvas is needed to be redrawn, bitmap pixels can be directly covered by Canvas when each drawing is performed, a persistent object tree is not needed, only an affected area is needed to be redrawn when a graph is modified, and a browser does not need to maintain element states. Therefore, elements in the PPT are drawn by using Canvas elements, the rearrangement and redrawing times of a browser can be reduced, and the rendering performance is improved.
On the basis, the content synchronization method of the online PPT can synchronize the content of the online PPT page based on the Canvas element drawing part of the content, and compared with the traditional content synchronization scheme of the online PPT page, the content synchronization method of the online PPT can reduce the consumption of network bandwidth and improve the content synchronization efficiency of the online PPT.
Fig. 1 shows an overall flow diagram of a content synchronization method M10 of an online PPT according to an embodiment of the present disclosure. The method as shown in fig. 1 includes steps S13 to S18.
In step S13, in response to the content-synchronized pushing of the target PPT page, data to be synchronized in the content-synchronized pushing is acquired. The data to be synchronized is used for synchronizing the content of the target PPT page of the client to the target version.
In a scenario of editing PPT content cooperatively by multiple persons, multiple clients edit the same PPT page jointly, and the PPT page which is edited cooperatively is recorded as a target PPT page. When a certain client edits the target PPT page to change the page content, other clients cooperatively edited synchronize the content changing operation of the client, so that the target PPT page of each client presents consistent content.
In one embodiment, content synchronization of a target PPT page between multiple clients is achieved through a central server. When any client finishes the content change operation of the target PPT page, submitting the version of the changed target PPT page to the central server. And the central server sends the content synchronization push to other clients so that the other clients synchronize the respective target PPT pages to the target PPT pages of the version of the central server. When the central server sends the content synchronous pushing of the target PPT page to other clients, the version of the target PPT page of the central server is the target version in the step S13.
The data to be synchronized pushed to the client by the central server is not the complete data of the target PPT page of the target version, but part of the data of which the target PPT page of the target version is changed relative to the PPT page of the pushed client. For example, in the case where the target PPT page of each client is V1.01 version, the client a performs a change operation on the content of the target PPT page, changes the color of a certain graphic element a to red, and updates the content of the target PPT page to V1.02 version, and the data to be synchronized pushed by the central server to the other clients except the client a may be data for changing the color of the graphic element a to red. Therefore, the data volume transmitted during the content synchronization of the target PPT page can be reduced, the network bandwidth consumption is reduced, and the pushed client can quickly respond to the synchronized content.
In step S14, when the data to be synchronized includes an undetachable minimizing target instruction of a Canvas layer of the target PPT page, querying instruction data of the target PPT page in a target PPT file locally corresponding to the client for drawing elements on the Canvas layer of the Canvas.
Fig. 2 is an application scenario schematic diagram of a solution for drawing elements such as characters, graphics or animation in an online PPT page based on Canvas elements according to an embodiment of the present disclosure. And displaying a Canvas layer and a PPT content layer on an editing interface of the target PPT page. The Canvas layer may call CANVAS API (API: application programming interface) in JavaScript (a programming language) to implement drawing of elements and path control of elements, to draw text or graphic elements at specific positions of the Canvas layer, and to control movement of the Canvas layer along specific paths, etc. The operation instructions of drawing, attribute modification, position modification and other operations of elements processed by JavaScript are recorded as instruction data of the Canvas layer.
That is, if it is necessary to synchronize the content changed by one client in the Canvas layer to another client, the center server only needs to synchronize the instruction stream of the change operation for changing the content to the other client. The other client can execute the instruction stream of the change operation on the local Canvas layer. And the same content changing operation is carried out on the other client side, so that the synchronization of the content is realized.
Further, the instruction stream of the altering operation includes one or more non-splittable minimized instructions. For example, the instruction stream of the altering operation may include a position move instruction and a color modify instruction, wherein the position move instruction and the color modify instruction are each non-detachable minimize instructions. When pushing data to be synchronized, the central server can split the instruction stream of the change operation into an undetachable minimum instruction for changing the content of the Canvas layer of the Canvas of the synchronous target PPT, and the undetachable minimum instruction in the data to be synchronized is recorded as the minimum target instruction. In this way, if the central server performs the synchronous pushing of the target PPT page to the other client, the other client has already performed the position moving instruction in the instruction stream of the above-mentioned changing operation, at this time, the central server does not need to push the complete instruction stream of the changing operation, and only needs to push the color modifying instruction in the instruction stream of the changing operation as the minimum target instruction, so that the synchronization of the content changing can be realized. Therefore, the data to be synchronized, which is transmitted by the central server, can be minimized, the network bandwidth consumption is reduced, and the pushed client can quickly respond to the synchronized content.
The number of the minimized target instructions in the data to be synchronized may be one or more, and when the number of the minimized target instructions is plural, the plurality of the minimized target instructions may include instructions for the same element, such as instructions for editing the size, color, and position of a certain rectangle, respectively, and the plurality of the minimized target instructions may also include instructions for different elements, such as instructions for editing a certain rectangle and instructions for editing a certain circle.
Referring to fig. 2, in one embodiment, the Canvas layer and the PPT content layer are two different visual layers, and the display effect of the content of the Canvas layer displayed on the PPT content layer can be checked through the "preview" function of the editing interface of the target PPT page. In the embodiment illustrated in FIG. 2, a user may use a red dashed box to select a region of elements at the PPT content layer that need to be added to the Canvas layer and draw and edit the elements at the Canvas layer. When the drawing or editing of the Canvas layer is completed, elements (characters, graphics or animation) in the Canvas layer and contents in the PPT content layer can be combined and rendered to the same visual layer for output, so that the elements in the Canvas layer and the contents in the PPT content layer are displayed on the same visual layer, for example, the elements in the Canvas layer are exported to the PPT content layer for display, or the elements in the Canvas layer and the contents in the PPT content layer are exported to another visual layer for display.
In the process, before the merging rendering processing is performed, when an element A exists in a Canvas layer of a Canvas, a target PPT file of a target PPT page contains PPT content data of a PPT content layer and instruction data of the Canvas layer, which acts on the element A, and at the moment, the content of the Canvas layer of the Canvas is editable content. After the merging rendering processing is performed, elements in the Canvas layer are merged to visual layers outside the Canvas layer, so that no element A exists in the Canvas layer, the data of the new visual layer is structured data with the data structure identical to the PPT content data of the PPT content layer, at the moment, the target PPT file of the target PPT page only contains the PPT content data and does not contain instruction data of the Canvas layer, which acts on the element A, and the content (such as the element A) of the Canvas layer before merging becomes a non-editable state after merging.
Based on this, in step S14, the instruction data of the target PPT page in the target PPT file corresponding locally to the client is queried in order to determine whether the elements of the Canvas layer have been merged and rendered to other visual layers. If the instruction data in the target PPT file of the local client can be queried, the elements in the Canvas layer representing the local client are not merged and rendered to other visual layers, at the moment, the content of the Canvas layer can be edited, and the content in the Canvas layer can be edited by executing the minimized target instruction so as to carry out the content synchronization of the Canvas layer. If the instruction data of the Canvas layer in the target PPT file of the local client cannot be queried, the content of the Canvas layer representing the local client is converted into non-editable content and combined to a visual layer outside the Canvas layer, and the changing operation of content synchronization cannot be realized by executing the minimized target instruction on the Canvas layer, and further processing is needed.
For the data (referred to as PPT content change data) for changing the content of the PPT content layer in the content synchronization push, the PPT content layer before the merge rendering has the same data structure as the visual layer after the merge rendering, so that the PPT content change data can be applied to the content in the PPT content layer before the merge rendering or the content in the visual layer after the merge rendering, and no additional processing is required.
In step S15, when the target PPT file local to the client does not include instruction data, a Canvas layer cache file and a PPT content layer cache file corresponding to the target PPT file local to the client are obtained.
In one embodiment, before merging and rendering elements in a Canvas layer and contents in a PPT content layer to obtain a merged target PPT file, respectively caching respective data of the Canvas layer and the PPT content layer into independent files to obtain a Canvas layer cache file and a PPT content layer cache file corresponding to the target PPT file. And synthesizing and rendering the Canvas layer cache file and the PPT content layer cache file corresponding to the target PPT file to obtain the target PPT file.
When the target PPT file at the local client side does not contain instruction data, representing that the content of the Canvas layer is not editable, namely that the minimized target instruction cannot directly act on the current target PPT file to synchronize the content of the Canvas layer, so that the Canvas layer cache file corresponding to the target PPT file needs to be used as a medium for synchronizing the minimized target instruction, and the minimized target instruction is synchronized on the Canvas layer cache file corresponding to the Canvas layer cache file, so that the content of the Canvas layer corresponding to the Canvas layer cache file is synchronized to the target version, and then the Canvas layer cache file and the PPT content layer cache file of the target version are synthesized and rendered to obtain the synchronized target PPT file. Thus, the target PPT page in the synchronized target PPT file is the target PPT page after the content of the Canvas layer is synchronized.
Based on the above, when the target PPT file in the local client does not contain instruction data, the Canvas layer cache file and the PPT content layer cache file corresponding to the target PPT file need to be acquired from the local cache path of the client for the content of the target PPT page, so that when the target instruction cannot be minimized to directly act on the target PPT file after the merging and rendering processing, the Canvas layer cache file before the merging and rendering processing is utilized as the medium for synchronizing the content of the Canvas layer. In the process, the client does not need to request the target PPT file containing the instruction data from the central server again, so that the data quantity transmitted during the content synchronization can be reduced.
In step S16, the minimized target instruction is merged into the Canvas layer cache file of the Canvas to obtain the synchronized Canvas layer cache file of the Canvas.
The Canvas layer cache file includes instruction data for the Canvas layer, and the minimized target instruction is instruction data for a particular element of the Canvas layer, consistent with a data structure of the instruction data in the Canvas layer cache file. In one embodiment, the element that minimizes the effect of the target instruction may be determined as the target element, the instruction stream that acts on the target element is queried in the Canvas layer cache file, the minimized target instruction is incorporated into the instruction stream of the target element, and the minimized target instruction is incorporated into the Canvas layer cache file. And (3) the client side can draw the synchronized content of the Canvas layer of the target PPT page on the Canvas layer by executing the instruction stream in the synchronized Canvas layer cache file obtained by the merging processing in the step (S16).
In step S18, the synchronized Canvas layer cache file and PPT content layer cache file are synthesized and rendered to obtain a synchronized target PPT page.
In one embodiment, the step of performing composite rendering on the synchronized Canvas layer cache file and the PPT content layer cache file includes loading the synchronized Canvas layer based on the synchronized Canvas layer cache file, loading the PPT content layer (the synchronized PPT content layer if the PPT content layer also needs to be synchronized) based on the PPT content layer cache file, and performing merging rendering processing on the synchronized Canvas layer and the PPT content layer to obtain a synchronized target PPT page, where the Canvas layer cache file and the PPT content layer cache file are synthesized into the synchronized target PPT file.
In summary, the content synchronization method of online PPT of the embodiments of the present disclosure provides a solution for synchronizing the content of a Canvas layer of a target PPT page in a scenario where PPT page content is drawn based on Canvas elements. According to the first aspect, the contents of the Canvas layer can be obtained by executing instruction data drawing of the Canvas layer, so that if elements such as characters, graphics or animations of the PPT page are the contents drawn by the Canvas layer, only the instruction data of the Canvas layer are required to be transmitted when the contents are synchronized, and compared with a scheme for transmitting the contents of the elements (such as transmitting a graphic file), the data quantity transmitted when the contents are synchronized can be greatly reduced, and the network bandwidth consumption is reduced. In the second aspect, when the content of the Canvas layer is synchronized, the data to be synchronized pushed by the central server is an undetachable minimum target instruction of the Canvas layer, the data volume of the minimum target instruction depends on the current content of the Canvas layer of the client receiving the push, and the data volume of the data stream of the content, of which the content of the target version is changed relative to the current content of the client, can be smaller than or equal to the data volume of the data stream of the content, so that the data volume transmitted during the content synchronization is further reduced. In the third aspect, when the minimized target instruction pushed by the central server cannot directly act on the target PPT file locally stored in the client to perform content synchronization, the Canvas layer cache file locally stored in the client can be used as a medium of content synchronization, and then the synchronized Canvas layer cache file is used to generate the target PPT page after content synchronization, so that the client does not need to request the target PPT file containing instruction data from the central server again in the process, and the increase of the number of transmissions during content synchronization is further avoided.
In some embodiments of the present disclosure, step S16 may include steps S161 to S165 as shown in fig. 3.
In step S161, the version matching between the minimized target instruction and the Canvas layer cache file is verified.
In one embodiment, the version of the data to be synchronized pushed by the central server is the latest version of the target PPT page in the central server, and is recorded as the target version. At this time, the versions corresponding to the minimized target instruction in the data to be synchronized are all target versions. The version of the Canvas layer cache file cached locally by the client is the current version of the target PPT page of the client. That is, minimizing the version match between the target instruction and the Canvas layer cache file is the version match between the target version and the current version of the target PPT page of the client.
In one embodiment, the version of the target PPT page may be characterized by a version number, the first digit in the version number being referred to as the version number prefix. For example, version number "V3.0.2" has a version number prefix of 3. The content changing operation of the target PPT page by the user at the client is that the content changing operation caused by the editing operation of the user is not that caused by the synchronous updating, and the prefix of the version number of the target PPT page of the client is increased by 1 at most. Based on the data to be synchronized pushed by the central server based on one content change operation of the user on the target PPT page at the client, the data to be synchronized is mainly used for synchronizing two different versions of the target PPT page with the prefix difference of the version numbers smaller than or equal to 1. Based on the method, when the difference of the version number prefixes of the target PPT pages of two different versions is smaller than or equal to 1, the version numbers of the two target PPT pages are recorded as being matched, the data to be synchronized pushed by the central server can be directly utilized for version synchronization, and when the difference of the version number prefixes of the target PPT pages of two different versions is larger than 1, the version numbers of the two target PPT pages are recorded as being unmatched, and further processing is needed to carry out version synchronization.
In step S162, when the version matching degree characterizes the minimizing the version mismatch between the target instruction and the Canvas layer cache file, one or more intermediate versions minimizing the spacing between the target instruction and the Canvas layer cache file are determined. Version matching degree characterization minimizes version mismatch between a target instruction and Canvas layer cache files, namely, mismatch between a target version and a current version of a target PPT page of a client, and version faults exist in the middle. Each version of the fault is noted as an intermediate version.
For example, the target PPT page of the client is version V2, and the version corresponding to the minimized target instruction is version V5, for synchronizing the target PPT page of version V4 to version V5. In this case, if the space between the target instruction and the Canvas layer cache file is minimized by two versions V3 and V4, the client determines the version V3 and the version V4 as intermediate versions.
In step S163, an instruction acquisition request of an intermediate version synchronization instruction for synchronizing the version of the Canvas layer cache file to the intermediate version with the largest version number is sent to the server.
In one embodiment, the intermediate version synchronization instruction includes n versions of a synchronization instruction stream, one version of the synchronization instruction stream being used to synchronize instruction data of a previous version of the Canvas layer to the version of the synchronization instruction stream, n being the number of intermediate versions. For example, if the interval between the target instruction and the Canvas layer cache file is minimized by two versions V3 and V4, the intermediate version synchronization instruction includes 2 versions of synchronization instruction streams, respectively V3 version synchronization instruction streams, for synchronizing the instruction data of the Canvas layer of the V2 version to the V3 version, and V4 version synchronization instruction streams, for synchronizing the instruction data of the Canvas layer of the V3 version to the V4 version, so that the version of the Canvas layer cache file of the Canvas layer can be synchronized to the V4 version by the intermediate version synchronization instruction.
In step S164, the intermediate version synchronization instruction returned by the server and the minimization target instruction are combined into a content synchronization instruction stream.
In one embodiment of the disclosure, when obtaining the intermediate version synchronization instruction returned by the server, the client may obtain a content synchronization instruction stream by combining the intermediate version synchronization instruction and the minimizing target instruction in step S164, and then synchronously update the Canvas layer cache file based on the content synchronization instruction stream. Therefore, when the intermediate version synchronous instruction and the minimized target instruction are combined, the partially repeated or redundant instruction is combined into the unique instruction, so that the data volume of the cached file combined to the Canvas layer of the Canvas is reduced, and the data synchronization efficiency is improved.
In another embodiment of the present disclosure, when obtaining an intermediate version synchronization instruction returned by the server, the client may update the Canvas layer cache file version by version based on the intermediate version synchronization instruction, update the version of the Canvas layer cache file to the intermediate version with the largest version number, and then merge the minimized target instruction into the Canvas layer cache file updated version by version, to obtain the Canvas layer cache file after synchronization. Thus, the Canvas layer cache file after synchronization is updated version by the Canvas layer cache file before synchronization, so that the data loss of a certain version in the updating process can be avoided, and the data integrity of the Canvas layer cache file after synchronization is ensured.
In step S165, the content synchronization instruction stream is merged into the Canvas layer cache file of the Canvas to obtain a synchronized Canvas layer cache file of the Canvas. The content synchronization instruction stream obtained in step S164 includes instruction data that is missing in the Canvas layer cache file of the client local current version compared with the instruction data of the Canvas layer of the target version. Therefore, the content synchronization instruction stream is merged into the Canvas layer cache file of the Canvas layer, so that the Canvas layer cache file of the current version of the client has the instruction data of the Canvas layer of the target version, and the Canvas layer cache file of the current version of the client can be synchronized to the target version.
In some embodiments of the present disclosure, step S164 may include steps S1641 to S1642 as shown in fig. 4.
In step S1641, an instruction having an operation conflict with the minimized target instruction among the intermediate version synchronization instructions returned by the server is determined as a conflict instruction. The instruction with operation conflict refers to an instruction for editing the same attribute of the same element of the Canvas layer. For example, if one of the intermediate version synchronization instructions is used to modify the color of a rectangle (see fig. 2) to blue and the minimizing target instruction is used to modify the color of a rectangle to red, then that instruction in the intermediate version synchronization instruction is deemed to have an operational conflict with the minimizing target instruction, and that instruction is determined to be a conflicting instruction. In other examples, the conflict instruction may be an instruction for editing the position, shape, size, transparency, and other properties of the elements of the Canvas layer, which is not limited herein.
In step S1642, the non-conflicting instructions and the minimized target instruction in the intermediate version-synchronous instruction are sequentially integrated based on the version number to obtain a content-synchronous instruction stream. In embodiments of the present disclosure, the conflicting instructions act on the same attributes of the same element as the minimizing target instruction, and the version of the conflicting instructions lags behind the version of the minimizing target instruction. Based on this, the result of execution of the minimized target instruction to overlap the conflicting instruction is made the same as the result of execution of the conflicting instruction and the minimized target instruction to edit the element. For example, suppose that an element that the conflict instruction and the minimization target instruction co-act with is denoted element a, the conflict instruction is for modifying the position of element a to coordinates (X1, Y1), and the minimization target instruction is for modifying the position of element a to coordinates (X2, Y2). The conflict instruction and the minimized target instruction are sequentially executed on the Canvas layer, and compared with the minimized target instruction, the minimized target instruction is executed only, the result is that the position of the element A is modified to be coordinates (X2, Y2). That is, execution of the conflict instructions may be skipped when updating the element content of the Canvas layer based on the intermediate version sync instruction and the minimize target instruction. Therefore, when the intermediate version synchronous instruction is integrated and the target instruction is minimized to obtain the content synchronous instruction stream, the conflict instruction is not required to be integrated into the content synchronous instruction stream, the data volume of the content synchronous instruction stream can be reduced, and the computing resource when the element content of the Canvas layer is changed based on the content synchronous instruction stream is saved.
The integration of instructions is performed based on the order of version numbers, and the execution order of instructions is integrated according to the order of version numbers from old to new. For example, the non-conflict instructions in the intermediate version synchronous instruction comprise a non-conflict instruction of a V3 version and a non-conflict instruction of a V4 version, the minimizing target instruction is an instruction of a V5 version, and the integrated instruction execution sequence is sequentially the non-conflict instruction of the V3 version, the non-conflict instruction of the V4 version and the minimizing target instruction of the V5 version, which are used as the instructions in the content synchronous instruction stream. In this way, the problem of instruction logic conflict can be avoided, for example, the instruction of the V3 version is the generation element A, the instruction of the V5 version is the change of the size of the element A, and then the instruction of the V5 version cannot be executed before the instruction of the V3 version.
In some embodiments of the present disclosure, the content synchronization method M10 of the online PPT may further include step S11 as shown in fig. 5.
In step S11, the Canvas layer and the PPT content layer of the target PPT page are merged into the same visual layer. And merging the Canvas layer and the PPT content layer of the target PPT page into the same visual layer, specifically merging the content of the Canvas layer and the content of the PPT content layer into the same visual layer for display.
In one embodiment, the Canvas layer obtains Canvas elements through JavaScript and operates the attributes of the Canvas elements to draw dynamic content on the Canvas layer. On the other hand, the data structure of the PPT content layer (such as PPTX format) only supports the storage of static content (shape, picture, text, etc.), and cannot be directly compatible with the data of the Canvas layer of Canvas. Thus, there is a need to translate the content of the Canvas layer into static content export to merge the content of the Canvas layer's inner and PPT content layers into the same visual layer.
After the content of the Canvas layer is exported, the PPT file does not contain instruction data corresponding to the dynamic content of the Canvas layer, so that whether the content of the Canvas layer is exported or not can be judged based on whether the PPT file contains the instruction data of the Canvas layer or not, and different synchronous change schemes can be selected based on the content export condition of the Canvas layer when the content of the Canvas layer is synchronously changed. That is, when the content of the Canvas layer is not exported, the minimizing target instruction may be executed at the Canvas layer to perform the content synchronization change of the Canvas layer. When the content of the Canvas layer is exported, the Canvas layer cache file is used as the medium for the content synchronization change of the Canvas layer to perform the content synchronization.
In one embodiment, the PPT content layer is used as a reference visual layer, dynamic content of the Canvas layer is converted into static content and exported to the PPT content layer, and the exported content of the Canvas layer is displayed on the PPT content layer. After export, the Canvas layer content is emptied and the PPT content layer adds the Canvas layer content.
In yet another embodiment, the content of the Canvas layer and the content of the PPT content layer are rendered to a new visual layer display, the data structure of the new visual layer being the same as the data structure of the PPT content layer. After the rendering is completed, the contents of the Canvas layer and the PPT content layer are emptied, and the data of the new visual layer is used as a PPT file.
In some embodiments of the present disclosure, step S11 may include steps S111 to S114 as shown in fig. 6.
In step S111, a Canvas layer and a PPT content layer are displayed on an online page of the target PPT file, and the online page is displayed as the target PPT page. The online page of the target PPT file is obtained by loading the target PPT file on a browser page of a client side and is used as the target PPT page of the target PPT file.
In one embodiment, the Canvas layer is initially in a hidden state and only the contents of the PPT content layer are displayed on the target PPT page for editing of the PPT document by the user. When graphics, animation or texts with certain styles are required to be drawn, the Canvas layer can be converted into a display state, and elements such as graphics, animation or texts are drawn on the Canvas layer, so that the Canvas layer displays drawn contents. If other clients perform content changing operation on Canvas layers of Canvas, the content changing operation is performed on Canvas layers of Canvas of the current client synchronously based on a minimized target instruction pushed by the center server.
In step S112, in response to the content merging operation on the target PPT page, the instruction data of the Canvas layer and the PPT structured data of the PPT content layer are cached to obtain a Canvas layer cache file and a PPT content layer cache file, respectively.
When the client determines that the content drawing of the Canvas layer is completed, the content of the Canvas layer and the content of the PPT content layer can be combined through the content combining operation of the target PPT page. Because the data structure of the combined visual layer is the same as that of the PPT content layer, only static content can be stored, and the dynamic content and instruction data corresponding to the dynamic content are not contained any more. Therefore, after the Canvas layer and the PPT content layer are combined, if other clients perform content changing operations on the Canvas layer, the content changing cannot be performed synchronously on the combined visual layer based on the minimized target instruction. Therefore, it is desirable to cache instruction data of the Canvas layer before merging the contents of the Canvas layer and the PPT content layer into the same visual layer to preserve editable Canvas layer data for synchronizing the content changes of the Canvas layer. The cached instruction data of the Canvas layer of the Canvas is stored as a Canvas layer cache file independent of the target PPT file, so that the next content drawing of the Canvas layer of the Canvas on the target PPT page is prevented from being influenced.
Further, since the merged visual layer already contains the content of the uneditable Canvas layer, the content synchronization of the Canvas layer is performed on the basis of the merged visual layer. Based on the above, in response to the content merging operation on the target PPT page, the instruction data of the Canvas layer is cached, and meanwhile, the PPT structured data of the PPT content layer is also required to be cached, so that the data of the PPT content layer, which is not mixed with the content of the Canvas layer, is reserved for the content of the Canvas layer after the mixed synchronization. The PPT structured data of the cached PPT content layer is stored as a PPT content layer cache file independent of the target PPT file, so that interference to the merged visual layer in the target PPT file is avoided.
In step S113, when the Canvas layer cache file and the PPT content layer cache file are generated, the Canvas layer and the PPT content layer are combined and rendered to obtain a composite page layer. The composite page layer is a visual layer for displaying the combined content after combining the content of the Canvas layer and the PPT content layer.
When Canvas layer cache files and PPT content layer cache files are generated, instruction data representing Canvas layers and PPT structural data representing PPT content layers are reserved, so that the content synchronization of the Canvas layers and the PPT content layers after being combined can be supported, at the moment, the content synchronization of the Canvas layers can not be influenced by the data of the Canvas layers and the PPT content layers, and the combined rendering processing of the Canvas layers and the PPT content layers can be performed, so that a synthetic page layer is obtained.
In step S114, the composite page layer is displayed on the online page of the target PPT file, and the online page is displayed as the target PPT page. When the target PPT page displays the composite page layer, the content contained in the composite page layer comprises the content of the Canvas layer and the content of the PPT content layer before the merging treatment.
In one embodiment, the composite page layer is taken as the new PPT content layer. If the user needs to edit the content of the PPT content layer, corresponding editing operation can be performed on the composite page layer. If the user draws new elements on the Canvas layer of the Canvas on the online page, the composite page layer can be regarded as a PPT content layer in the merging rendering task, PPT structured data of the composite page layer are cached, and merging rendering processing is carried out on the Canvas layer and the composite page layer to obtain a new composite page layer, wherein the new composite page layer contains the elements newly drawn by the user on the Canvas layer.
In some embodiments of the present disclosure, the content synchronization method M10 of the online PPT may further include step S12 as shown in fig. 7.
In step S12, in response to the content change operation of the Canvas layer of the target PPT page, content change operation instruction data corresponding to the content change operation is uploaded to the server. The server is used for splitting the content changing operation instruction data into a plurality of non-separable minimized changing operation instructions for synchronizing the content changing operation. If the content change operation instruction itself is an undetachable minimization instruction, it is not required to be subjected to splitting processing, but is determined as the minimization change operation instruction.
For example, when the user performs a displacement operation and a color change operation on the element a of the Canvas layer to change the content of the Canvas layer, the content change operation instruction data corresponding to the change operation of the content of the Canvas layer is an instruction stream including a displacement operation instruction and a color change operation instruction. After the client side uploads the content change operation instruction data to the central server, the central server splits the content change operation instruction data into a displacement operation instruction and a color change operation instruction. In this way, when the central server synchronizes this content change operation to the other client, if the other client has already performed the same displacement operation, the server can push the color change operation instruction to the client as the minimization target instruction without pushing the displacement operation instruction. Therefore, the data volume required to be transmitted for content synchronization of the target PPT page can be reduced, and the network bandwidth consumption is reduced.
In some embodiments of the present disclosure, the content synchronization method M10 of the online PPT may further include step S17 as shown in fig. 8.
In step S17, when the data to be synchronized further includes an undetachable minimum PPT content change field of the PPT content layer, the minimum PPT content change field is merged into the PPT content layer cache file local to the client, so as to obtain the synchronized PPT content layer cache file.
The data of the PPT content layer is static data. When the content of the PPT content layer is changed, the changed inseparable minimized data is a field. For example, when the text paragraph of the PPT content layer needs to be changed, the content of the text field corresponding to the text paragraph only needs to be changed. Based on this, when the central server needs to synchronize the content change of the PPT content layer to the client, the minimized PPT content change field for changing the content of the PPT content layer may be pushed to the client as data to be synchronized for content synchronization of the PPT content layer.
In the case where the Canvas layer and the PPT content layer of the client have been merged, it is necessary to synchronize the content of the Canvas layer change with the Canvas layer cache file. And carrying out synthetic rendering treatment on the synchronized Canvas layer cache file and the PPT content layer cache file to obtain a synchronized target PPT page. On this basis, if the data to be synchronized also includes a minimized PPT content change field, the content characterizing the PPT content layer also needs to be synchronously changed. In this case, before the synchronized Canvas layer cache file and the PPT content layer cache file are subjected to the synthetic rendering processing, the minimized PPT content change field is merged into the local PPT content layer cache file of the client to obtain the synchronized PPT content layer cache file, so that the synchronized PPT content layer cache file contains the content of the synchronized PPT content layer after the synchronization change, and then the synchronized Canvas layer cache file and the synchronized PPT content layer cache file are subjected to the synthetic rendering processing to obtain the synchronized target PPT page, so that the synchronized target PPT page contains the content of the synchronized Canvas layer and the content of the synchronized PPT content layer.
In one embodiment, the minimized PPT content modification field is incorporated into a PPT content layer cache file local to the client, which may specifically be the overwriting of the content of the minimized PPT content modification field to the content of the same field in the PPT content layer cache file. For example, if the minimized PPT content modification field is a "text" field, the minimized PPT content modification field may be incorporated into a PPT content layer cache file local to the client, where the content of the "text" field in the PPT content layer cache file is replaced with the content of the minimized PPT content modification field.
Based on any one of the above embodiments, the present disclosure further provides a content synchronization device of an online PPT. Fig. 9 is a block diagram schematically illustrating the structure of a content synchronization device of an online PPT according to an embodiment of the present disclosure.
As shown in fig. 9, the content synchronization device of the online PPT includes a push response module 110, a query module 120, a cache file acquisition module 130, a synchronization module 140, and a synthesis module 150.
The push response module 110 is configured to obtain, in response to the content-synchronized push of the target PPT page, data to be synchronized in the content-synchronized push, where the data to be synchronized is used to synchronize the content of the target PPT page of the client to the target version. The query module 120 is configured to query instruction data of a target PPT page for drawing elements at a Canvas layer of a Canvas in a target PPT file locally corresponding to a client when data to be synchronized includes an undetachable minimized target instruction of the Canvas layer of the target PPT page. The cache file obtaining module 130 is configured to obtain a Canvas layer cache file and a PPT content layer cache file corresponding to a target PPT file local to the client when the target PPT file local to the client does not include instruction data. The synchronization module 140 is configured to combine the minimized target instruction into a Canvas layer cache file to obtain a Canvas layer cache file after synchronization. The composition module 150 is configured to perform a composition rendering process on the synchronized Canvas layer cache file and the PPT content layer cache file to obtain a synchronized target PPT page.
The content synchronization device of the online PPT may be computer software, and each module thereof may be a computer software module, and the implementation process of the functions and roles of each module in the content synchronization device of the online PPT is specifically described in the implementation process of the corresponding steps in the method, which is not described herein.
Based on any of the above embodiments, the present disclosure also provides an electronic device that may perform the content synchronization method of the online PPT of any of the above embodiments of the present disclosure.
Fig. 10 is a block diagram illustrating a structure of an electronic device 1000 according to an embodiment of the present disclosure.
The hardware structure of the electronic device 1000 may be implemented using a bus architecture. The bus architecture may include any number of interconnecting buses and bridges depending on the specific application of the hardware and the overall design constraints. Bus 1100 connects together various circuits including one or more processors 1200, memory 1300, and/or hardware modules. Bus 1100 may also connect various other circuits 1400, such as peripherals, voltage regulators, power management circuits, external antennas, and the like.
Bus 1100 may be an industry standard architecture (ISA, industry Standard Architecture) bus, a peripheral component interconnect (PCI, PERIPHERAL COMPONENT) bus, or an extended industry standard architecture (EISA, extended Industry Standard Component) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, only one connection line is shown in the figure, but not only one bus or one type of bus.
The present disclosure also provides a readable storage medium having stored therein a computer program for implementing the above method when executed by a processor. A "readable storage medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples of a readable storage medium include an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, a portable read-only memory (CDROM), and so forth.
The present disclosure also provides a computer program product, and the methods of the present disclosure may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed, the processes or functions of the present disclosure are performed in whole or in part.
The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website site, computer, server, or data center to another website site, computer, server, or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. Usable media may be magnetic media such as floppy disks, hard disks, magnetic tape, optical media such as digital video disks, and semiconductor media such as solid state disks. The computer readable storage medium may be volatile or nonvolatile storage medium, or may include both volatile and nonvolatile types of storage medium.
It will be apparent to those skilled in the art that embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the disclosure. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable online PPT content synchronization device, such that the instructions, which execute via the processor of the computer or other programmable online PPT content synchronization device, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable online PPT content synchronization device to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable online PPT content synchronization device such that a series of operational steps are performed on the computer or other programmable device to produce a computer implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In the description of the present specification, reference to the terms "one embodiment/manner," "some embodiments/manner," "example," "specific example," or "some examples," etc., means that a particular feature, structure, or characteristic described in connection with the embodiment/manner or example is included in at least one embodiment/manner or example of the present disclosure. In this specification, the schematic representations of the above terms are not necessarily for the same embodiment/manner or example. Furthermore, the particular features, structures, or characteristics described may be combined in any suitable manner in any one or more embodiments/manners or examples. Furthermore, the various embodiments/modes or examples described in this specification and the features of the various embodiments/modes or examples can be combined and combined by persons skilled in the art without contradiction.
It will be appreciated by those skilled in the art that the above-described embodiments are merely for clarity of illustration of the disclosure, and are not intended to limit the scope of the disclosure. Other variations or modifications will be apparent to persons skilled in the art from the foregoing disclosure, and such variations or modifications are intended to be within the scope of the present disclosure.