Page editing method and device, electronic equipment and storage medium

Through the real-time interaction and difference comparison and merging mechanism between the client and the server, the conflict problem when multiple people edit the same page on the low-code platform is solved, and the consistency and integrity of the page data are achieved.

CN120653242APending Publication Date: 2025-09-16JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510576937.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Low-code platforms are prone to conflicts when multiple people edit the same page at the same time, resulting in inconsistent data or overwriting of each other. Existing solutions are cumbersome and error-prone.

Method used

Through real-time interaction between the client and the server, the current status of the target page is queried. When the page is locked, the user can temporarily edit it locally, and after the page is unlocked, the difference is compared and merged with the page version saved on the server to ensure the consistency of the page data.

Benefits of technology

It solves the conflict problem when multiple people edit the same page at the same time on the low-code development platform, ensuring the consistency and integrity of the page update data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653242A_ABST
    Figure CN120653242A_ABST
Patent Text Reader

Abstract

The invention discloses a page editing method and device, electronic equipment and a storage medium, and relates to the technical field of computers, and the method comprises the following steps: obtaining an editing operation on a target page; querying a current page state of the target page; in response to the fact that the target page is in the locked state, locally creating a page copy of the target page, executing the editing operation as a local editing operation on the page copy, and taking the edited target page as a first page version; in response to switching of the target page to the editable state, obtaining the target page as a second page version; comparing whether the first page version and the second page version are matched or not; and in response to mismatching of the first page version and the second page version, obtaining difference information of the first page version and the second page version and displaying the difference information to update the target page. The technical problem that conflicts are likely to be generated when multiple persons edit the same page at the same time on a low-code development platform is solved, and the technical effect of ensuring the consistency and integrity of page updating data is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a page editing method, device, electronic device, and storage medium. Background Art

[0002] Low-code development technology is a method of developing applications through a graphically visualized interface. Users can quickly create various types of pages by dragging and dropping components, setting properties, configuring data sources, and more. When creating pages, low-code platforms typically develop within a browser. Once development is complete, users can save the edited page data to the server.

[0003] Because some applications are complex, they require collaborative development by multiple people to ensure timely launch. However, low-code development platforms are prone to conflicts when multiple people are editing the same page simultaneously, leading to inconsistent data or overwriting. Current low-code platforms typically use simple version control or manual merging methods, converting applications to local files and using version control tools like Git to merge multiple developers. However, this method requires users to manually resolve conflicts. Once a conflict or overwriting problem occurs, manual offline investigation is required, which is cumbersome and error-prone, making it unsuitable for the graphical development environment of low-code platforms. Summary of the Invention

[0004] The present application provides a page editing method, device, electronic device and storage medium to at least solve the problem in the related art that conflicts are easily generated when multiple people edit the same page at the same time on a low-code platform.

[0005] In the first aspect, the present application provides a page editing method, including: a client obtains an editing operation on a target page; queries the current page status of the target page; wherein the page status includes a locked state and an editable state; in response to the target page being in a locked state, locally creating a page copy of the target page, performing the editing operation as a local editing operation on the page copy, and using the edited target page as a first page version; in response to the target page switching to an editable state, obtaining the target page as a second page version; comparing the first page version and the second page version for a match; in response to the two not matching, obtaining and displaying the difference information between the first page version and the second page version to obtain the retained difference information indicated by the update instruction as the target information; and updating the target information on the target page.

[0006] In the second aspect, the present application also provides a page editing device, including: a query module for querying the current page status of the target page; wherein the page status includes a locked state and an editable state; a first generation module for locally executing an editing operation on the target page in response to the current page status being a locked state, taking the edited target page as the first page version, and generating a first page structure for describing the first page version; a second generation module for updating the current page status to an editable state in response to the target page releasing the lock, obtaining the target page after the lock is released as the second page version, and generating a second page structure for describing the second page version; a first comparison module for comparing whether the first page structure and the second page structure are consistent; in response to inconsistency, obtaining and displaying the difference information between the first page structure and the second page structure to update the second page version.

[0007] In a third aspect, the present application also provides an electronic device, comprising: a memory for storing a computer program; a processor for implementing the steps of the page editing method in the following embodiment when executing the computer program: the client obtains an editing operation on the target page; queries the current page status of the target page; wherein the page status includes a locked state and an editable state; in response to the target page being in a locked state, locally creating a page copy of the target page, performing the editing operation as a local editing operation on the page copy, and using the edited target page as the first page version; in response to the target page switching to an editable state, obtaining the target page as the second page version; comparing the first page version and the second page version for whether they match; in response to the two not matching, obtaining and displaying the difference information between the first page version and the second page version to obtain the retained difference information indicated by the update instruction as the target information; and updating the target information on the target page.

[0008] In a fourth aspect, the present application also provides a computer-readable storage medium, which stores a computer program, wherein when the computer program is executed by a processor, it implements the steps of the page editing method in the following embodiment: the client obtains an editing operation on the target page; queries the current page status of the target page; wherein the page status includes a locked state and an editable state; in response to the target page being in a locked state, a page copy of the target page is created locally, the editing operation is performed as a local editing operation on the page copy, and the edited target page is used as the first page version; in response to the target page switching to an editable state, the target page is obtained as the second page version; the first page version and the second page version are compared for whether they match; in response to the two not matching, the difference information between the first page version and the second page version is obtained and displayed to obtain the retained difference information indicated by the update instruction as the target information; and the target information is updated on the target page.

[0009] In a fifth aspect, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the page editing method in the following embodiment: the client obtains an editing operation on the target page; queries the current page status of the target page; wherein the page status includes a locked state and an editable state; in response to the target page being in a locked state, locally creates a page copy of the target page, performs the editing operation as a local editing operation on the page copy, and uses the edited target page as the first page version; in response to the target page switching to an editable state, obtains the target page as the second page version; compares the first page version and the second page version for whether they match; in response to the two not matching, obtains and displays the difference information between the first page version and the second page version to obtain the retained difference information indicated by the update instruction as the target information; and updates the target information on the target page.

[0010] This application allows the client and server to query the current state of the target page in real-time interaction. When the target page is locked, the user can temporarily edit and store it locally. After the page is unlocked, the difference is compared with the page version saved by the server and the update is merged. This ensures that when multiple people are collaborating on a development project, only one user can edit the same page. This solves the technical problem of conflicts that easily arise when multiple people edit the same page simultaneously on low-code development platforms, achieving the technical effect of ensuring the consistency and integrity of page update data. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Figure 1 A schematic diagram of the system architecture of a page editing method provided in an embodiment of the present application;

[0013] Figure 2 A schematic diagram of a flow chart of a page editing method provided in an embodiment of the present application;

[0014] Figure 3 A flowchart of a page editing method provided in another embodiment of the present application;

[0015] Figure 4 A schematic diagram of a communication architecture of a page editing method provided in an embodiment of the present application;

[0016] Figure 5A schematic diagram of the steps for querying the current page status provided in an embodiment of the present application;

[0017] Figure 6 A schematic diagram of a local temporary editing step on a client provided in an embodiment of the present application;

[0018] Figure 7 A structural block diagram of a page editing device provided in an embodiment of the present application;

[0019] Figure 8 This is a diagram of the internal structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0021] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0022] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0023] In conjunction with the specific application environment architecture or specific hardware architecture on which the execution of the page editing method depends, the specific application environment architecture or specific hardware architecture is described herein.

[0024] like Figure 1As shown, the system architecture 100 may include one or more terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or fiber optic cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with display screens, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. In some exemplary embodiments, a low-code development platform may be installed on the terminal devices 101, 102, 103, which can provide a graphical user interface for developers of different experience levels to create web pages and mobile applications by dragging components and model-driven logic.

[0025] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as needed. For example, the server 105 may be a server cluster consisting of multiple servers.

[0026] The page editing method provided in the embodiment of the present disclosure is generally executed by the server 105, and accordingly, the page editing device is generally provided in the server 105. However, it is readily understood by those skilled in the art that the page editing method provided in the embodiment of the present disclosure may also be executed by the terminal devices 101, 102, and 103, and accordingly, the page editing device may also be provided in the terminal devices 101, 102, and 103, and this is not particularly limited in the present exemplary embodiment.

[0027] An embodiment of the present application provides a page editing method, and the method is described in detail in conjunction with the execution process of the page editing method.

[0028] In one embodiment, Figure 2 As shown, a page editing method is provided, comprising the following steps:

[0029] S1, the client obtains the editing operation of the target page.

[0030] S2, query the current page status of the target page; wherein the page status includes a locked state and an editable state.

[0031] In an optional embodiment, querying the current page status of the target page includes: linking to the front-end page corresponding to the application of the low-code platform, wherein the low-code platform is used to perform visual editing of the front-end page; in response to obtaining an editing instruction for the target page, sending a page editing request to the server to query the current page status of the target page.

[0032] Among them, the application, that is, the application created by the user on the low-code development platform, can include multiple visual front-end pages, which are also edited and generated in a visual way on the low-code development platform. The low-code development platform can provide visual editing tools to realize visual editing. For example, the user can add or delete controls for the front-end page of the application by dragging and dropping on the editing page provided by the low-code development platform. Visual editing can include adding and deleting front-end pages, such as creating a new front-end page by clicking a button, or adding and deleting controls in a front-end page, and can also include editing logical rules between controls, etc. This embodiment does not specifically limit this. Each client can edit the front-end page of the application on the low-code platform, and the front-end page can be uniquely identified by a page identifier.

[0033] When a new low-code page is created on the server side, the current page status (i.e., page lock status) of the page is recorded. This can be stored in a relational database or a NoSQL database (Not Only SQL, a general term for non-relational databases), including fields such as page ID, user ID, lock time, and timeout time. Distributed storage and computing technologies, such as using an in-memory database such as Redis, can also be used to store page lock status to improve read and write performance, but this is not limited to this in this embodiment.

[0034] The server provides an HTTP (Hypertext Transfer Protocol) interface to query the current page status and supports WebSocket (network communication protocol) long connections or SSE (Server-Sent Events) interfaces to push the current page status in real time. When a user opens the low-code platform for development, the client will initiate an HTTP request to the server to pull the current page status of the target page, and simultaneously open WebSocket or SSE to receive real-time page status updates from the server.

[0035] Based on the above steps, the operation permissions of each front-end page are controlled by the page status. For example, when the front-end page is in the editable state, the editing permission of the front-end page can be opened, allowing the client user to edit the front-end page, such as adding components, modifying components, etc. When the front-end page is in the locked state, the viewing permission of the front-end page can be opened, allowing the client user to view the front-end page, such as viewing the page content in the front-end page, viewing the current locked user of the front-end page, etc.

[0036] In an optional embodiment, after sending a page editing request to the server to query the current page status of the target page, it also includes: in response to the current page status being an editable state, confirming the page identifier of the target page and the user identifier of the client; using the page identifier and the user identifier as association information, and sending a page locking request to the server based on the association information, so that the server locks the target page and updates the current page status of the target page to a locked state; in response to receiving a locking response returned by the server, applying the acquired editing operation as an online editing operation to the target page.

[0037] It should be noted that when a client requests to edit a page, it first sends a query request to the server to obtain the current page status of the target page to determine whether it is locked by other users. If the target page is in an editable state, it means that it is not locked by other users. The request returns and the client can perform real-time editing operations. If the target page is in a locked state, it means that it is locked by other users and cannot enter the page real-time editing mode.

[0038] Among them, the page identifier of the target page can be used to uniquely identify the target page; the user identifier of the client can also be used to uniquely identify the terminal or terminal user, which may specifically include user identity information, such as user name, user ID, etc.; it may also include terminal attribute information, such as terminal IP address, terminal ID, etc.; it may also include other information, such as user telephone number, email address, mobile phone number and other contact information, which is not limited in this embodiment.

[0039] Based on the above steps, the target page and the client are bound by association information so that the target page can only be edited by the client, avoiding conflicts in updates on the same front-end page when developing applications at the same time.

[0040] S3, in response to the target page being in a locked state, locally creating a page copy of the target page, performing the editing operation as a local editing operation on the page copy, and using the edited target page as the first page version.

[0041] In an optional embodiment, before creating a page copy of the target page locally, it also includes: obtaining the locking information of the target page; wherein the locking information includes the page identifier of the target page, the user identifier of the current locking user, and the locking time; sending a notification message to the client carrying the user identifier of the current locking user, and checking whether the current locking user has released the lock operation on the target page; in response to the target page not releasing the lock, determining to create a page copy locally.

[0042] After locking the target page, the server generates lock information. The lock information may include multiple sets of records, each set of records including a page identifier and a user identifier. The lock information may be generated in various forms, such as a table, a database, or a list. For example, when generated in a table, each row of data in the table may include a page identifier and a user identifier. When generated in a database, the lock information may be stored in the form of a key-value pair, with the page identifier as the key and the user identifier as the value corresponding to the key.

[0043] When the server finds that the target page is locked, it returns a message to the client, notifying the current user that they cannot edit the page in real time, but that they can temporarily save the page locally. It also queries the user's information, including email address, phone number, and other contact information, and then sends a message via the email server or SMS server to inform the current user that another user has requested to edit the page. This allows the current user to decide whether to release the lock on the target page based on the actual situation.

[0044] In an optional embodiment, the page editing method also includes: in response to receiving a page save operation on the target page, or the currently locked user canceling the update triggered on the target page, confirming whether to release the lock on the target page; so that the server responds to the lock release request for the target page, or the lock time of the target page exceeds the preset timeout time, deletes the association information between the page identifier of the target page and the user identifier of the currently locked user from the lock information, and updates the lock information; in response to receiving the updated lock information returned by the server, uses the updated lock information to update the target page, and updates the current page state of the target page to an editable state.

[0045] When locking a page, the server sets a timeout (30 minutes by default) to define the maximum effective duration of the page lock. After this time, the page will be automatically unlocked. The server monitors the lock status of each page. If the lock time of the target page exceeds the preset timeout, the system automatically releases the lock and notifies the client to prevent the page from being locked for a long time after editing.

[0046] When the currently locked user completes editing the target page and saves it, the system needs to confirm whether to release the lock on the target page. If the currently locked user triggers an update on the target page and decides to undo these updates and restore the page version before the update, the system also needs to confirm whether to release the lock on the target page. It is understandable that when temporary unlocking is required, the page can also be forcibly unlocked through system administrator and other permissions. The server will record the page lock, release, timeout and other operation logs for subsequent auditing and troubleshooting.

[0047] S4: In response to the target page being switched to an editable state, obtaining the target page as a second page version.

[0048] Among them, the first page structure and the second page structure can be a schema in JSON (JavaScript Object Notation, JS Object Notation) format. In the low-code platform, schema is a structured data model used to describe the structure, properties and relationships between pages or components. It defines the complete information of the page. When a user edits a low-code page, the complete data of the page is usually stored in the form of a schema. When the editing is completed, the client stores the edited Schema content and the corresponding page version in the browser's local index (LocalStorage) or indexed database (Indexed Database, IndexedDB). LocalStorage and IndexedDB are local storage mechanisms provided by browsers, allowing web pages to store data on the user's device, and this data can be retained even after the browser is closed.

[0049] S5, compare the first page version and the second page version to see if they match; in response to the two not matching, obtain the difference information between the first page version and the second page version and display it to obtain the retained difference information indicated by the update instruction as the target information; update the target information on the target page.

[0050] In an optional embodiment, comparing whether the first page version and the second page structure version match each other includes: generating a first page structure for describing the first page version, and a second page structure for describing the second page version; wherein the first page structure and the second page structure are tree structures; traversing the nodes in the first page structure and the second page structure using a depth-first search algorithm; recursively comparing the node types, paths, key-value pairs and array contents of child nodes of corresponding nodes in the first page structure and the second page structure layer by layer to see whether they are consistent; wherein the path is the access path from the root node to the current node, the key in the key-value pair is the object name, and the value is the data pointed to by the object name; calculating the first key set corresponding to the first page structure and the second key set corresponding to the second page structure. The difference of the key sets; in response to the difference set being not empty, the difference set is used as the difference information; in response to the difference set being empty, comparing whether the first value corresponding to the first key set and the second value corresponding to the second key set under the same path are the same; in response to the existence of a common key corresponding to a different first value and a different second value, the first value and the second value corresponding to the common key are used as the difference information, and it is determined whether the array contents of the child nodes are the same; in response to the addition, deletion or order change of array items in the array contents of the corresponding child nodes in the first page structure and the second page structure, the array contents of the child nodes are used as the difference information; in response to the first value and the second value under the same path being the same, and the array contents of the child nodes being the same, it is determined that the first page structure is consistent with the second page structure, and the first page version is used to perform the page save operation, with the target page.

[0051] It should be noted that due to the characteristics of the graphical development environment, page development on the low-code platform is difficult to perform direct merging operations. The low-code schema represents the complete information of the page and is a JSON-structured text data that contains the page component tree structure, component properties, styles, event bindings, etc. Therefore, difference comparison and merging can be performed based on this data.

[0052] Specifically, when the target page is locked, the user can first perform a local temporary edit and save it, wait for the target page to be unlocked, and then compare the page structure corresponding to the local edited and saved page version (i.e., the first page version) and the page version saved by the server after unlocking (i.e., the second page version). If they are the same, the first page version can be used to save the page to overwrite the online version. If they are different, it means that the target page has been updated during the locking period, and it needs to be merged and updated with the local temporary edited page version to ensure that the user's local edits will not be lost due to updates on the server, and to prevent the server's updates from overwriting the user's local changes.

[0053] Among them, the depth-first search algorithm (DFS) is an algorithm used to traverse or search a tree or graph. It recursively traverses each node in the JSON tree structure corresponding to the page version saved by local editing and the page version saved by the server after unlocking, and compares the node type, path, key-value pair and array content of the child nodes of the corresponding nodes in the two page structures layer by layer to see whether they are consistent.

[0054] First, calculate the difference between the key sets of the nodes at the same level of the two page structures. If there are new or deleted keys, such as keys that exist in the first page structure but not in the second page structure, or keys that exist in the second page structure but not in the first page structure, they are directly recorded as difference information. If the key sets of the two are consistent, further compare whether the values ​​under the same path are equal, including basic type values ​​(such as text, numbers) and complex types (such as objects, arrays). For the array content of child nodes, it is necessary to rely on unique identifiers (such as component ids) to match new and old items, identify additions and deletions, order changes, or internal attribute modifications. For example, if an array item is added to the child node array of the server version or the order of the array items is adjusted, the system will mark it as an array content change. Finally, if the values ​​under all paths are consistent with the child node array content, the two versions are determined to be the same, and the local version is directly used to overwrite the server version; if there are differences, enter the visual merge stage.

[0055] Furthermore, after the difference analysis is completed, the difference information needs to be displayed visually. The latest page version saved on the server can be used as a benchmark to display the comparison differences of the local edited version through color block markings. For example, green indicates new content, red indicates deleted content, and yellow indicates modified content. Users can choose whether to merge and update based on the displayed difference content. For example, if a button component is added by the local temporary editor, the user can click the green new content block to confirm the addition; if the comparison shows that it does not need to be added, the user can choose to cancel and remove the content block. After clicking to select all the difference content blocks, the merge operation is completed and the merged content is updated to the server.

[0056] Based on the above steps, through the depth-first search algorithm and key-value pair comparison, the page structure differences between the first page version edited locally and the second page version edited and saved by the server are accurately detected, so as to choose to merge and update. This ensures that when multiple people edit the same page, the final saved page version is the latest and consistent, avoiding data inconsistency or overwriting problems.

[0057] In an optional embodiment, before comparing the first page version and the second page version for a match, the method further includes: using a copy of the page on which no editing operation has been performed as a third page version; comparing the second page version and the third page version for a match; in response to a match between the second page version and the third page version, overwriting the target page with the first page version; in response to a mismatch between the second page version and the third page version, determining whether the first page version and the second page version match.

[0058] It is understandable that when the target page is locked, the current locked user may not have made any changes to the target page content or may have undone the changes. Therefore, when the page is unlocked, first compare the page copy saved before local editing with the server version to see if they are the same. If they are the same, it means that the server version has edited the target page. At this time, the local edited version can be used directly to overwrite and update.

[0059] In an optional embodiment, querying the current page status of the target page includes: requesting the locking permission of the target page from the server; in response to multiple clients requesting the locking permission of the target page from the server, the server determines whether there is a master user among the multiple clients; wherein the user type of the client includes a master user and a slave user; in response to the existence of a master user, assigning the locking permission of the target page to the master user as the current locked user; in response to the absence of a master user, determining the target user from multiple slave users according to preset rules, and assigning the locking permission of the target page to the target user as the current locked user; sending conflict information to the client that has not obtained the locking permission; in response to obtaining the locking permission feedback from the server, determining that the current page status is an editable status; in response to obtaining the conflict information feedback from the server, determining that the current page status is a locked status.

[0060] Specifically, when multiple people are collaborating on a development project, there may be multiple clients requesting to edit the same target page at the same time. In order to effectively manage these requests and avoid conflicts, it is necessary to determine the target user who obtains editing permissions through user type and preset rules. For example, the main user (who can be a project leader or administrator) usually has a higher priority. Therefore, when a main user exists, the locking permission of the target page can be assigned to the main user as the current locking user. In addition, the client that first applied for the locking permission can be used as the target client according to the time the request was sent; the locking permission can also be assigned based on the user's session activity, such as current activity, session duration, etc. This is not limited in this embodiment.

[0061] Based on the above steps, when multiple users simultaneously request to lock the same page, a pre-set mechanism ensures page lock uniqueness. Simultaneously, the server sends a conflict message to the client that doesn't have lock permission, including the conflict reason and the current locked user's information. Upon receiving the conflict message, the client can notify the user that the page has been locked and display the locked user's information.

[0062] In an optional embodiment, when multiple users simultaneously request to lock the target page, the user priority can also be dynamically adjusted. Specifically, it includes: in response to multiple clients requesting the server to lock the target page, collecting user behavior data of multiple clients, the user behavior data including activity, session duration, editing frequency, project contribution and user permission level; calculating the priority of the corresponding client based on the user behavior data, and taking the client with the highest priority as the target user; recalculating the priority of all users according to the preset time; in response to the presence of a user in multiple clients triggering a key operation, or reaching the preset time, recalculating and adjusting the priorities of multiple clients; wherein, the key operations include editing the page, saving the page and changing the user role.

[0063] Among them, activity refers to the current user's activity level on the platform, such as the number of operations in the last 10 minutes; session duration refers to the user's current continuous usage time on the low-code platform; editing frequency refers to the user's editing frequency in a specific time period, such as the number of edits per hour; project contribution refers to the user's contribution to the current project, such as the amount of code submitted and the number of bugs fixed; user permission levels can be set according to user roles to administrators, project leaders, ordinary developers, etc., or specific permission levels can be set, such as level 1, level 2, etc.

[0064] Based on the above steps, by dynamically adjusting user priorities, the system can flexibly handle complex conflict situations and ensure the fairness and efficiency of the page locking mechanism.

[0065] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0066] An embodiment of the present application also provides a page editing device, including an acquisition module for acquiring editing operations on a target page; a query module for querying the current page status of the target page; wherein the page status includes a locked state and an editable state; a first editing module for locally creating a page copy of the target page in response to the target page being in a locked state, performing the editing operation as a local editing operation on the page copy, and using the edited target page as the first page version; a second editing module for acquiring the target page as the second page version in response to the target page switching to an editable state; a first comparison module for comparing whether the first page version and the second page version match; in response to the two not matching, acquiring and displaying the difference information between the first page version and the second page version to obtain the retained difference information indicated by the update instruction as the target information; and updating the target information on the target page.

[0067] In one embodiment, the query module is also used to link the front-end page corresponding to the application of the low-code platform, wherein the low-code platform is used to perform visual editing of the front-end page; in response to obtaining the editing instructions for the target page, a page editing request is sent to the server to query the current page status of the target page.

[0068] In one embodiment, a locking module is also included, which is used to confirm the page identifier of the target page and the user identifier of the client in response to the current page status being an editable state; use the page identifier and the user identifier as association information, and send a page locking request to the server based on the association information, so that the server performs a locking operation on the target page and updates the current page status of the target page to a locked state; in response to receiving a locking response returned by the server, the obtained editing operation is applied to the target page as an online editing operation.

[0069] In one embodiment, the first editing module is also used to obtain the locking information of the target page; wherein the locking information includes the page identifier of the target page, the user identifier of the current locking user, and the locking time; a notification message is sent to the client carrying the user identifier of the current locking user, and it is checked whether the current locking user releases the lock on the target page; in response to the target page not releasing the lock, it is determined to create a page copy locally.

[0070] In one embodiment, an unlocking module is also included for confirming whether to release the lock on the target page in response to receiving a page save operation on the target page, or the currently locked user canceling the update triggered on the target page; so that the server responds to the lock release request for the target page, or the lock time of the target page exceeds the preset timeout time, deletes the association information between the page identifier of the target page and the user identifier of the currently locked user from the lock information, and updates the lock information; in response to receiving the updated lock information returned by the server, updates the target page using the updated lock information, and updates the current page state of the target page to an editable state.

[0071] In one embodiment, the first comparison module is further used to generate a first page structure for describing the first page version, and a second page structure for describing the second page version; wherein the first page structure and the second page structure are tree structures; the first page structure and the second page structure are traversed by a depth-first search algorithm, and node types, paths, key-value pairs and sub-node array contents of corresponding nodes in the first page structure and the second page structure are recursively compared layer by layer to see whether they are consistent; wherein the path is an access path from the root node to the current node, the key in the key-value pair is the object name, and the value is the data pointed to by the object name; the difference between the first key set corresponding to the first page structure and the second key set corresponding to the second page structure is calculated; in response to the difference not being empty, take the difference set as the difference information; in response to the difference set being empty, compare whether the first value corresponding to the first key set under the same path is the same as the second value corresponding to the second key set; in response to the existence of a common key whose first value and second value are different, take the first value and second value corresponding to the common key as the difference information; compare whether the sub-node array contents of the corresponding nodes in the first page structure and the second page structure are the same; in response to the existence of array item addition, deletion or order change in the sub-node array content, take the sub-node array content as the difference information; in response to the first value and the second value under the same path being the same, and the sub-node array content being the same, determine that the first page version matches the second page version, and use the first page version to perform a page save operation to overwrite the target page.

[0072] In one embodiment, a second comparison module is also included, which is used to use a copy of the page without performing editing operations as the third page version; compare whether the second page version and the third page version match; in response to the second page version and the third page version matching, use the first page version to overwrite the target page; in response to the second page version and the third page version not matching, determine whether the first page version and the second page version match.

[0073] The description of the features in the embodiments corresponding to the page editing device can be found in the relevant description of the embodiments corresponding to the page editing method, and will not be repeated here. Each module in the above-mentioned page editing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0074] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned page editing method embodiments.

[0075] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps of any of the above-mentioned page editing method embodiments when running.

[0076] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0077] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned page editing method embodiments are implemented.

[0078] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned page editing method embodiments are implemented.

[0079] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0080] The above is a detailed introduction to a page editing method, device, electronic device and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A page editing method, characterized in that: The page editing method includes: The client obtains the editing operation of the target page; querying the current page status of the target page; wherein the page status includes a locked state and an editable state; in response to the target page being in the locked state, locally creating a page copy of the target page, performing the editing operation as a local editing operation on the page copy, and using the edited target page as the first page version; In response to the target page being switched to the editable state, acquiring the target page as a second page version; Compare the first page version and the second page version to see if they match; in response to the two not matching, obtain the difference information between the first page version and the second page version and display it to obtain the retained difference information indicated by the update instruction as the target information; update the target information on the target page.

2. The page editing method according to claim 1, characterized in that: The querying of the current page status of the target page includes: Linking to a front-end page corresponding to an application of a low-code platform, wherein the low-code platform is used to perform visual editing on the front-end page; In response to obtaining the editing instruction for the target page, a page editing request is sent to the server to query the current page status of the target page.

3. The page editing method according to claim 2, characterized in that: After sending the page edit request to the server to query the current page status of the target page, the method further includes: In response to the current page state being an editable state, confirming the page identifier of the target page and the user identifier of the client; Using the page identifier and the user identifier as association information, sending a page lock request to the server based on the association information, causing the server to lock the target page and update the current page state of the target page to a locked state; In response to receiving the lock response returned by the server, the acquired editing operation is used as an online editing operation and acts on the target page.

4. The page editing method according to claim 2, characterized in that: Before locally creating a page copy of the target page, the method further includes: Obtaining locking information of the target page; wherein the locking information includes the page identifier of the target page, the user identifier of the current locking user, and the locking time; Sending a notification message to a client carrying the user ID of the currently locked user, and checking whether the currently locked user has released the lock on the target page; In response to the target page not releasing the lock, it is determined to locally create the page copy.

5. The page editing method according to claim 4, characterized in that: The page editing method further includes: In response to receiving a page save operation on the target page, or the currently locked user canceling an update triggered on the target page, confirming whether to release the lock on the target page; so that the server, in response to the lock release request for the target page, or the lock time of the target page exceeds a preset timeout time, deletes the association information between the page identifier of the target page and the user identifier of the currently locked user from the lock information, and updates the lock information; In response to receiving the updated locking information returned by the server, the target page is updated using the updated locking information, and the current page state of the target page is updated to an editable state.

6. The page editing method according to claim 1, characterized in that: The comparing whether the first page version and the second page version match each other includes: Generate a first page structure for describing the first page version, and a second page structure for describing the second page version; wherein the first page structure and the second page structure are tree structures; Using a depth-first search algorithm to traverse the first page structure and the second page structure, recursively comparing the node types, paths, key-value pairs, and child node array contents of corresponding nodes in the first page structure and the second page structure layer by layer to determine whether they are consistent; wherein the path is an access path from a root node to a current node, the key in the key-value pair is an object name, and the value is the data pointed to by the object name; Calculating a difference between a first key set corresponding to the first page structure and a second key set corresponding to the second page structure; and in response to the difference being not empty, using the difference as difference information; In response to the difference set being empty, comparing whether a first value corresponding to the first key set and a second value corresponding to the second key set under the same path are the same; In response to the first value and the second value corresponding to the common key being different, taking the first value and the second value corresponding to the common key as difference information; Comparing whether the sub-node array contents of corresponding nodes in the first page structure and the second page structure are the same; in response to addition, deletion, or order change of array items in the sub-node array contents, using the sub-node array contents as difference information; In response to the first value and the second value under the same path being the same and the subnode array contents being the same, it is determined that the first page version matches the second page version, and the first page version is used to perform a page save operation to overwrite the target page.

7. The page editing method according to claim 1, characterized in that: Before comparing whether the first page version and the second page version match, the method further includes: using a copy of the page without performing the editing operation as a third page version; comparing the second page version and the third page version to see whether they match; In response to the second page version and the third page version both matching, overwriting the target page with the first page version; In response to the second page version and the third page version not matching each other, it is determined whether the first page version and the second page version match each other.

8. A page editing device, characterized in that: include: The acquisition module is used to obtain the editing operation of the target page; A query module, configured to query the current page status of the target page; wherein the page status includes a locked state and an editable state; a first editing module, configured to, in response to the target page being in a locked state, locally create a page copy of the target page, perform the editing operation as a local editing operation on the page copy, and use the edited target page as a first page version; a second editing module, configured to obtain the target page as a second page version in response to the target page being switched to the editable state; The first comparison module is used to compare whether the first page version and the second page version match; in response to the two not matching, obtain the difference information between the first page version and the second page version and display it to obtain the retained difference information indicated by the update instruction as the target information; and update the target information on the target page.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the page editing method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the page editing method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Page editing locking method, system and equipment and computer readable storage medium

    CN121255487A