A web page control method and system for allowing only one person to edit
By using Worker threads and timer mechanisms in web page development, recording user IDs and resetting the logger content within a threshold time, the conflict problem caused by multiple developers editing is resolved, and the data integrity and consistency of the web page are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GONGQINGCHENG ZHONGTAOLIAN SUPPLY CHAIN SERVICE CO LTD
- Filing Date
- 2024-09-29
- Publication Date
- 2026-06-16
AI Technical Summary
In web development, multiple developers modifying the same page or key parts simultaneously can lead to content conflicts, overlaps, or logical confusion, which in turn can cause page malfunctions or display errors. A fine-grained control mechanism is needed to ensure that control of the page is concentrated in the hands of a single developer during critical editing stages.
By creating a Worker thread and defining a timer, the system receives messages from the main thread, records the user ID, resets the logger content within a threshold time, determines whether the current user ID matches the ID in the logger, and only allows matching users to edit. It also handles multi-user access by combining permission levels and access time priorities.
It effectively avoids conflicts and data inconsistencies caused by multiple users editing simultaneously, improving the data integrity and consistency of web editing.
Smart Images

Figure CN119311271B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of web editing technology, and in particular to a web page control method and system that allows only one person to edit. Background Technology
[0002] In current web development practices, to improve development efficiency and modularity, projects are often divided into multiple functional modules or areas, with each team or developer focusing on a specific module for independent development and editing. This division of labor significantly accelerates the overall development speed of a webpage, allowing different parts to proceed in parallel and reducing interdependencies and waiting time.
[0003] However, in certain scenarios, such as those involving sequential editing workflows or strict content approval processes, traditional parallel development models may face challenges. Since multiple developers may simultaneously modify the same page or key sections of a page, this inevitably leads to content conflicts, overlaps, or logical inconsistencies, potentially causing page malfunctions or display errors. To address this issue, a more granular control mechanism is needed to ensure that during critical editing phases, control of the page remains centralized in the hands of a single developer.
[0004] Therefore, in the field of web development, it has become particularly important and urgent to explore and implement a control method that allows only one person to edit. Summary of the Invention
[0005] To address the aforementioned shortcomings, the present invention aims to propose a web page control method and system that allows only one person to edit, thereby limiting the number of people editing a web page and ensuring that the edited content does not conflict.
[0006] To achieve this objective, the present invention adopts the following technical solution: a web page control method that allows only one person to edit, comprising the following steps:
[0007] Create a Worker thread, and define a timer through the Worker thread. The timer is used to periodically receive messages from the main thread.
[0008] When the timer receives a message from the main thread, it records the ID of the main thread in the recorder, generates preset content based on the message from the main thread, and stores the content in the recorder. If the message from the main thread is not received by the timer after a threshold time, all content in the recorder is reset.
[0009] When a user edits, a query is sent to the logger to check if an ID exists. If the return value is true, it is determined whether the current user ID matches the ID in the logger. If they match, editing is allowed; if they do not match, editing is not allowed. If the return value is false, editing is allowed.
[0010] Preferably, the messages in the main thread include a first message and a second message;
[0011] When the first message is received, the timer sends a first specified message to the main thread and receives a second specified message from the main program based on the first specified message, and stores the second specified message in the recorder.
[0012] When a second message is received, the timer resets all content within the recorder.
[0013] Preferably, the following steps are also included:
[0014] When the content of the second specified message reaches the quantity threshold, reset all content in the logger;
[0015] The main thread's messages also include third messages;
[0016] When a third message is received, the content of the second specified message in the logger will be reset.
[0017] Preferably, the following steps are also included:
[0018] If the return value is true, retrieve the ID of the currently accessing user and the access time;
[0019] When the main thread is idle and multiple users are accessing and editing the page, obtain the ID corresponding to the earliest access time and record that ID in the logger.
[0020] Preferably, the following steps are also included:
[0021] Set the user's permission level;
[0022] If the return value is true, retrieve the ID and permission level of the currently accessing user;
[0023] When the main thread is idle and multiple users are accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the logger.
[0024] A web page control system that allows only one person to edit, comprising a creation module, a recording module, and an operation module;
[0025] The creation module is used to create a Worker thread, and a timer is defined through the Worker thread. The timer is used to periodically receive messages from the main thread.
[0026] The recording module is used to record the ID of the main thread in the recorder when the timer receives a message from the main thread, generate preset content based on the message from the main thread, and store the content in the recorder. If the message from the main thread is not received by the timer within a threshold time, all content of the recorder is reset.
[0027] The operation module is used to send a query to the recorder to check if there is an ID when the user is editing. If the return value is true, editing is not allowed; if the return value is false, editing is allowed.
[0028] Preferably, the messages in the main thread include a first message, a second message, and a third message;
[0029] When the first message is received, the timer sends a first specified message to the main thread and receives a second specified message from the main program based on the first specified message, and stores the second specified message in the recorder.
[0030] When the second message is received, the timer resets all content in the recorder;
[0031] When a third message is received, the timer will reset the content of the second specified message in the recorder.
[0032] Preferably, it also includes a forced exit module, which is used to reset all content in the recorder by a timer when the content quantity of the second specified message reaches a quantity threshold.
[0033] Preferably, it also includes a first queuing module, which is used to obtain the ID of the currently accessing user and the access time if the return value is true;
[0034] When the main thread is idle and multiple users are accessing and editing the page, obtain the ID corresponding to the earliest access time and record that ID in the logger.
[0035] Preferably, it also includes a second queuing module, which is used to set the user's permission level;
[0036] If the return value is true, retrieve the ID and permission level of the currently accessing user;
[0037] When the main thread is idle and multiple users are accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the logger.
[0038] One of the above technical solutions has the following advantages or beneficial effects: By performing permission checks before users begin editing, this invention can effectively avoid conflicts and data inconsistencies that may arise when multiple users edit the same resource simultaneously. This improves data integrity and consistency in web editing. Attached Figure Description
[0039] Figure 1 This is a flowchart of one embodiment of the method of the present invention.
[0040] Figure 2 This is a schematic diagram of the structure of one embodiment of the system of the present invention. Detailed Implementation
[0041] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0042] In the description of embodiments of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0043] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0044] like Figures 1-2 As shown, a method for controlling a web page that allows only one person to edit it includes the following steps:
[0045] Create a Worker thread, and define a timer through the Worker thread. The timer is used to periodically receive messages from the main thread.
[0046] When the timer receives a message from the main thread, it records the ID of the main thread in the recorder, generates preset content based on the message from the main thread, and stores the content in the recorder. If the message from the main thread is not received by the timer after a threshold time, all content in the recorder is reset.
[0047] When a user edits, a query is sent to the logger to check if an ID exists. If the return value is true, it is determined whether the current user ID matches the ID in the logger. If they match, editing is allowed; if they do not match, editing is not allowed. If the return value is false, editing is allowed.
[0048] The main thread in this invention refers to the web page editing thread. To limit the number of users editing the web page, a timer is used. This timer acquires messages from the main thread at fixed intervals, typically 0.5 to 1 second. Since the main thread produces different messages depending on the operation performed, this invention generates preset content based on these messages and stores it in a logger. This content reveals the main thread's state, and the logger records the current main thread's ID. The logger uses this ID to identify the user entering the page. Only if the current user ID matches the ID in the logger can the user edit. If they don't match, the user is not allowed to edit the main thread. If the thread's message is not received by the timer within a threshold time, the connection between the user and the main thread may be compromised. Resetting all logger content would delete the current ID, preventing the user from continuing editing even after a short connection restoration. This is inconvenient for users working remotely. Therefore, this invention includes a threshold time. Only if the main thread's message is not received after the threshold time will all content in the logger be reset. This frees up editable space so that the next user can edit the web page.
[0049] This invention effectively avoids conflicts and data inconsistencies that may arise when multiple users edit the same resource simultaneously by performing permission checks before the user begins editing. This improves data integrity and consistency in web editing.
[0050] Preferably, the messages in the main thread include a first message and a second message;
[0051] When the first message is received, the timer sends a first specified message to the main thread and receives a second specified message from the main program based on the first specified message, and stores the second specified message in the recorder.
[0052] When a second message is received, the timer resets all content within the recorder.
[0053] The first message is a persistent message. When a user enters the main thread, the main thread sends the first message to the timer, indicating that a user has entered the main thread for editing. When the timer receives the first message, it sends a first specified message to the main thread. When the main program receives a second specified message based on the first specified message, it can confirm that a connection is still maintained between the user and the main thread.
[0054] The second message is for the user to exit the main thread. When the second message is received, it means that the user who was editing has exited the editing process. At this time, all the content in the logger can be reset and the ID option can be cleared to make it easier for other users to enter.
[0055] Preferably, the following steps are also included:
[0056] When the content of the second specified message reaches the quantity threshold, reset all content in the logger;
[0057] The main thread's messages also include third messages;
[0058] When a third message is received, the content of the second specified message in the logger will be reset.
[0059] Because the processing of the first message determines whether a connection still exists between the user and the main thread through the second specified message, but cannot determine whether the user is programming, if the user enters the main thread without editing, it will affect the editing progress of the web application. Therefore, in this invention, the content in the logger is reset based on the quantity of the second specified message. Since the first specified message is sent by a timer, and the timer sends information at fixed time intervals, the quantity of the second specified message multiplied by the time interval can be considered as the connection duration between the user and the main thread. When the connection duration exceeds a threshold (i.e., the quantity of the second specified message reaches the threshold), all content in the logger is reset to reduce the occupation of the main thread by idle users. When the main thread receives an edit, it sends a third message to the timer. After receiving the third message, the timer resets the content of the second specified message in the logger, making the quantity of the second specified message zero. As long as the user is in an editing state, the connection duration can be continuously reset, ensuring that users editing are cleared when the connection duration reaches the threshold.
[0060] Preferably, the following steps are also included:
[0061] If the return value is true, retrieve the ID of the currently accessing user and the access time;
[0062] When the main thread is idle and multiple users are accessing and editing the page, obtain the ID corresponding to the earliest access time and record that ID in the logger.
[0063] During a user's editing process, multiple other users may attempt to access the main web thread for editing. Therefore, it's necessary to record the ID of the currently accessing user and their access time, recording the ID corresponding to the earliest access time in the logger. The access order is determined by access time to ensure smooth system operation and prevent multiple users from accessing the main thread while it's idle.
[0064] Preferably, the following steps are also included:
[0065] Set the user's permission level;
[0066] If the return value is true, retrieve the ID and permission level of the currently accessing user;
[0067] When the main thread is idle and multiple users are accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the logger.
[0068] In another embodiment, access is based on user permission levels, which can be pre-set according to different job roles. For example: Administrator > Finance > Administration > Business. When multiple users access an idle main thread, users with higher permission levels are given priority. This can, to some extent, rationally arrange the work order and improve work efficiency.
[0069] A web page control system that allows only one person to edit, comprising a creation module, a recording module, and an operation module;
[0070] The creation module is used to create a Worker thread, and a timer is defined through the Worker thread. The timer is used to periodically receive messages from the main thread.
[0071] The recording module is used to record the ID of the main thread in the recorder when the timer receives a message from the main thread, generate preset content based on the message from the main thread, and store the content in the recorder. If the message from the main thread is not received by the timer within a threshold time, all content of the recorder is reset.
[0072] The operation module is used to send a query to the recorder to check if there is an ID when the user is editing. If the return value is true, editing is not allowed; if the return value is false, editing is allowed.
[0073] Preferably, the messages in the main thread include a first message, a second message, and a third message;
[0074] When the first message is received, the timer sends a first specified message to the main thread and receives a second specified message from the main program based on the first specified message, and stores the second specified message in the recorder.
[0075] When the second message is received, the timer resets all content in the recorder;
[0076] When a third message is received, the timer will reset the content of the second specified message in the recorder.
[0077] Preferably, it also includes a forced exit module, which is used to reset all content in the recorder by a timer when the content quantity of the second specified message reaches a quantity threshold.
[0078] Preferably, it also includes a first queuing module, which is used to obtain the ID of the currently accessing user and the access time if the return value is true;
[0079] When the main thread is idle and multiple users are accessing and editing the page, obtain the ID corresponding to the earliest access time and record that ID in the logger.
[0080] Preferably, it also includes a second queuing module, which is used to set the user's permission level;
[0081] If the return value is true, retrieve the ID and permission level of the currently accessing user;
[0082] When the main thread is idle and multiple users are accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the logger.
[0083] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0084] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for controlling a web page that allows only one person to edit it, characterized in that, Includes the following steps: Create a Worker thread, and define a timer through the Worker thread. The timer is used to periodically receive messages from the main thread. When the timer receives a message from the main thread, it records the ID of the main thread in the recorder, generates preset content based on the message from the main thread, and stores the content in the recorder. If the message from the main thread is not received by the timer after a threshold time, all content in the recorder is reset. When a user edits, a query is sent to the logger to check if an ID exists. If the return value is true, it is determined whether the current user ID matches the ID in the logger. If they match, editing is allowed; if they do not match, editing is not allowed. If the return value is false, editing is allowed.
2. The web page control method that allows only one person to edit according to claim 1, characterized in that, The main thread's messages include the first message and the second message; When the first message is received, the timer sends a first specified message to the main thread and receives a second specified message from the main program based on the first specified message, and stores the second specified message in the recorder. When a second message is received, the timer resets all content within the recorder.
3. The web page control method that allows only one person to edit according to claim 2, characterized in that, It also includes the following steps: When the content of the second specified message reaches the quantity threshold, reset all content in the logger; The main thread's messages also include third messages; When a third message is received, the content of the second specified message in the logger will be reset.
4. A web page control method that allows only one person to edit, as described in claim 2, is characterized in that... It also includes the following steps: If the return value is true, retrieve the ID of the currently accessing user and the access time; When the main thread is idle and multiple users are accessing and editing the page, obtain the ID corresponding to the earliest access time and record that ID in the logger.
5. A web page control method that allows only one person to edit, as described in claim 2, is characterized in that... It also includes the following steps: Set the user's permission level; If the return value is true, retrieve the ID and permission level of the currently accessing user; When the main thread is idle and multiple users are accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the logger.
6. A web page control system that allows only one person to edit, comprising the web page control system that allows only one person to edit as described in any one of claims 1 to 5, characterized in that, This includes modules for creating, recording, and operating. The creation module is used to create a Worker thread, and a timer is defined through the Worker thread. The timer is used to periodically receive messages from the main thread. The recording module is used to record the ID of the main thread in the recorder when the timer receives a message from the main thread, generate preset content based on the message from the main thread, and store the content in the recorder. If the message from the main thread is not received by the timer within a threshold time, all content of the recorder is reset. The operation module is used to send a query to the recorder to check if there is an ID when the user is editing. If the return value is true, editing is not allowed; if the return value is false, editing is allowed.
7. A web page control system that allows only one person to edit, as described in claim 6, is characterized in that, The main thread's messages include the first message, the second message, and the third message; When the first message is received, the timer sends a first specified message to the main thread and receives a second specified message from the main program based on the first specified message, and stores the second specified message in the recorder. When the second message is received, the timer resets all content in the recorder; When a third message is received, the timer will reset the content of the second specified message in the recorder.
8. A web page control system that allows only one person to edit, as described in claim 7, is characterized in that, It also includes a forced exit module, which is used to reset all content in the recorder by a timer when the content of the second specified message reaches a quantity threshold.
9. A web page control system that allows only one person to edit, as described in claim 7, is characterized in that, It also includes a first queuing module, which is used to obtain the ID of the currently accessing user and the access time if the return value is true; When the main thread is idle and multiple users are accessing and editing the page, obtain the ID corresponding to the earliest access time and record that ID in the logger.
10. A web page control system that allows only one person to edit, as described in claim 7, is characterized in that... It also includes a second queuing module, which is used to set the user's permission level; If the return value is true, retrieve the ID and permission level of the currently accessing user; When the main thread is idle and multiple users are accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the logger.