Web page control method and system allowing only one person to edit

By using the permission check mechanism of Worker threads and timers in web development, it ensures that only one user can edit the web page, solving conflict problems caused by simultaneous editing by multiple developers, and improving data integrity and consistency.

CN119311271AActive Publication Date: 2025-01-14GONGQINGCHENG ZHONGTAOLIAN SUPPLY CHAIN SERVICE CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411373961.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-01-14
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

In web development, multiple developers modify the same page or key parts of the page at the same time may lead to content conflicts, overwrites or logical confusion, which will cause abnormal page functions or display errors. A more refined control mechanism is needed to ensure that Control of the page during the key editing phase is concentrated in the hands of a single developer.

Method used

By creating Worker threads and timers, receiving messages from the main thread and performing permission checks before the user starts editing, ensuring that only the user ID currently recorded in the recorder can be edited, preventing multiple users from editing at the same time.

Benefits of technology

It effectively avoids conflicts and data inconsistency problems when multiple users edit at the same time, and improves data integrity and consistency in web editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119311271A_ABST
    Figure CN119311271A_ABST
Patent Text Reader

Abstract

A Web page control method allowing only one person to edit comprises the following steps that a Worker thread is created, a timer is defined through the Worker thread, and the timer is used for receiving messages of a main thread at regular time; when the timer receives the message of the main thread, the ID where the main thread is located is recorded in the recorder, preset content is generated according to the message of the main thread, the content is stored in the recorder, the message of the main thread is not received by the timer after the threshold time, an instruction for inquiring whether the ID exists or not is sent to the recorder, and if the returned value is true, the main thread is recorded in the recorder; if yes, whether the current user ID is consistent with the ID in the recorder or not is judged, if yes, editing can be carried out, if not, editing cannot be carried out, and if the return value is false, editing can be carried out. According to the method and the device, the permission check is performed before the user starts editing, so that the problems of conflicts and data inconsistency possibly generated when a plurality of users edit the same resource at the same time can be effectively avoided. And the data integrity and consistency in Web editing are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Web editing, and in particular to a Web page control method and system that only allows one person to edit. Background Art

[0002] In current web development practices, in order 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 and cooperation model significantly speeds up the overall development of web pages, allowing each part to advance in parallel and reducing interdependence and waiting time.

[0003] However, in certain scenarios, such as those involving sequential editing processes or strict content approval, the traditional parallel development model may encounter challenges. Since multiple developers may modify the same page or key parts of the page at the same time, this will inevitably lead to content conflicts, overwriting or logical confusion, which may cause page function anomalies or display errors. To solve this problem, a more refined control mechanism is needed to ensure that control of the page can be concentrated in the hands of a single developer during the critical editing stage.

[0004] Therefore, in the field of web development, it becomes particularly important and urgent to explore and implement a control method that only allows one person to edit. Summary of the invention

[0005] In view of the above-mentioned defects, the purpose of the present invention is to provide a method and system for controlling a Web page that only allows one person to edit, so as to limit the number of people who can edit the Web page and ensure that the edited content will not conflict.

[0006] To achieve this purpose, the present invention adopts the following technical solution: a method for controlling a web page that allows only one person to edit, comprising the following steps:

[0007] Create a Worker thread, and define a timer through the Worker thread, where the timer is used to periodically receive messages from the main thread;

[0008] When the timer receives a message from the main thread, the ID of the main thread is recorded in the recorder, preset content is generated according to the message of the main thread, and the content is stored in the recorder, wherein if the message of the main thread is not received by the timer after a threshold time, all the contents of the recorder are reset;

[0009] When the user is editing, a command is sent to the recorder to query whether there is an ID. If the return value is true, it is determined whether the current user ID is consistent with the ID in the recorder. If they are consistent, editing can be performed. If they are inconsistent, editing cannot be performed. If the return value is false, editing can be performed.

[0010] Preferably, the message of the main thread includes a first message and a second message;

[0011] When receiving the first message, the timer sends a first designated message to the main thread, receives a second designated message fed back by the main program according to the first designated message, and stores the second designated message in the recorder;

[0012] When the second message is received, the timer resets all contents in the recorder.

[0013] Preferably, the method further comprises the following steps:

[0014] When the content quantity of the second designated message reaches the quantity threshold, all the contents in the recorder are reset;

[0015] The message of the main thread also includes a third message;

[0016] When the third message is received, the contents of the second specified message in the recorder will be reset.

[0017] Preferably, the method further comprises the following steps:

[0018] If the return value is true, get the ID and access time of the current access user;

[0019] When the main thread is idle and there are multiple users accessing and editing, the ID corresponding to the earliest access time is obtained and recorded in the recorder.

[0020] Preferably, the method further comprises the following steps:

[0021] Set the user's permission level;

[0022] If the return value is true, get the ID and permission level of the current access user;

[0023] When the main thread is idle and there are multiple users accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the recorder.

[0024] A web page control system that only allows one person to edit, using a web page control system that only allows one person to edit, including 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, and the timer is used to periodically receive messages from the main thread;

[0026] The recording module is used for recording the ID of the main thread in the recorder after the timer receives the message of the main thread, generating preset content according to the message of the main thread, and storing the content in the recorder, wherein if the message of the main thread is not received by the timer within a threshold time, all the contents of the recorder are reset;

[0027] The operation module is used to send a query instruction to the recorder to check whether 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 of the main thread include a first message, a second message and a third message;

[0029] When receiving the first message, the timer sends a first designated message to the main thread, receives a second designated message fed back by the main program according to the first designated message, and stores the second designated message in the recorder;

[0030] When receiving the second message, the timer resets all contents in the recorder;

[0031] When the 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 for resetting all the contents in the recorder by a timer when the content quantity of the second designated message reaches a quantity threshold.

[0033] Preferably, it also includes a first queuing module, which is used to obtain the ID and access time of the current access user if the return value is true;

[0034] When the main thread is idle and there are multiple users accessing and editing, the ID corresponding to the earliest access time is obtained and recorded in the recorder.

[0035] Preferably, it further comprises a second queuing module, wherein the second queuing module is used to set the user's authority level;

[0036] If the return value is true, get the ID and permission level of the current access user;

[0037] When the main thread is idle and there are multiple users accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the recorder.

[0038] One of the above technical solutions has the following advantages or beneficial effects: the present invention can effectively avoid conflicts and data inconsistencies that may arise when multiple users edit the same resource at the same time by performing permission checks before the user starts editing, thereby improving data integrity and consistency in Web editing. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 is a flow chart of an embodiment of the method of the present invention.

[0040] Figure 2 It is a schematic diagram of the structure of an embodiment of the system of the present invention. DETAILED DESCRIPTION

[0041] The embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0042] In the description of the embodiments of the present invention, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0043] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, the meaning of "plurality" is two or more. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0044] like Figures 1-2 As shown, a method for controlling a web page that allows only one person to edit includes the following steps:

[0045] Create a Worker thread, and define a timer through the Worker thread, where the timer is used to periodically receive messages from the main thread;

[0046] When the timer receives a message from the main thread, the ID of the main thread is recorded in the recorder, preset content is generated according to the message of the main thread, and the content is stored in the recorder, wherein if the message of the main thread is not received by the timer after a threshold time, all the contents of the recorder are reset;

[0047] When the user is editing, a command is sent to the recorder to query whether there is an ID. If the return value is true, it is determined whether the current user ID is consistent with the ID in the recorder. If they are consistent, editing can be performed. If they are inconsistent, editing cannot be performed. If the return value is false, editing can be performed.

[0048] The main thread is a thread for editing a Web page. In order to limit the number of editors of a Web page, the present invention is provided with the timer, which can obtain the message of the main thread within a fixed time interval, and the specific time interval can be 0.5 to 1S. Because the main thread will produce different messages when performing different operations. In the present invention, preset content will be generated according to different message contents, and the content will be stored in the recorder. The state of the main thread can be known through the content. At the same time, the recorder will record the ID of the current main thread, and the user entering will be judged by the ID. Only when the current user ID is consistent with the ID in the recorder, the user can edit. If not, it means that the current editing user is inconsistent with the user to be edited. At this time, the user who wants to enter the editing is not allowed to edit the main thread of the Web page. When the message of the thread is not received by the timer within the threshold time, there may be a problem with the connection between the user end and the main thread. If all the contents of the recorder are directly reset, the current ID will be deleted. When the user restores the connection in a short time, the editing cannot be continued, which is very inconvenient for users working outside. Therefore, a threshold time is provided in the present invention, and only when the message of the main thread is not received after the threshold time, all contents of the recorder will be reset. The editable qualification is vacated so that the next user can edit the Web.

[0049] The present invention can effectively avoid conflicts and data inconsistency problems that may occur when multiple users edit the same resource at the same time by performing permission checks before the user starts editing, thereby improving data integrity and consistency in Web editing.

[0050] Preferably, the message of the main thread includes a first message and a second message;

[0051] When receiving the first message, the timer sends a first designated message to the main thread, receives a second designated message fed back by the main program according to the first designated message, and stores the second designated message in the recorder;

[0052] When the second message is received, the timer resets all contents in the recorder.

[0053] The first message is a permanent message. When the user enters the main thread, the main thread will send the first message to the timer, which means that a user has entered the main thread to edit. When the timer receives the first message, it will send the first designated message to the main thread. When the main program sends the second designated message based on the first designated message, the second designated message can be used to confirm that the user and the main thread are still connected.

[0054] The second message is a message indicating that the user has exited the main thread. When the second message is received, it means that the editing user has exited editing. At this time, all contents in the recorder can be reset and the ID option can be cleared to facilitate other users to come in.

[0055] Preferably, the method further comprises the following steps:

[0056] When the content quantity of the second designated message reaches the quantity threshold, all the contents in the recorder are reset;

[0057] The message of the main thread also includes a third message;

[0058] When the third message is received, the contents of the second specified message in the recorder will be reset.

[0059] Since the first message is processed, the second designated message is used to determine whether there is still a connection between the user and the main thread, but it is impossible to determine whether the user is programming. If the user enters the main thread and does not edit, it will affect the editing progress of the Web. For this reason, in the present invention, it is determined whether the content in the recorder is reset according to the content quantity of the second designated message. Since the first designated message is sent by a timer, and the timer sends information at a fixed time interval, the number of the second designated message multiplied by the time interval can be regarded as the connection duration between the user and the main thread. When the connection duration is greater than the threshold (that is, the content quantity of the second designated message reaches the quantity threshold), all the contents in the recorder will be reset. To reduce the occupation of the main thread by idle users. When the main thread receives the edit, it will send a third message to the timer, and after the timer receives the third message, it will reset the content of the second designated message in the recorder, so that the content quantity of the second designated message is reset to zero. As long as the user is in the editing state, the connection duration can be reset all the time, so that the editing user can be cleared because the connection duration reaches the threshold.

[0060] Preferably, the method further comprises the following steps:

[0061] If the return value is true, get the ID and access time of the current access user;

[0062] When the main thread is idle and there are multiple users accessing and editing, the ID corresponding to the earliest access time is obtained and recorded in the recorder.

[0063] During the editing process, multiple other users may want to enter the main thread of the Web to edit. At this time, it is necessary to record the ID and access time of the current accessing user, and record the ID corresponding to the earliest access time in the recorder. The access order is determined by the access time. This ensures that the system can operate smoothly and will not be accessed by multiple users when the main thread is idle.

[0064] Preferably, the method further comprises the following steps:

[0065] Set the user's permission level;

[0066] If the return value is true, get the ID and permission level of the current access user;

[0067] When the main thread is idle and there are multiple users accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the recorder.

[0068] In another embodiment, it will be done according to the user's authority level, and different job authority levels can be pre-set. For example: Administrator>Finance>Administration>Business. When multiple users access the vacant main thread, users with higher authority levels will be given priority. This can reasonably arrange the work order to a certain extent and improve work efficiency.

[0069] A web page control system that only allows one person to edit, using a web page control system that only allows one person to edit, including 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, and the timer is used to periodically receive messages from the main thread;

[0071] The recording module is used for recording the ID of the main thread in the recorder after the timer receives the message of the main thread, generating preset content according to the message of the main thread, and storing the content in the recorder, wherein if the message of the main thread is not received by the timer within a threshold time, all the contents of the recorder are reset;

[0072] The operation module is used to send a query instruction to the recorder to check whether 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 of the main thread include a first message, a second message and a third message;

[0074] When receiving the first message, the timer sends a first designated message to the main thread, receives a second designated message fed back by the main program according to the first designated message, and stores the second designated message in the recorder;

[0075] When receiving the second message, the timer resets all contents in the recorder;

[0076] When the 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 for resetting all the contents in the recorder by a timer when the content quantity of the second designated message reaches a quantity threshold.

[0078] Preferably, it also includes a first queuing module, which is used to obtain the ID and access time of the current access user if the return value is true;

[0079] When the main thread is idle and there are multiple users accessing and editing, the ID corresponding to the earliest access time is obtained and recorded in the recorder.

[0080] Preferably, it further comprises a second queuing module, wherein the second queuing module is used to set the user's authority level;

[0081] If the return value is true, get the ID and permission level of the current access user;

[0082] When the main thread is idle and there are multiple users accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the recorder.

[0083] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0084] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A method for controlling a web page that allows only one person to edit, characterized in that: The steps include: Create a Worker thread, and define a timer through the Worker thread, where the timer is used to periodically receive messages from the main thread; When the timer receives a message from the main thread, the ID of the main thread is recorded in the recorder, preset content is generated according to the message of the main thread, and the content is stored in the recorder, wherein if the message of the main thread is not received by the timer after a threshold time, all the contents of the recorder are reset; When the user is editing, a command is sent to the recorder to query whether there is an ID. If the return value is true, it is determined whether the current user ID is consistent with the ID in the recorder. If they are consistent, editing can be performed. If they are inconsistent, editing cannot be performed. If the return value is false, editing can be performed.

2. A method for controlling a Web page that allows only one person to edit according to claim 1, characterized in that: The messages of the main thread include the first message and the second message; When receiving the first message, the timer sends a first designated message to the main thread, receives a second designated message fed back by the main program according to the first designated message, and stores the second designated message in the recorder; When the second message is received, the timer resets all contents in the recorder.

3. A method for controlling a web page that allows only one person to edit according to claim 2, characterized in that: The following steps are also included: When the content quantity of the second designated message reaches the quantity threshold, all the contents in the recorder are reset; The message of the main thread also includes a third message; When the third message is received, the contents of the second specified message in the recorder will be reset.

4. A method for controlling a Web page that allows only one person to edit according to claim 2, characterized in that: The following steps are also included: If the return value is true, get the ID and access time of the current access user; When the main thread is idle and there are multiple users accessing and editing, the ID corresponding to the earliest access time is obtained and recorded in the recorder.

5. A method for controlling a Web page that allows only one person to edit according to claim 2, characterized in that: The following steps are also included: Set the user's permission level; If the return value is true, get the ID and permission level of the current access user; When the main thread is idle and there are multiple users accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the recorder.

6. A web page control system that allows only one person to edit, using the web page control system that allows only one person to edit as claimed in any one of claims 1 to 5, characterized in that: Includes creation module, recording module and operation module; The creation module is used to create a Worker thread, and a timer is defined through the Worker thread, and the timer is used to periodically receive messages from the main thread; The recording module is used for recording the ID of the main thread in the recorder after the timer receives the message of the main thread, generating preset content according to the message of the main thread, and storing the content in the recorder, wherein if the message of the main thread is not received by the timer within a threshold time, all the contents of the recorder are reset; The operation module is used to send a query instruction to the recorder to check whether 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 according to claim 6, characterized in that: The messages of the main thread include the first message, the second message and the third message; When receiving the first message, the timer sends a first designated message to the main thread, receives a second designated message fed back by the main program according to the first designated message, and stores the second designated message in the recorder; When receiving the second message, the timer resets all contents in the recorder; When the 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 according to claim 7, characterized in that: It also includes a forced exit module, which is used for resetting all the contents in the recorder by a timer when the content quantity of the second designated message reaches a quantity threshold.

9. A web page control system that allows only one person to edit according to claim 7, characterized in that: It also includes a first queuing module, which is used to obtain the ID and access time of the current access user if the return value is true; When the main thread is idle and there are multiple users accessing and editing, the ID corresponding to the earliest access time is obtained and recorded in the recorder.

10. A web page control system that allows only one person to edit according to claim 7, characterized in that: Also included is a second queuing module, the second queuing module is used to set the user's authority level; If the return value is true, get the ID and permission level of the current access user; When the main thread is idle and there are multiple users accessing and editing, obtain the ID corresponding to the highest permission level and record the ID in the recorder.

Citation Information

Patent Citations

  • Data table inquiry method and equipment

    CN106681999A

  • Code online editing method and device, client, server and storage medium

    CN113961181A

  • Web-based resource rapid access method and system, medium and equipment

    CN114584543A

  • Dynamic form collaboration and authority control method

    CN115186195A

  • Data online coprocessing method and system

    CN116029265A