CN113535168A - JSON-based front end revocation method and related device - Google Patents

JSON-based front end revocation method and related device Download PDF

Info

Publication number
CN113535168A
CN113535168A CN202110789012.7A CN202110789012A CN113535168A CN 113535168 A CN113535168 A CN 113535168A CN 202110789012 A CN202110789012 A CN 202110789012A CN 113535168 A CN113535168 A CN 113535168A
Authority
CN
China
Prior art keywords
json
page
data
revocation
received
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.)
Withdrawn
Application number
CN202110789012.7A
Other languages
Chinese (zh)
Inventor
汪晓凯
范渊
黄进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
DBAPPSecurity Co Ltd
Original Assignee
DBAPPSecurity Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by DBAPPSecurity Co Ltd filed Critical DBAPPSecurity Co Ltd
Priority to CN202110789012.7A priority Critical patent/CN113535168A/en
Publication of CN113535168A publication Critical patent/CN113535168A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a JSON-based front end revocation method, which comprises the following steps: abstracting page content according to a JSON format to obtain JSON page data; modifying the JSON page data according to the received page modification operation to obtain JSON difference data; and when a revocation command corresponding to the page modification operation is received, restoring the page content according to the JSON difference data. The JSON page data is modified when the page modification operation is received to obtain JSON differential data, and the page content is recovered according to the JSON differential data instead of performing page recovery according to the full data when the cancel operation is performed, so that the occupation of the JSON data on the memory space is reduced, and the utilization rate of hardware resources is improved. The application also discloses a JSON-based front end revocation device, a server and a computer-readable storage medium, which have the beneficial effects.

Description

JSON-based front end revocation method and related device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a JSON-based front-end revocation method, a front-end revocation apparatus, a server, and a computer-readable storage medium.
Background
With the continuous development of internet technology, more and more applications can be used through web pages. For example, web chat is performed by a web application, document editing is performed by a web application, and complicated operations are performed by a web application. Therefore, more and more software functions can be realized through the webpage application, and the functions of the webpage application are more and more fit with the actual software functions. For example, undo or redo functions are performed in the editor of the web page.
In the related art, for the front-end application with the function of canceling the heavy work, the front-end and back-end communication modes can be adopted, but the method depends on network transmission and is low in efficiency. It can also be implemented only by the front end, but it wastes memory space or encounters difficulty in operation step storage, data modification. That is, in the related art, the front-end mode is adopted for revocation data storage, which occupies a large amount of front-end storage space, resulting in space waste and reduction in the utilization rate of hardware resources.
Therefore, how to reduce the memory space occupied by the undo operation is a major concern for those skilled in the art.
Disclosure of Invention
The application aims to provide a JSON-based front-end revocation method, a JSON-based front-end revocation device, a server and a computer-readable storage medium, so as to reduce memory space occupied by a page editing function.
In order to solve the above technical problem, the present application provides a JSON-based front-end revocation method, including:
abstracting page content according to a JSON format to obtain JSON page data;
modifying the JSON page data according to the received page modification operation to obtain JSON difference data;
and when a revocation command corresponding to the page modification operation is received, restoring the page content according to the JSON difference data.
Optionally, modifying the JSON page data according to the received page modification operation to obtain JSON difference data, including:
modifying the page content according to the received page modification operation to obtain the current page content;
modifying the JSON page data according to the current page content to obtain current JSON page data;
and carrying out difference comparison on the JSON page data and the current JSON page data to obtain the JSON difference data.
Optionally, the JSON difference data includes an operation type and operation data.
Optionally, when a cancel command corresponding to the page modification operation is received, restoring the page content according to the JSON difference data includes:
when a cancel command corresponding to the page modification operation is received, modifying JSON page data corresponding to the page content according to the JSON difference data to obtain recovered JSON page data;
and restoring the page content according to the restored JSON page data.
Optionally, the method further includes:
and when a redo command corresponding to the undo command is received, executing a re-modification operation on the page content according to the corresponding JSON difference data to obtain new page content.
Optionally, abstracting the page content according to the JSON format to obtain JSON page data, including:
abstracting page content according to a JSON format to obtain JSON page data, and initializing to obtain an operation position mark and an operation step set;
correspondingly, modifying the JSON page data according to the received page modification operation to obtain JSON difference data, and the method comprises the following steps:
modifying the JSON page data according to the received page modification operation to obtain JSON difference data;
and saving the JSON difference data to the operation step set, and modifying the operation position mark.
Optionally, modifying the JSON page data according to the received page modification operation to obtain JSON difference data, including:
modifying the JSON page data according to the received page modification operation to obtain the current JSON page data;
and performing difference comparison on the JSON page data and the current JSON page data through a jsondiffpatch plug-in to obtain the JSON difference data.
The present application further provides a JSON-based front-end revocation apparatus, including:
the page abstraction module is used for abstracting page contents according to the JSON format to obtain JSON page data;
the difference data acquisition module is used for modifying the JSON page data according to the received page modification operation to obtain JSON difference data;
and the page revocation module is used for restoring the page content according to the JSON difference data when a revocation command corresponding to the page modification operation is received.
The present application further provides a server, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the JSON-based front-end revocation method as described above when executing the computer program.
The present application also provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the JSON-based front-end revocation method as described above.
The JSON-based front end revocation method comprises the following steps: abstracting page content according to a JSON format to obtain JSON page data; modifying the JSON page data according to the received page modification operation to obtain JSON difference data; and when a revocation command corresponding to the page modification operation is received, restoring the page content according to the JSON difference data.
The JSON page data is modified when the page modification operation is received to obtain JSON differential data, and the page content is recovered according to the JSON differential data instead of performing page recovery according to the full data when the cancel operation is performed, so that the occupation of the JSON data on the memory space is reduced, and the utilization rate of hardware resources is improved.
The application also provides a JSON-based front end revocation device, a server and a computer-readable storage medium, which have the beneficial effects, and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a JSON-based front-end revocation method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a JSON-based front-end revocation apparatus according to an embodiment of the present disclosure.
Detailed Description
The core of the application is to provide a JSON-based front-end revocation method, a front-end revocation device, a server and a computer-readable storage medium, so as to reduce the memory space occupied by the page editing function.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the related art, for the front-end application with the function of canceling the heavy work, the front-end and back-end communication modes can be adopted, but the method depends on network transmission and is low in efficiency. It can also be implemented only by the front end, but it wastes memory space or encounters difficulty in operation step storage, data modification. That is, in the related art, the front-end mode is adopted for revocation data storage, which occupies a large amount of front-end storage space, resulting in space waste and reduction in the utilization rate of hardware resources.
Therefore, the JSON-based front-end revocation method provided by the application modifies JSON page data when page modification operation is received to obtain JSON differential data, and restores page contents according to the JSON differential data instead of performing page restoration according to full data when revocation operation is performed, so that occupation of JSON data on a memory space is reduced, and utilization rate of hardware resources is improved.
The following describes, by an embodiment, a JSON-based front-end revocation method provided in the present application.
Referring to fig. 1, fig. 1 is a flowchart of a JSON-based front-end revocation method according to an embodiment of the present disclosure.
In this embodiment, the method may include:
s101, abstracting page content according to a JSON format to obtain JSON page data;
the page content is abstracted according to the JSON format to obtain JSON page data. That is, the page content is abstracted into data in JSON format for subsequent determination and quantification of the state of the page data so that operations can be subsequently withdrawn.
The JSON (JavaScript Object notification) format is a lightweight data exchange format. It stores and represents data in a text format that is completely independent of the programming language, based on a subset of ECMAScript (js specification set by the european computer association). The compact and clear hierarchy makes JSON an ideal data exchange language. The network transmission method is easy to read and write by people, is easy to analyze and generate by machines, and effectively improves the network transmission efficiency.
The method for abstracting the page content according to the JSON format to obtain the JSON page data may refer to any one of abstraction methods provided in the prior art, and is not specifically limited herein.
In a specific scenario, this step may include:
and abstracting the page content according to the JSON format to obtain JSON page data, and initializing to obtain an operation position mark and an operation step set.
That is to say, in this alternative, besides obtaining JSON page data by abstracting page contents, an operation position marker and an operation step set are obtained by initialization. Specifically, the movement of the operation position mark to the start position can be represented by 0. And clearing the operation step set.
Accordingly, S102 may include:
step 1, modifying JSON page data according to received page modification operation to obtain JSON difference data;
and 2, saving the JSON difference data to an operation step set, and modifying the operation position mark.
It can be seen that this step is intended to illustrate how JSON difference data is obtained on the basis of the operation position tags and the operation step sets. In the alternative, modifying JSON page data according to received page modification operation to obtain JSON difference data; then, the JSON difference data is saved to the operation step set, and the operation position mark is modified.
S102, modifying JSON page data according to the received page modification operation to obtain JSON difference data;
on the basis of S101, this step aims to modify JSON page data according to the received page modification operation, so as to obtain JSON difference data. That is, JSON difference data between before and after the page modification operation is performed is acquired.
Mainly, it is considered that, in the prior art, the full amount of data of the editing process in the editing process is generally stored to obtain JSON full amount of data, so that data recovery and redo are performed according to the JSON full amount of data when withdrawing or redoing. However, saving JSON full data in the front-end page increases the memory usage, is not favorable for the operation of the page and the browser, and reduces the utilization rate of performance resources.
The JSON difference data comprises an operation type and operation data. The operation type may be different operation types according to different operation objects. For example, when the operation object is a picture, the operation type is a shift type, a left shift, a right shift, or the like. When the operation object is a text, the operation type is an edit type, a delete, an add, or the like. The operation data is specific operation data.
Optionally, this step may include:
step 1, modifying the page content according to the received page modification operation to obtain the current page content;
step 2, modifying the JSON page data according to the content of the current page to obtain the current JSON page data;
and step 3, performing difference comparison on the JSON page data and the current JSON page data to obtain JSON difference data.
It can be seen that the alternative scheme mainly describes how to obtain JSON difference data. In the alternative scheme, the page content is modified according to the received page modification operation to obtain the current page content; modifying the JSON page data according to the current page content to obtain the current JSON page data; and performing difference comparison on the JSON page data and the current JSON page data to obtain JSON difference data.
Optionally, this step may include:
step 1, modifying JSON page data according to received page modification operation to obtain current JSON page data;
and 2, carrying out difference comparison on the JSON page data and the current JSON page data through the jsondiffpatch plug-in to obtain JSON difference data.
It can be seen that the alternative scheme mainly describes how to obtain JSON difference data. In the alternative scheme, the JSON page data is modified according to the received page modification operation to obtain the current JSON page data; and performing difference comparison on the JSON page data and the current JSON page data through the jsondiffpatch plug-in to obtain JSON difference data. The jsondiff fpatch plug-in is a javascript library which compares two json documents, texts, arrays and the like and generates diff and patch information, and the javascript library supports output of various formats and provides a visual interface.
And S103, when a revocation command corresponding to the page modification operation is received, restoring the page content according to the JSON difference data.
On the basis of S102, this step is intended to recover the page content according to the JSON difference data when a cancel command corresponding to the page modification operation is received.
The undo command is an operation of an editor to undo the editing process of the current content. For example, a word is deleted and if it is revoked, it is restored.
The recorded JSON difference data represents difference data before and after modification. Therefore, the recovery process needs to recover through the current page content.
Optionally, this step may include:
step 1, when a cancel command corresponding to a page modification operation is received, modifying JSON page data corresponding to page contents according to JSON difference data to obtain recovered JSON page data;
and 2, restoring the page content according to the restored JSON page data.
It can be seen that the present alternative is primarily illustrative of how recovery may be performed. In the alternative scheme, when a cancel command corresponding to the page modification operation is received, JSON page data corresponding to the page content is modified according to the JSON difference data to obtain recovered JSON page data; and restoring the page content according to the restored JSON page data.
Optionally, this embodiment may further include:
and when a redo command corresponding to the undo command is received, re-modifying the page content according to the corresponding JSON difference data to obtain new page content.
In addition, in this embodiment, in addition to receiving the undo command, a redo instruction may also be received. In order to redo the content of the undo operation. For example, the content before revocation is restored.
In summary, in the embodiment, the JSON page data is modified when the page modification operation is received, so as to obtain JSON difference data, and the page content is restored according to the JSON difference data instead of performing page restoration according to full data when the undo operation is performed, so that the occupation of the JSON data on the memory space is reduced, and the utilization rate of hardware resources is improved.
The JSON-based front-end revocation method provided by the present application is further described below by a specific embodiment.
In this embodiment, the method may include:
step 1, using JSON data to abstract and express page content;
step 2, initializing and storing data, namely abstract JSON data (data obtained in the first step), a position mark (no operation is set to be 0 at the beginning) and a step set (no historical operation step is currently represented by a null array);
wherein, the position mark indicates the position of the current operation and is represented by a number. The initial value is 0, the operation mark of each step is added with 1 in normal operation, the cancel operation mark is subtracted with 1, and the redo operation mark is added with 1. Whether undo redo is currently possible may be determined based on the location stamp and the number of sets of steps: when the position mark is more than or equal to the step set number, the method indicates that only the revocation operation can be performed currently; when the position mark is less than the step set number and greater than 0, the current undo redo operation can be performed; when the position mark is equal to 0 and the step set number is more than 0, the fact that only redo operation can be performed currently is shown; when the position flag is equal to 0 and the step set number is equal to 0, it indicates that neither undo nor redo is currently possible. And taking out the corresponding required difference data from the step set according to the position mark when canceling or redoing: and when the position mark is n, withdrawing the nth data of the step set, and redoing the nth +1 data of the step set.
The step set is a JSON array, and each piece of content in the step set is a JSON object. The JSON object is difference data obtained by calculating JSON data of the pages before and after operation, and the abstract representation shows what content of the pages is modified by the operation. Compared with the method for directly storing the full data of the page, especially when the data amount of the page is large, the method for storing the differential data can greatly reduce the data amount of the storage and save the storage space.
Step 3, when the user modifies the page content in each step of operation, modifying JSON data to correspond to the current page content, then obtaining difference content data of previous and next JSON data by utilizing a JSON data processing plug-in, storing the difference content data into the step set, and changing the position mark to 1 to indicate that the current operation position is the position of the first step;
the method for processing the JSON data difference can be any one provided by the prior art, and some open-source processing plug-ins can be directly used. Take the open-source plug-in jsondifffpatch as an example:
the abstraction represents the position and size information of a piece of content on the page, with distance 0 from the left edge, distance 0 from the top edge, width 100, and height 100.
Figure BDA0003160139790000081
Figure BDA0003160139790000091
Data sample after move:
the operation moves to the right 100 at a distance of 100 from the left margin 100 and at a distance of 0 from the top margin, 100 wide and 100 high
Figure BDA0003160139790000092
The diff method of jsondiff patch is called to obtain the difference data difference corresponding to the operation (positon, positon _ new).
The difference is obtained, only the left margin is changed, the first bit of the array stores the left margin 0 of the initial data, the second bit of the array stores the left margin 100 of the data after operation, and the upper margin, the width and the height are consistent so that the difference data is not shown.
difference={
left:[0,100]
}。
Therefore, the difference data is obviously smaller than the original data size, and a large amount of storage space can be saved when the page is complex and the whole data size is large.
And 4, triggering a cancel or redo instruction by the user, and executing according to the JSON difference data in the step set.
When the command is a cancel command, one step of operation is judged in the step set, and the current operation position is in the first step, so that the command can be cancelled. And then, a revocation operation is carried out, the data a at the first position in the step set is taken, and the position mark is changed to 0. And then, by using the JSON data processing plug-in, new JSON data can be obtained by using the data a and the current JSON data.
When the instruction is a redo instruction, only one operation is performed in the judgment step set, and the position mark is 1, so that the redo operation cannot be performed.
Specifically, when the command is to be cancelled, the page is returned to the position before the operation, that is, the data of the previous step needs to be obtained,
at this time, the current page data positon _ new and the difference data difference of this operation may be obtained by a reverse method of jsondiff & pat (the previous operation is shifted to the right by 100, the left value 0 becomes 100, the reverse corresponding difference data should be shifted to the left by 100, and the left value 100 becomes 0).
reverseDifference=jsondiffpatch.reverse(difference);
The results were obtained:
reverseDifference={
left:[100,0]
}。
calling the patch method of jsondiffpatch can obtain the data after revocation:
position_revoke=jsondiffpatch.patch(position_new,reverseDifference)。
the results were obtained:
Figure BDA0003160139790000101
it can be seen that the results obtained are consistent with the pre-operational data position. And at the moment, rollback operation can be carried out, and the corresponding processing method is the same as the step 3, and only parameters transmitted in the process of calling the method need to be modified.
position_redo=jsondiffpatch.patch(position_revoke,difference)。
Step 5, modifying the page display content according to the current JSON data;
and 6, finishing the complete undo and redo operation in one step.
Therefore, in the embodiment, the JSON page data is modified when the page modification operation is received, so that JSON differential data is obtained, and the page content is restored according to the JSON differential data instead of performing page restoration according to full data when the undo operation is performed, so that the occupation of the JSON data on the memory space is reduced, and the utilization rate of hardware resources is improved.
In the following, the JSON-based front-end revocation device provided in the embodiment of the present application is introduced, and the JSON-based front-end revocation device described below and the JSON-based front-end revocation method described above may be referred to correspondingly.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a JSON-based front-end revocation apparatus according to an embodiment of the present disclosure.
In this embodiment, the apparatus may include:
the page abstraction module 100 is used for abstracting page contents according to a JSON format to obtain JSON page data;
the difference data acquisition module 200 is configured to modify the JSON page data according to the received page modification operation, so as to obtain JSON difference data;
and the page revocation module 300 is configured to, when a revocation command corresponding to the page modification operation is received, restore the page content according to the JSON difference data.
Optionally, the page abstraction module 100 is specifically configured to modify the page content according to the received page modification operation, so as to obtain the current page content; modifying the JSON page data according to the current page content to obtain the current JSON page data; and performing difference comparison on the JSON page data and the current JSON page data to obtain JSON difference data.
Optionally, the JSON difference data includes an operation type and operation data.
Optionally, the page revocation module 300 is specifically configured to, when a revocation command corresponding to a page modification operation is received, modify JSON page data corresponding to page content according to the JSON difference data, to obtain recovered JSON page data; and restoring the page content according to the restored JSON page data.
Optionally, the apparatus may further include:
and the page redo module is used for executing a re-modification operation on the page content according to the corresponding JSON difference data to obtain new page content when a redo command corresponding to the undo command is received.
Optionally, the page abstraction module 100 is specifically configured to abstract page content according to a JSON format to obtain JSON page data, and initialize the JSON page data to obtain an operation position tag and an operation step set;
correspondingly, the page revocation module 300 is specifically configured to modify JSON page data according to the received page modification operation, so as to obtain JSON difference data; saving the JSON difference data to the operation step set, and modifying the operation position mark.
Optionally, the page revocation module 300 is specifically configured to modify JSON page data according to the received page modification operation, so as to obtain current JSON page data; and performing difference comparison on the JSON page data and the current JSON page data through the jsondiffpatch plug-in to obtain JSON difference data.
An embodiment of the present application further provides a server, including:
a memory for storing a computer program;
a processor for implementing the steps of the JSON-based front-end revocation method as described in the above embodiments when executing the computer program.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the JSON-based front-end revocation method according to the above embodiments.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The JSON-based front-end revocation method, the front-end revocation apparatus, the server, and the computer-readable storage medium provided by the present application are described in detail above. The principles and embodiments of the present application are explained herein using specific examples, which are provided only to help understand the method and the core idea of the present application. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.

Claims (10)

1. A JSON-based front end revocation method is characterized by comprising the following steps:
abstracting page content according to a JSON format to obtain JSON page data;
modifying the JSON page data according to the received page modification operation to obtain JSON difference data;
and when a revocation command corresponding to the page modification operation is received, restoring the page content according to the JSON difference data.
2. The front-end revocation method of claim 1, wherein modifying the JSON page data according to the received page modification operation to obtain JSON difference data comprises:
modifying the page content according to the received page modification operation to obtain the current page content;
modifying the JSON page data according to the current page content to obtain current JSON page data;
and carrying out difference comparison on the JSON page data and the current JSON page data to obtain the JSON difference data.
3. The front-end revocation method of claim 1, wherein said JSON difference data comprises an operation type and operation data.
4. The front-end revocation method according to claim 1, wherein, when receiving a revocation command corresponding to the page modification operation, restoring page contents according to the JSON difference data includes:
when a cancel command corresponding to the page modification operation is received, modifying JSON page data corresponding to the page content according to the JSON difference data to obtain recovered JSON page data;
and restoring the page content according to the restored JSON page data.
5. The front-end revocation method of claim 1, further comprising:
and when a redo command corresponding to the undo command is received, executing a re-modification operation on the page content according to the corresponding JSON difference data to obtain new page content.
6. The front-end revocation method of claim 1, wherein abstracting page contents according to a JSON format to obtain JSON page data, comprises:
abstracting page content according to a JSON format to obtain JSON page data, and initializing to obtain an operation position mark and an operation step set;
correspondingly, modifying the JSON page data according to the received page modification operation to obtain JSON difference data, and the method comprises the following steps:
modifying the JSON page data according to the received page modification operation to obtain JSON difference data;
and saving the JSON difference data to the operation step set, and modifying the operation position mark.
7. The front-end revocation method of claim 1, wherein modifying the JSON page data according to the received page modification operation to obtain JSON difference data comprises:
modifying the JSON page data according to the received page modification operation to obtain the current JSON page data;
and performing difference comparison on the JSON page data and the current JSON page data through a jsondiffpatch plug-in to obtain the JSON difference data.
8. A JSON-based front end revocation apparatus, comprising:
the page abstraction module is used for abstracting page contents according to the JSON format to obtain JSON page data;
the difference data acquisition module is used for modifying the JSON page data according to the received page modification operation to obtain JSON difference data;
and the page revocation module is used for restoring the page content according to the JSON difference data when a revocation command corresponding to the page modification operation is received.
9. A server, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the JSON-based front-end revocation method of any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the JSON-based front-end revocation method of any one of claims 1 to 7.
CN202110789012.7A 2021-07-13 2021-07-13 JSON-based front end revocation method and related device Withdrawn CN113535168A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110789012.7A CN113535168A (en) 2021-07-13 2021-07-13 JSON-based front end revocation method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110789012.7A CN113535168A (en) 2021-07-13 2021-07-13 JSON-based front end revocation method and related device

Publications (1)

Publication Number Publication Date
CN113535168A true CN113535168A (en) 2021-10-22

Family

ID=78098787

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110789012.7A Withdrawn CN113535168A (en) 2021-07-13 2021-07-13 JSON-based front end revocation method and related device

Country Status (1)

Country Link
CN (1) CN113535168A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502700A (en) * 2016-10-27 2017-03-15 中企动力科技股份有限公司 Page assembly edit methods and device
CN110221860A (en) * 2019-06-11 2019-09-10 腾讯科技(深圳)有限公司 A kind of configuration file processing method, device, terminal and medium
CN111241791A (en) * 2020-01-13 2020-06-05 深圳市大富网络技术有限公司 Editing method and device of webpage text, computer equipment and storage medium
CN113065317A (en) * 2021-03-18 2021-07-02 北京达佳互联信息技术有限公司 Method, device, electronic equipment, medium and product for recovering edited content

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106502700A (en) * 2016-10-27 2017-03-15 中企动力科技股份有限公司 Page assembly edit methods and device
CN110221860A (en) * 2019-06-11 2019-09-10 腾讯科技(深圳)有限公司 A kind of configuration file processing method, device, terminal and medium
CN111241791A (en) * 2020-01-13 2020-06-05 深圳市大富网络技术有限公司 Editing method and device of webpage text, computer equipment and storage medium
CN113065317A (en) * 2021-03-18 2021-07-02 北京达佳互联信息技术有限公司 Method, device, electronic equipment, medium and product for recovering edited content

Similar Documents

Publication Publication Date Title
CN101957730B (en) Messaging device and information processing method
RU2554785C2 (en) Support of possibility of undo and return at combined metadata
CN106610774B (en) Webpage table editing method and device
CN103226510B (en) Resolve the method and apparatus of vmcore file
CN111859865A (en) Method, device, terminal and medium for converting PDF document
CN111476017B (en) Webpage form editing method and device and electronic equipment
CN113190773A (en) Rendering method of display data, electronic equipment, mobile terminal and storage medium
CN111045654A (en) Vue-based method and device for quickly generating common instructions, computer equipment and storage medium
US20140337709A1 (en) Method and apparatus for displaying web page
CN113535168A (en) JSON-based front end revocation method and related device
CN113111044A (en) Data processing method and device, server device and storage medium
CN104536947A (en) Layout document processing method and device
CN111783482A (en) Text translation method and device, computer equipment and storage medium
JP2004287682A (en) Retouched image extracting device, program, storage medium and retouched image extracting method
CN111679825A (en) Cascading style sheet generation method and device, computer equipment and storage medium
CN110286831A (en) Screenshot method, device and terminal device
CN112052655B (en) Page processing method and device, computer storage medium and terminal
JP5478936B2 (en) Information processing apparatus and information processing method
CN102385474B (en) Data output method, device and system
CN111597010A (en) Method and device for generating pictures of Web pages, printing equipment and recording medium
CN112288835A (en) Image text extraction method and device and electronic equipment
CN111352909A (en) File saving and loading method and device, electronic device and storage medium
CN111753234B (en) Data visualization method, device, server and medium
JPWO2005101210A1 (en) Data analysis apparatus and data analysis program
CN112818642B (en) Method and device for converting PDF (Portable document Format) file into form file, computer equipment and storage medium

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20211022