Operating methods, apparatus, equipment and readable storage media
By introducing a two-level conflict detection mechanism into the whiteboard system, the problem of inaccurate operation conflict judgment in multi-user whiteboard systems is solved, achieving determinism and security of operations, and improving the smoothness and fairness of online teaching.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING CENTURY TAL EDUCATION TECH CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-05-26
AI Technical Summary
Existing collaborative editing technologies cannot accurately determine the scope of operation in multi-user whiteboard systems, leading to problems such as handwriting errors, partial overwriting, and undo failure. Furthermore, the lack of an operation isolation mechanism for user identities affects the accurate presentation of content and the safety of teaching.
By constructing a two-tiered processing mechanism at both the message level and the point level, and introducing permission conflict detection and point-level spatial overlap judgment, the operation execution is dynamically determined to ensure the determinism and security of the operation results.
It achieves data consistency and smooth interaction in a multi-user collaborative environment, ensuring teachers' control and improving the smoothness and fairness of online teaching.
Smart Images

Figure CN122086263A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to an operation processing method, apparatus, device and readable storage medium. Background Technology
[0002] As corporate training and education become increasingly online and interactive, real-time collaborative whiteboards have become a core interactive tool in online classrooms. In practical applications, a single collaborative whiteboard system may be used simultaneously by multiple users online, requiring all parties to perform high-frequency, low-latency collaborative operations such as drawing annotations, creating graphics, and erasing content on the same whiteboard page.
[0003] Existing collaborative editing technologies, such as Operation Transformation (OT) or Conflict-Free Copy Data Type (CRDT), are geared towards structured document design. Their conflict handling mechanisms typically merge or transform entire messages, complete graphic objects, or document fragments. In free-form drawing whiteboard scenarios, this coarse-grained conflict handling method cannot perceive the smallest data unit within an operation, such as a single coordinate point in a trajectory. When multiple users draw or erase simultaneously in adjacent or overlapping areas, the system struggles to accurately determine the actual impact range of the operation, easily leading to problems such as illegible handwriting, partial overwriting, erase penetration, or undo failure, affecting the accurate presentation of content.
[0004] Therefore, there is an urgent need for an operation and processing method for whiteboard-type applications that are designed for large-scale online classroom scenarios and are suitable for high-degree-of-freedom, continuous spatial interaction, so as to achieve a real-time multi-person collaborative experience with high consistency, high security and high smoothness. Summary of the Invention
[0005] In view of this, in order to solve the above-mentioned technical problems, this application provides an operation processing method, apparatus, device and readable storage medium.
[0006] Specifically, this application is implemented through the following technical solution: According to a first aspect of the embodiments of this application, an operation processing method is provided, applied to a whiteboard system used collaboratively by multiple users, the method comprising: The system receives a current operation message initiated by any user when they need to perform an operation on the whiteboard, and filters out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard; the current operation message and each candidate operation message form a message pair. For any message pair, if there is a permission conflict between the current operation message and the candidate operation message in the message pair, a response indicating that the operation is rejected is returned to the user; the permission conflict means that the initiating user of the current operation message and the candidate operation message in the message pair are different, and the current operation message modifies the operation object created when the historical operation corresponding to the candidate operation message was executed. If there are no permission conflicts between the current operation message and the candidate operation message in each message pair, then for each message pair, it is checked whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, and the candidate operation indication corresponding to the message pair is determined based on the detection result and the operation type of the current operation message; wherein, the candidate operation indication indicates whether the operation is allowed or denied; the point-level spatial overlap indicates that there is at least one identical point position in the first point position set and the second point position set; the first point position set includes the point positions of the current operation corresponding to the current operation message in the message pair when it is executed on the whiteboard; the second point position set includes the point positions of the historical operation corresponding to the candidate operation message when it is executed on the whiteboard; Based on the candidate operation indications corresponding to each message pair, a response result is returned to the user indicating that the operation was rejected or that the operation has been executed.
[0007] In some embodiments, any operation message includes a set of point locations on the whiteboard where the operation corresponding to the operation message is executed; and any operation message has a corresponding operation type; filtering candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard includes: If the operation type corresponding to the current operation message is a drawing type, then for each historical operation message in the historical operation message set, if it is detected that the first point coordinate range of the current operation message and the second point coordinate range of the historical operation message have spatial overlap, then the historical operation message is regarded as a candidate operation message; wherein, the first point coordinate range is determined based on the point position set contained in the current operation message; the second point coordinate range is based on the point position set contained in the historical operation message.
[0008] In some embodiments, candidate operation messages that may conflict with the current operation information are filtered from the historical operation message set corresponding to the whiteboard, including: If the operation type corresponding to the current operation message is an erase type, then for each historical operation message in the historical operation message set, if it is detected that the point location set included in the historical operation message includes at least one erase target point of the current operation message, then the historical operation message is regarded as a candidate operation message; wherein, the erase target point is determined based on the point location set included in the current operation message.
[0009] In some embodiments, if the operation type corresponding to the current operation message is a cancellation type, the current operation message includes a target operation identifier, which is used to determine the historical operation message corresponding to the historical operation to be cancelled in the historical operation message set; filtering candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard includes: The historical operation messages in the historical operation message set that match the target operation identifier are selected as candidate operation messages.
[0010] In some embodiments, when the operation type corresponding to the current operation message is an erase or undo type, the method further includes: if no candidate operation message is found from the historical operation message set corresponding to the whiteboard, then a response result indicating rejection of the operation is returned to the user; wherein the response result indicating rejection of the operation also carries an error message, which is used to indicate that the target operation object does not exist.
[0011] In some embodiments, for any point in the first set of point locations, that point location forms a point location pair with each point in the second set of point locations; detecting whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair includes: For each pair of point locations, determine the distance between the two point locations in the pair; if it is detected that the distance between the two point locations in at least one pair of point locations is less than a set distance threshold, then it is determined that there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair; otherwise, it is determined that there is no point-level spatial overlap between the current operation message and the candidate operation message in the message pair.
[0012] In some embodiments, each operation message has a corresponding initiating user identifier and initiation timestamp; determining the corresponding candidate operation indication for the message based on the detection result and the operation type of the current operation message includes: If the operation type of the current operation message is drawing, then if the detection result indicates that there is no point-level spatial overlap, the candidate operation indication for the current operation message under the message pair is determined to indicate that the operation is allowed; if the detection result indicates that there is point-level spatial overlap, the candidate operation indication corresponding to the message pair is determined based on the set arbitration rules; the arbitration rules are constructed based on the initiation timestamp of the operation message, the initiating user identifier, and the operation type.
[0013] In some embodiments, determining the candidate operation indication corresponding to the message pair based on the detection result and the operation type of the current operation message includes: If the operation type corresponding to the current operation message is erase or undo, and the detection result indicates that there is no point-level spatial overlap, it is determined that the candidate operation indication for the current operation message under the message pair indicates a rejection operation; if the detection result indicates that there is point-level spatial overlap, it is determined that the candidate operation indication for the current operation message under the message pair indicates an allow operation.
[0014] In some embodiments, the candidate operation instruction corresponding to the message pair is determined based on the established arbitration rules, including: If the timestamps of the current operation message and the candidate operation message in the message pair are different, then the candidate operation instruction for the current operation message under the message pair is determined based on the comparison result of the timestamps of the current operation message and the candidate operation message; otherwise, the candidate operation instruction for the current operation message under the message pair is further determined based on the comparison result of the operation priority of the initiating user of the current operation message and the candidate operation message.
[0015] In some embodiments, based on the candidate operation indications corresponding to each message pair, a response result indicating whether the operation was rejected or executed is returned to the user, including: If at least one message indicates a rejection of the corresponding candidate operation, a response indicating a rejection is returned to the user; if all messages indicate an allow of the corresponding candidate operation, the current operation corresponding to the current operation message is executed on the whiteboard, and a response indicating that the operation has been executed is returned to the user after execution.
[0016] In some embodiments, if the operation type of the current operation message is an erase type, before executing the current operation corresponding to the current operation message on the whiteboard, the method further includes: For each erase target point in the current operation message, it is checked whether the erase target point is in a locked state; the locked state is used to indicate that the erase target point has been occupied by other concurrent operations; each erase target point in the current operation message is determined based on the set of point positions contained in the current operation message; If not, a hardware-level atomic operation instruction is initiated to lock the erase target point, and the current operation corresponding to the current operation message is executed on the whiteboard for the erase target point; if yes, a conflict log is recorded.
[0017] In some embodiments, whether the erase target point is in a locked state is indicated by a setting field value associated with the erase target point; wherein, when the setting field value is an empty string, it indicates that the erase target point is in an unlocked state; when the setting field value is a non-empty string, it indicates that the erase target point is in a locked state, and the non-empty string is used to identify the user who initiated the operation currently holding the lock.
[0018] In some embodiments, the current operation corresponding to the current operation message is performed on the whiteboard to erase the target point, including: updating the visual state of the erase target point so that the erase target point appears to be erased on the whiteboard; wherein the original data of the erase target point is retained and used to restore the visible state of the erase target point based on the original data when performing the undo operation for the current operation.
[0019] According to a second aspect of the embodiments of this application, a whiteboard system for multi-user collaborative use is provided, the apparatus comprising: The conflict message filtering module is configured to receive a current operation message initiated by any user when an operation needs to be performed on the whiteboard, and to filter out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard; the current operation message and each candidate operation message form a message pair. The message-level conflict detection module is configured to, for any message pair, if the current operation message and the candidate operation message in the message pair have a permission conflict, return a response result indicating that the operation is rejected to the user; the permission conflict indicates that the current operation message and the candidate operation message in the message pair are initiated by different users, and the current operation message modifies the operation object created when the historical operation corresponding to the candidate operation message was executed. The point-level spatial overlap detection module is configured to, for each message pair, detect whether there is point-level spatial overlap between the current operation message and the candidate operation message if there is no permission conflict between them. Based on the detection result and the operation type of the current operation message, it determines the candidate operation indication corresponding to the message pair. The candidate operation indication indicates whether the operation is allowed or denied. The point-level spatial overlap indicates that there is at least one identical point position in the first set of point positions and the second set of point positions. The first set of point positions includes the point positions of the current operation corresponding to the current operation message in the message pair when it is executed on the whiteboard. The second set of point positions includes the point positions of the historical operation corresponding to the candidate operation message when it is executed on the whiteboard. The response result return module is configured to return a response result to the user, indicating whether the operation has been rejected or has been executed, based on the candidate operation indication corresponding to each message pair.
[0020] In some embodiments, any operation message includes a set of point locations on the whiteboard where the operation corresponding to the operation message is executed; and any operation message has a corresponding operation type; when the conflict message filtering module is configured to filter candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard, it includes: If the operation type corresponding to the current operation message is a drawing type, then for each historical operation message in the historical operation message set, if it is detected that the first point coordinate range of the current operation message and the second point coordinate range of the historical operation message have spatial overlap, then the historical operation message is regarded as a candidate operation message; wherein, the first point coordinate range is determined based on the point position set contained in the current operation message; the second point coordinate range is based on the point position set contained in the historical operation message.
[0021] In some embodiments, when the conflict message filtering module is configured to filter candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard, it includes: If the operation type corresponding to the current operation message is an erase type, then for each historical operation message in the historical operation message set, if it is detected that the point location set included in the historical operation message includes at least one erase target point of the current operation message, then the historical operation message is regarded as a candidate operation message; wherein, the erase target point is determined based on the point location set included in the current operation message.
[0022] In some embodiments, if the operation type corresponding to the current operation message is a cancellation type, the current operation message includes a target operation identifier, which is used to determine the historical operation message corresponding to the historical operation to be cancelled in the historical operation message set; when the conflict message filtering module is configured to filter out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard, it includes: taking the historical operation message in the historical operation message set that matches the target operation identifier as the candidate operation message.
[0023] In some embodiments, when the operation type corresponding to the current operation message is an erase or undo operation, the apparatus further includes a response module configured to: If no candidate operation message is found from the historical operation message set corresponding to the whiteboard, a response indicating rejection of the operation is returned to the user; wherein, the response indicating rejection of the operation also carries an error message, which indicates that the target operation object does not exist.
[0024] In some embodiments, for any point in the first set of point locations, that point location forms a point location pair with each point in the second set of point locations; when the point-level spatial overlap detection module is configured to detect whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, it includes: For each pair of point positions, determine the distance between the two point positions in that pair; If it is detected that the distance between two points in at least one point location pair is less than a set distance threshold, then it is determined that there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair. Otherwise, it is determined that there is no point-level spatial overlap between the current operation message and the candidate operation message in the message pair.
[0025] In some embodiments, any operation message has a corresponding initiating user identifier and initiation timestamp; when the point-level spatial overlap detection module is configured to determine the corresponding candidate operation indication for the message based on the detection result and the operation type of the current operation message, it includes: The first determining module is configured to, if the operation type of the current operation message is drawing, then, if the detection result indicates that there is no point-level spatial overlap, determine that the candidate operation indication for the current operation message under the message pair indicates that the operation is allowed; if the detection result indicates that there is point-level spatial overlap, determine the candidate operation indication corresponding to the message pair based on the set arbitration rules; the arbitration rules are constructed based on the initiation timestamp of the operation message, the initiating user identifier, and the operation type.
[0026] In some embodiments, when the point-level spatial overlap detection module is configured to determine the candidate operation indication corresponding to the message pair based on the detection result and the operation type of the current operation message, it includes: The second determining module is configured to, if the operation type corresponding to the current operation message is erase or undo, determine that the candidate operation indication for the current operation message under the message pair indicates a rejection operation if the detection result indicates that there is no point-level spatial overlap; and determine that the candidate operation indication for the current operation message under the message pair indicates an allow operation if the detection result indicates that there is point-level spatial overlap.
[0027] In some embodiments, when the first determining module is configured to determine the candidate operation indication corresponding to the message pair based on a set arbitration rule, it includes: If the timestamps of the current operation message and the candidate operation message in the message pair are different, then the candidate operation instruction for the current operation message under the message pair is determined based on the comparison result of the timestamps of the current operation message and the candidate operation message. Otherwise, based on the comparison of the operation priorities of the initiating users of the current operation message and the candidate operation message, the candidate operation instruction for the current operation message under the message pair is determined.
[0028] In some embodiments, the response result returning module includes: The rejection module is configured to return a response indicating rejection to the user if at least one message indicates rejection for the corresponding candidate operation. The allow module is configured to execute the current operation corresponding to the current operation message on the whiteboard if all message pairs indicate that the operation is allowed, and return a response result indicating that the operation has been executed to the user after execution.
[0029] In some embodiments, if the operation type of the current operation message is an erase type, the enabling module is configured to: Before executing the current operation corresponding to the current operation message on the whiteboard: For each erase target point in the current operation message, it is checked whether the erase target point is in a locked state; the locked state is used to indicate that the erase target point has been occupied by other concurrent operations; each erase target point in the current operation message is determined based on the set of point positions contained in the current operation message; If not, a hardware-level atomic operation instruction is initiated to lock the erase target point, and the current operation corresponding to the current operation message is executed on the whiteboard for the erase target point; if yes, a conflict log is recorded.
[0030] In some embodiments, whether the erase target point is in a locked state is indicated by a setting field value associated with the erase target point; wherein, when the setting field value is an empty string, it indicates that the erase target point is in an unlocked state; when the setting field value is a non-empty string, it indicates that the erase target point is in a locked state, and the non-empty string is used to identify the user who initiated the operation currently holding the lock.
[0031] In some embodiments, when the permission module is configured to perform the current operation corresponding to the current operation message on the erase target point on the whiteboard, it includes: Update the visual state of the erase target point so that the erase target point appears to have been erased on the whiteboard; wherein, the original data of the erase target point is retained and used to restore the visibility state of the erase target point based on the original data when performing an undo operation on the current operation.
[0032] According to a third aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a memory and a processor; the memory being used to store a computer program; the processor being used to execute the above-described operation processing method by invoking the computer program.
[0033] According to a fourth aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, wherein the program, when executed by a processor, implements the above-described operation processing method.
[0034] The technical solutions provided in this application embodiment may include the following beneficial effects: In the technical solution provided in this application, a two-tiered processing mechanism at the message and point levels is constructed. At the message level, permission conflict detection based on user identity is introduced to effectively prevent non-creator users from accidentally deleting or tampering with other people's content, achieving fine-grained operation isolation. At the point level, conflict detection is pushed down to the smallest data unit coordinate point. By comparing the point position sets of the current operation and historical operations, spatial overlapping areas are accurately identified, and the operation type corresponding to the current operation message is dynamically used to determine whether execution is allowed, ensuring that the operation result is definite and predictable. This achieves hierarchical deterministic operation conflict handling, thereby ensuring the teacher's control over the teaching content in scenarios where multiple users collaboratively use the whiteboard, and supporting students' safe participation in interaction, improving the fluency, fairness, and user experience of online teaching.
[0035] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this application. Furthermore, no embodiment in this application needs to achieve all the effects described above. Attached Figure Description
[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0037] Figure 1A This is a schematic flowchart illustrating an operational processing method according to an exemplary embodiment of this application; Figure 1B This is an exemplary embodiment of the present application illustrating a method for filtering candidate operation messages under different operation types of the current operation message; Figure 1C This is a flowchart illustrating a step in an exemplary embodiment of this application to detect whether there is point-level spatial overlap between the current operation message and the candidate operation message in a message pair based on point location pairs; Figure 2A This is a schematic diagram illustrating an exemplary embodiment of the present application of a step for determining the candidate operation indication corresponding to the message pair based on the detection result and the operation type of the current operation message; Figure 2B This is an exemplary embodiment of the present application illustrating the implementation steps of determining the corresponding candidate operation instruction for the message pair based on a set arbitration rule; Figure 2C This is a schematic diagram illustrating a multi-dimensional message-level conflict detection according to an exemplary embodiment of this application; Figure 3 This is a schematic diagram illustrating the steps of point-level locking and execution for an erase-type operation, as shown in an exemplary embodiment of this application; Figure 4 This is an exemplary embodiment of the present application illustrating an operation processing interaction flowchart in a scenario where three users collaboratively draw / erase on a whiteboard; Figure 5 This is a schematic diagram of the structure of an operation processing device shown in an exemplary embodiment of this application; Figure 6 This is a hardware schematic diagram of an electronic device illustrated in an exemplary embodiment of this application. Detailed Implementation
[0038] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another.
[0039] As corporate training and education become increasingly online and interactive, real-time collaborative whiteboards have become a core interactive tool in online classrooms. In practical applications, a single classroom may simultaneously accommodate hundreds or even thousands of users, such as lecturers, teaching assistants, students, and observers. All parties need to perform high-frequency, low-latency collaborative operations on the same whiteboard page, such as drawing annotations, creating graphics, erasing content, and deriving formulas.
[0040] Existing collaborative editing technologies, such as Operation Transformation (OT) or Conflict-Free Copy Data Type (CRDT), are geared towards structured document design. Their conflict resolution mechanisms typically merge or transform entire messages, complete graphic objects, or document fragments. In free-form drawing whiteboard scenarios, this coarse-grained conflict resolution approach fails to perceive the smallest data unit within an operation, such as a single coordinate point in a trajectory. When multiple users simultaneously draw or erase in adjacent or overlapping areas, the system struggles to accurately determine the actual scope of the operation's impact, easily leading to issues like illegible handwriting, partial overwriting, erase penetration, or undo failure, affecting the accurate presentation of content. Furthermore, existing solutions generally lack user-identity-based operation isolation mechanisms, allowing ordinary students to accidentally delete crucial whiteboard notes from instructors, or malicious users to disrupt normal teaching order, undermining the fairness and security of classroom collaboration.
[0041] Therefore, there is an urgent need for an operation and processing method for whiteboard-type applications that are designed for large-scale online classroom scenarios and are suitable for high-degree-of-freedom, continuous spatial interaction, so as to achieve a real-time multi-person collaborative experience with high consistency, high security and high smoothness.
[0042] In view of this, this application provides an operation processing method applicable to the aforementioned multi-user collaborative whiteboard system. This multi-user collaborative system is used online by at least two user terminals for fine-grained conflict detection and deterministic execution control of operation messages received by the whiteboard system. This method can be implemented by the server-side of the whiteboard system, such as a collaborative server, a real-time message processing engine, a state synchronization middleware, or a distributed conflict arbitration module, or it can be implemented in a client or edge node with collaborative processing capabilities. This application does not limit the executing entity; other computing devices or system architectures that can be used to implement the method steps fall within the protection scope of this application.
[0043] In this application, the whiteboard system receives arbitrary type operation messages from any user, including message-level operation description information and point-level operation description information. The message-level operation description information defines the operation that the user needs to perform on the whiteboard from the dimensions of operation semantics and access control, while the point-level operation description information is used to perform point-level modeling and conflict localization of the operation that the user needs to perform on the whiteboard from the dimensions of spatial geometry and state atomism.
[0044] The message-level operation description information may include at least the operation message unique identifier keyMsgId, the operation type (type) corresponding to the current operation message, the initiating user identifier (UID), and the initiation timestamp (dataCreateTimestamp, accurate to milliseconds). This operation message unique identifier is used to uniquely identify an operation message in a collaborative environment to support message deduplication, reversal location, and conflict tracing. This operation message unique identifier can be assigned by the system when the message is generated.
[0045] When the operation type is drawing, the message-level operation description information may also include line attribute states. These line attribute states describe the rendering characteristics of the graphic elements generated or affected by the current operation, supporting semantic operation management. For example, the line attribute states include line index (lineIndex), line type (lineType), line width (lineWidth), stroke color (strokeColor), and transformation matrix (transformMatrix). These attributes collectively define the visual and structural characteristics of a logical drawing unit on the whiteboard.
[0046] When the operation type is an undo or erase type, the message-level operation description information may also include an identifier of the target object (such as targetLineIndex or keyMsgId) indicating when the current operation is performed on the whiteboard, to uniquely associate the undoed historical operation message.
[0047] The point-level operation description information includes the attribute information of each point involved when the current operation corresponding to the current operation message is executed on the whiteboard. This attribute information may include at least the point position, point-level line width, and point type. The point position can be represented by normalized point coordinates, and the point type is used to distinguish whether the point belongs to a start point, end point, or trajectory point.
[0048] Based on the above-mentioned two-level multi-state fusion data structure design, this embodiment constructs a collaborative whiteboard conflict handling architecture based on two-level multi-state fusion. When a current operation message initiated by any user on the whiteboard is received, based on the message-level operation description information and the point-level operation description information, two-level collaborative conflict detection and arbitration are performed on the current operation message and other historical or concurrent operation messages that may conflict with the current operation message. This achieves permission verification and operation sorting at the message level, spatial overlap judgment and state locking at the point level, and atomic-level conflict resolution, ensuring data consistency and smooth interaction in a multi-user collaborative environment.
[0049] Based on this, see Figure 1AThe illustrated flowchart represents an operation processing method, which may include at least the following steps: S101, receive a current operation message initiated by any user when they need to perform an operation on the whiteboard, and filter out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard; the current operation message and each candidate operation message form a message pair respectively; The current operation message represents an operation instruction initiated by any user using the whiteboard system on the whiteboard that has not yet been finalized. This message fully describes an atomic operation that the user intends to perform on the whiteboard. For example, if user 1 intends to draw a line on the whiteboard, the current operation message includes message-level operation description information such as user 1's identifier, operation type (e.g., drawing), and the timestamp of initiating the current operation message, as well as point-level operation description information such as the point sequence of the drawing trajectory, brush color, and line width. Similarly, if user 2 intends to erase a graphic on the whiteboard, the current operation message includes the point sequence of the eraser's movement trajectory and the erasure radius to determine the area to be erased or the target point. If user 3 intends to undo the previous operation, the current operation message includes a target operation identifier to represent a historical operation to be undone.
[0050] The historical operation message set represents the collection of all operation messages received and temporarily stored before the current operation message was received. These messages are initiated by various users collaboratively using the whiteboard system during the collaborative use of the whiteboard. The historical operations corresponding to the historical operation messages in this set may have already been executed on the whiteboard or may be in an unexecuted state. Operation messages that are not yet executed are included in the conflict detection scope because they were initiated earlier than the current operation message in terms of logical timing.
[0051] In this embodiment, any operation message received by the whiteboard system (including any message from the current operation message and the historical operation message set) has a corresponding operation type. The operation type is used to characterize the semantic behavior of the operation on the whiteboard, including but not limited to drawing operations, erasing operations, undo operations, text input operations, or screen clearing operations.
[0052] The data dimensions and conflict determination logic of operations differ depending on the type of operation. For example, the conflict between drawing and erasing operations mainly lies in the spatial overlap between the operation areas, while the conflict between undo operations mainly lies in whether the operation to be undone exists and whether the undo permission is available. Therefore, in this embodiment, the corresponding conflict detection method can be dynamically selected based on the operation type of the current operation carried by the current operation message, which indicates the current operation corresponding to the current operation message. Based on the conflict detection method, candidate operation messages that may conflict with the current operation information can be filtered from the historical operation message set.
[0053] See Figure 1B This example illustrates how to filter candidate operation messages under different operation types of the current operation message. In the process of filtering candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard, a differentiated filtering strategy is adopted based on different operation types: As described above, in this embodiment, any operation message received by the whiteboard system includes the set of point locations on the whiteboard where the corresponding operation is executed; that is, the set of all coordinate points on the whiteboard space where the operation is performed. Based on this: (1) When the operation type of the current operation message is drawing, it is necessary to detect candidate operation messages that may cause problems such as visual overlay, data conflict or permission competition from the perspective of spatial overlap. Therefore, a spatial indexing mechanism can be used to filter candidate operation messages that may have conflicts. That is, for each historical operation message in the historical operation message set, if the coordinate range of the first point of the current operation message is detected to have spatial overlap with the coordinate range of the second point of the historical operation message, then the historical operation message is regarded as a candidate operation message.
[0054] The first point coordinate range is determined based on the set of point positions contained in the current operation message; the second point coordinate range is based on the set of point positions contained in the historical operation messages. The point coordinate range represents the spatial area covered by all spatial points (i.e., the set of point positions) involved in an operation within a two-dimensional whiteboard coordinate system. It can typically be represented as an axis-aligned bounding box (AABB) of the set of point positions, i.e., a rectangular area formed by the minimum / maximum x and y coordinates of all points. Alternatively, a more refined spatial indexing structure such as R-tree nodes, quadtree regions, or polygonal convex hulls can be used to characterize the spatial influence range of the operation. It is understood that the terms "first" and "second" in "first point coordinate range" and "second point coordinate range" are only used to logically distinguish instances of the same concept in different operational contexts to avoid confusion, and do not possess any specific meaning.
[0055] The coordinate ranges of the first point and the second point overlap spatially. It is not required that the points in the two ranges completely coincide. It can be understood that when the current operation corresponding to the current operation message and the historical operation corresponding to the candidate operation message are executed on the whiteboard, their areas of influence intersect geometrically, constituting a conflict in the sense of collaborative editing, such as a newly drawn line passing through an existing graphic.
[0056] For example, assuming the whiteboard uses a normalized coordinate system (0.0 ~ 1.0), the current operation message is: User A draws a diagonal line with the set of point positions [(0.2, 0.3), (0.4, 0.5), (0.6, 0.7)], and the coordinates of the first point are in the range x∈[0.2,0.6], y∈ [0.3, 0.7]: ①Historical operation message 1: The horizontal line previously drawn by user B has a point position set of [(0.1, 0.5), (0.5,0.5), (0.9, 0.5)], and the coordinate range of the second point is: x∈[0.1, 0.9], y∈[0.5, 0.5]; The coordinate range of the second point overlaps with the coordinate range of the first point of the current operation message in the region (0.2~0.6, y=0.5), and it is considered as a candidate operation message that may conflict with the current operation message; ② Historical operation message 2: The text written by user C in the lower right corner, with the point position set as [(0.8, 0.8), (0.85, 0.85)], and the coordinate range of the second point as: x∈[0.8, 0.85], y∈[0.8, 0.85]; Therefore, the coordinate range of the second point does not intersect with the coordinate range of the first point in the current operation message, and there is no spatial overlap. It is determined that there is no possibility of conflict between the historical operation message 2 and the current operation message.
[0057] (2) If the operation type corresponding to the current operation message is the erase type, then for each historical operation message in the historical operation message set, if it is detected that the point location set included in the historical operation message includes at least one erase target point of the current operation message, then the historical operation message is regarded as a candidate operation message; wherein, the erase target point is determined based on the point location set included in the current operation message.
[0058] The erase target point refers to the specific coordinates of the whiteboard content within the spatial area covered by the current erase operation, which needs to be marked as erased or visually removed. This erase target point can be determined as follows: The current erase operation message contains a set of point locations that record the trajectory points of the eraser when the user drags it. Based on this set of point locations and a preset erase radius (or brush size), a continuous erase area (such as a series of circular coverage areas or their polygonal approximations) can be determined. This erase area is then spatially matched with all existing content on the whiteboard, and all historical handwriting points falling within this area are extracted; these are used as the erase target points for the current operation. The set of point locations for the current operation is only used to define the motion trajectory of the erase tool, while the erase target point is the result of this motion trajectory acting on the operation object created on the whiteboard by the historical operation corresponding to the historical operation message.
[0059] When filtering candidate operation messages, the historical operation message set is traversed. If the point location set of the historical operation message contains at least one of the above-mentioned erase target points, it means that the content of the historical operation on the whiteboard is affected by the current operation, and it should be regarded as a candidate operation message for subsequent status update or permission arbitration.
[0060] Taking the whiteboard using a normalized coordinate system (0.0 ~ 1.0) as an example, the current operation message (the user drags the eraser from left to right, the set of point positions (eraser trajectory): [(0.4, 0.5), (0.5, 0.5), (0.6, 0.5)], the erasure radius is 0.05, then the generated erasure area is the union of three circles centered at these three points with a radius of 0.05: ① Historical Operation Message A: A vertical line previously drawn by the user, with the following point positions: [(0.5, 0.3), (0.5, 0.4), (0.5, 0.5), (0.5, 0.6), (0.5, 0.7)]. Point (0.5, 0.5) falls within the erasure area and is therefore selected as the erasure target point. Historical Operation Message A is chosen as the candidate operation message. ② Historical operation message B: The text written by the user in the upper left corner, with the point position set as: [(0.2, 0.2), (0.25, 0.25)]. All points are far away from the erasure area and do not include the erasure target point. There is no possibility of conflict between historical operation message B and the current operation message.
[0061] (3) If the operation type corresponding to the current operation message is the undo type, the current operation message includes a target operation identifier. The target operation identifier is used to determine the historical operation message corresponding to the historical operation to be undone in the historical operation message set, so as to accurately indicate the specific operation that the user intends to undone. Since the undo operation is essentially a reverse reference to an existing operation, the key to its conflict detection lies in whether the target exists and whether it is undone. Therefore, the historical operation messages in the historical operation message set that match the target operation identifier can be used as candidate operation messages.
[0062] Suppose a collaborative whiteboard system assigns an incrementing lineIndex as a locally unique identifier to each drawing / text operation in the order of operation. Historical operation messages include: Operation #0 (User A): Draw a line, lineIndex=0 Operation #1 (User B): Input text, lineIndex=1 Operation #2 (User A): Draw another line, lineIndex=2 Current operation message: User A clicks "Undo previous step", target operation identifier: targetLineIndex=2, then search for the message with lineIndex == 2 in the historical operation message set, find operation #2, and take this message as the only candidate operation message.
[0063] Furthermore, since the semantic validity of erase and undo operations depends on the existence of a specific historical operation object—that is, an erase operation requires content to be erased, and an undo operation requires a target operation to be undone—if no candidate operation message is found from the historical operation message set corresponding to the whiteboard when the current operation message corresponds to an erase or undo operation, it indicates that the target operation object on which the current operation depends does not exist or is inaccessible in the current whiteboard state. In this case, a response indicating operation rejection is returned to the user. This response can also carry an error message indicating that the target operation object does not exist; for example, it can include a predefined error code TARGET_NOT_FOUND, or an equivalent semantic description (such as "Unable to find content to erase" or "Specified operation has been deleted or is invalid"). This approach avoids meaningless processing of invalid operations and provides parsable feedback to the client, facilitating logging, user prompts, or the implementation of automatic retry strategies.
[0064] S102, for any message pair, if there is a permission conflict between the current operation message and the candidate operation message in the message pair, then return a response result indicating that the operation is rejected to the user; the permission conflict means that the initiating user of the current operation message and the candidate operation message in the message pair are different, and the current operation message modifies the operation object created when the historical operation corresponding to the candidate operation message was executed. The permission conflict indicates that the current operation message attempts to modify an operation object created by another user, and system policy prohibits cross-user modification. For this permission conflict to occur, the following two conditions must be met: the initiating user of the current operation message and the candidate operation message are different; the operation type of the current operation message is a modification operation (such as erase or undo), and the object of the current operation is the content created on the whiteboard by the historical operation corresponding to the candidate operation message. In other words, the essence of a permission conflict is that a non-creator user attempts to delete or revoke content created by someone else.
[0065] Based on this, when performing permission conflict detection, it can be checked whether the current operation message and the candidate operation message in the message pair meet the following permission conflict detection conditions: a. The operation type of the current operation message is any operation type in the modification type operation set; b. The initiating user identifier of the current operation message is different from the initiating user identifier of the candidate operation message; c. The historical operation corresponding to the candidate operation message has created a visible operation object on the whiteboard. If all these detection conditions are met, it can be determined that there is a permission conflict between the current operation message and the candidate operation message in the message pair. For example, ① Historical operation message: User A draws a line, uid = "A"; Current operation message: User A initiated an erase operation, uid = "A"; There is no permission conflict between the two; Alternatively, ② Historical operation message: User A draws a line, uid = "A"; Current operation message: User B initiated an erase operation, uid = "B", and its erase trajectory covers this line; There is a permission conflict between the two.
[0066] If a permission conflict exists between the current operation message and the candidate operation messages in any message pair, a response denying the operation is generated and returned to the user who initiated the current operation message. Simultaneously, the subsequent detection process for that message pair is terminated to prevent invalid or unauthorized state changes. This response may include explicit error messages, such as the text "The current user does not have permission to modify content created by other users" or the error code PERMISSION_DENIED. If the current operation involves multiple candidate operation messages, such as erasing multiple lines created by other users at once, the entire current operation can be denied if a permission conflict exists in any message pair. This prevents malicious or accidental damage to others' content and ensures fairness and data integrity in multi-user collaboration.
[0067] After the above permission conflict detection, if there is no permission conflict between the current operation message and the candidate operation message in the message pair, more granular access control can be performed based on the context state in the message-level operation description information. This context state is used to identify the scope of the collaborative scenario to which the current operation belongs. In an educational whiteboard system, this context state can be used to support operation isolation and permission control in a multi-course, multi-page environment on the whiteboard system. For example, the context state includes a course identifier (courseId) and a page identifier (pageId). By comparing the courseId and pageId of the current operation message and the candidate operation message, operation isolation at the course level and page level can be achieved. If the courseId of the current operation message and the candidate operation message in the message pair do not match, it is determined to be a cross-course operation, the subsequent detection process is terminated, a response result indicating rejection of the operation is returned to the user, and an unauthorized access log is recorded. If the pageId of the current operation message and the candidate operation message in the message pair do not match, it is determined to be a cross-page operation. The subsequent detection process is terminated, and a response indicating that the operation is rejected is returned to the user, and an unauthorized access log is recorded.
[0068] By combining user identity permissions with context-specific permissions (courses / pages), this embodiment constructs a dual-permission protection mechanism to ensure that any operation is effective only within its legitimate user identity and collaborative context, thereby improving the security and consistency of the whiteboard system in complex multi-tenant scenarios.
[0069] S103, if there is no permission conflict between the current operation message and the candidate operation message in each message pair, then for each message pair, detect whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, and determine the candidate operation indication corresponding to the message pair based on the detection result and the operation type of the current operation message; wherein, the candidate operation indication indicates whether the operation is allowed or denied; the point-level spatial overlap indicates that there is at least one identical point position in the first point position set and the second point position set; the first point position set includes the point positions of each operation corresponding to the current operation message in the message pair when it is executed on the whiteboard; the second point position set includes the point positions of each operation corresponding to the candidate operation message when it is executed on the whiteboard; After completing message-level permission conflict detection, if there is no permission conflict between the current operation message and the candidate operation message in each message pair, the point-level spatial overlap detection step is entered. This point-level spatial overlap detection is used to determine whether the current operation actually affects the content created by the candidate historical operation in space, thereby deciding whether to allow its execution.
[0070] This point-level spatial overlap indicates that there exists at least one geometrically close pair of points between the set of point locations involved in the current operation executed on the whiteboard (i.e., the first set of point locations) and the set of point locations involved in the historical operation corresponding to the candidate operation message executed on the whiteboard (i.e., the second set of point locations). In other words, the two points visually or logically overlap or interact. Based on this, the point-level spatial overlap detection relies on the set of point locations included in the current operation message and the candidate operation message. Point locations in any set of point locations can be represented in normalized coordinate form to support multi-resolution device adaptation. To efficiently determine whether point location overlap exists, for any point location in the first set of point locations, that point location is paired with each point location in the second set of point locations, forming several point location pairs.
[0071] To detect whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, detection can be performed based on point position pairs consisting of a first set of point positions contained in the current operation message and a second set of point positions contained in the candidate operation message. The overlap can be determined by identifying whether the two points in the point position pair are logically or visually sufficiently close. For example... Figure 1C An exemplary flowchart illustrates a step for detecting point-level spatial overlap between the current operation message and candidate operation messages in a message pair based on point location pairs, including the following steps: S1031, For each pair of point positions, determine the distance between the two point positions in the pair; The distance between the two points in this point pair can be obtained using Euclidean distance. Assuming the message point pair includes a point Pcurr(x1, y1) from the first point set and a point Phist(x2, y2) from the second point set, the distance between the two points can be expressed as: After obtaining the distance between two points in a point position pair, step S1032 can be executed to detect whether there is at least one point position pair where the distance between two points is less than a set distance threshold. S1033, if it is detected that the distance between two points in at least one point location pair is less than a set distance threshold, then it is determined that there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair. S1034, otherwise, determine that there is no point-level spatial overlap between the current operation message and the candidate operation message in the message pair.
[0072] This distance threshold is used to determine whether two points are geometrically close enough to constitute effective overlap. It can be dynamically set based on contextual parameters such as whiteboard resolution, stroke width, or eraser radius. For example, it can be set to half the current line width, the equivalent normalized value of the eraser's radius, or the equivalent distance mapped to a fixed number of pixels and converted to normalized coordinates. This adaptive setting of the distance threshold can tolerate minor precision errors in floating-point calculations during point-level spatial overlap detection and match the user's perceptual standard for visual overlap, avoiding missed detections or misjudgments due to coordinate sampling deviations.
[0073] If the distance between any two points in a given location is less than the set distance threshold, it indicates that the current operation and the historical operation corresponding to the message have an actual intersection or overlapping effect in the whiteboard space, constituting a point-level spatial overlap.
[0074] Conversely, if the distance between any two points in each point location pair corresponding to the message pair is not less than the set distance threshold, that is, the first point location set and the second point location set are geometrically separated and have no adjacent intersection, it indicates that the area of action of the current operation on the whiteboard and the area of action of the candidate historical operation on the whiteboard do not affect each other spatially, that is, it is determined that there is no point-level spatial overlap between the current operation message and the candidate operation message in the message pair.
[0075] For example, the whiteboard uses a normalized coordinate system (ranging from 0.0 to 1.0) and sets a distance threshold δ = 0.02. The current operation message indicates that the user performed a short erase, with the first point location set (i.e., the eraser trajectory sampling points) being {(0.50,0.60), (0.51,0.61), (0.52,0.62)}; The candidate operation message represents a diagonal line drawn in history, with the set of second point positions being {(0.48,0.58),(0.49,0.59),(0.50,0.60),(0.53,0.63)}; Each point in the first set of point locations is paired with each point in the second set of point locations to form a point location pair, resulting in a total of 3 × 4 = 12 point location pairs. Point pair 1 is detected: (0.50, 0.60) and (0.50, 0.60). The distance between the two point locations is 0.0, which is less than the set distance threshold of 0.02. Since at least one point location pair has a distance less than the set distance threshold, it is determined that there is a point-level spatial overlap between the current operation message and the candidate operation message in this message pair.
[0076] After determining whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, this embodiment further determines the candidate operation indication corresponding to the message pair based on the detection result. This candidate operation indication only represents the operation indication made in the context of the current message pair regarding the interaction relationship between the current operation message and the candidate operation message, reflecting their compatibility status in terms of permissions and spatial dimensions. It is understood that this candidate operation indication does not represent the final execution method of the current operation message, but rather an intermediate judgment result in the multi-message collaborative conflict detection and processing process.
[0077] As described in the foregoing embodiments, any operation message received by the whiteboard system has a corresponding operation type, initiating user identifier, and initiation timestamp. When there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, arbitration rules can be further constructed based on the initiation timestamp, initiating user identifier, and operation type of the operation message to further handle conflicts between message pairs with point-level spatial overlap.
[0078] Since drawing operations essentially add content to the whiteboard, their semantic goal is to create a new shape or trajectory at a specified location. Drawing cannot be performed when there is visual occlusion, state overlap, or cooperative ambiguity between the current and historical operations. Based on this, see [link to relevant documentation]. Figure 2A The illustrative diagram illustrates a step for determining the candidate operation indication corresponding to a message pair based on the detection result and the operation type of the current operation message. When the operation type of the current operation message is a drawing type, the following steps may be included: S201, if the detection result indicates that there is no point-level spatial overlap, determine that the candidate operation indication for the current operation message under the message pair indicates that the operation is allowed; When the detection result indicates no point-level spatial overlap, it means that the area of effect of the current operation message on the whiteboard and the area of effect of the candidate operation message on the whiteboard are geometrically separated, and there is no interaction or overlay relationship at the whiteboard state level. Therefore, the current operation will not modify, obscure, or erase the content created by the historical operation, and the state of the historical operation will not affect the execution of the current operation. Thus, in this case, it can be determined that the candidate operation indication under the message pair represents an allowed operation, indicating that the current operation is allowed to be executed under the condition of this message pair, without further arbitration, reducing unnecessary computational overhead.
[0079] S202, if the detection result indicates the existence of point-level spatial overlap, determine the candidate operation indication corresponding to the message pair based on the set arbitration rules; the arbitration rules are constructed based on the initiation timestamp of the operation message, the initiating user identifier, and the operation type; When the detection result indicates point-level spatial overlap, it means that the areas of action of the current operation and the historical operation on the whiteboard overlap geometrically. To address this, this embodiment introduces an arbitration rule based on multi-dimensional state fusion, comprehensively judging the priority and legality of the operation from three dimensions: message initiation sequence, initiating user identity priority, and operation semantics. This arbitration rule is constructed based on the following three types of message-level state information: Initiation timestamp: Used to establish the global causal order of operations, following the first-come, first-served principle, with earlier initiated operation messages having state priority; Initiating User Identifier: Used to support identity awareness and set arbitration methods based on user identity priority, such as executing operation messages initiated by users with higher identity priority first; Operation type: Used to distinguish the semantic weight of an operation, such as the overriding right of "erase" over "draw", the reverse control right of "undo" over the original operation, etc.
[0080] Using this arbitration rule, this embodiment can make a deterministic decision that conforms to collaborative editing semantics, user expectations, and system consistency in scenarios where point-level spatial overlap is unavoidable, thereby generating the corresponding candidate operation indication for the message pair.
[0081] Accordingly, for erase or undo operations, their semantic essence is to modify, remove, or reverse control an existing operation object. Therefore, the effectiveness of the operation depends on the existence and accessibility of the content of the object being operated on. Thus, when the operation type of the current operation message is erase or undo, the detection result of point-level spatial overlap determines whether the operation is semantically feasible: if the detection result indicates that there is no point-level spatial overlap, the candidate operation indication for the current operation message under that message pair indicates a rejection of the operation; if the detection result indicates that there is point-level spatial overlap, the candidate operation indication for the current operation message under that message pair indicates an allow of the operation.
[0082] In other words, if the detection result indicates that there is no point-level spatial overlap, it means that the area of effect of the current operation message (such as the erase trajectory) is completely separated from the historical content created by the candidate operation message in geometric space. That is, the current operation did not hit any point location belonging to the historical operation. For the erase operation, the area the user attempts to erase does not actually contain any handwriting created by the historical operation, and this erase has no actual impact on the historical content. For the undo operation, it cannot be confirmed that the historical operation was the target the user intended to undone. Therefore, this operation lacks a valid target in the context of the current message pair and is considered invalid or a erroneous operation. In this case, the candidate operation indication for the current operation message under this message pair indicates a rejection of the operation to avoid meaningless state changes.
[0083] If the detection result indicates the existence of point-level spatial overlap, it means that the current operation does indeed act on the valid content created by the candidate operation message. For example, the erasure trajectory covers at least one point of the historical operation, or the target operation identifier of the undo operation clearly points to the historical operation, indicating that the current operation has a clear semantic target and the target operation object exists. If the permission conflict detection has been passed, it is determined that the candidate operation indication for the current operation message under the message pair indicates that the operation is allowed.
[0084] S104, based on the candidate operation indications corresponding to each message pair, return a response result to the user indicating that the operation was rejected or that the operation has been executed.
[0085] Each message pair, with its corresponding candidate operation indication, represents the local compatibility status between the current operation message and another potentially conflicting message (i.e., a candidate operation message) within that message pair. In multi-user real-time collaboration scenarios, the current operation may simultaneously have spatial or semantic overlap with multiple historical operations. If any conflict is not properly handled, it may lead to inconsistent whiteboard states, data overwriting errors, or even collaboration failure. Therefore, this implementation step integrates all message pairs consisting of candidate operation messages that may conflict with the current operation message. Based on preset global conflict handling rules, it aggregates and judges the candidate operation indications corresponding to each message pair to determine the final operation indication for the current operation message and returns the corresponding response result to the user who initiated the current operation message. This response result can be either an operation rejection or an operation that is already being executed.
[0086] In this step, the process of returning a response indicating whether the operation is rejected or has been performed to the user can be implemented as follows: if at least one message indicates rejection for the corresponding candidate operation, then a response indicating rejection is returned to the user; if all messages indicate permission for the corresponding candidate operation, then the current operation corresponding to the current operation message is executed on the whiteboard, and a response indicating that the operation has been performed is returned to the user after execution.
[0087] In a multi-user collaborative editing environment, if the current operation conflicts with any previous operation that has not been arbitrated, executing the current operation may disrupt the consistency of the whiteboard state. Therefore, if at least one message indicates a rejection of the corresponding candidate operation, the current operation is determined to be unexecutable, the whiteboard system does not execute the operation, and returns a response indicating rejection to the user. Furthermore, this response can also carry corresponding prompts for the client to provide user feedback or log entries.
[0088] When all messages indicate that the corresponding candidate operation is allowed, it means that the current operation has no conflicts in terms of permissions, context, and spatial dimensions. The system will then execute the current operation corresponding to the current operation message on the whiteboard, such as rendering the drawing trajectory, marking the erase point, or hiding the undone content. After the current operation is completed, a response indicating that the operation has been successfully executed is returned to the user. This response may include an operation confirmation flag, an updated snapshot of the whiteboard state, and other information to ensure that the user's client accurately reflects the latest collaborative state.
[0089] The state changes caused by the current operation message executed on the whiteboard, such as adding handwriting data, erasing marks, or undoing, can be broadcast incrementally or fully to all users using the online collaborative whiteboard system to ensure that the whiteboard state on each user's terminal remains consistent. Simultaneously, interface update commands are sent to all clients via a real-time communication channel, driving them to synchronously refresh the whiteboard view and present the latest collaborative editing results. This achieves data consistency, operational determinism, and smooth interaction in a multi-user collaborative whiteboard under high concurrency environments.
[0090] Furthermore, after obtaining the corresponding candidate operation instructions for each message pair, all detection results can be summarized to generate a structured conflict resolution report. This report records the processing path of this two-level conflict detection operation, the candidate operation messages involved, the arbitration basis, and the final operation instructions. This conflict resolution report can be used by operations and maintenance personnel to trace collaborative operation anomalies. In scenarios such as education and enterprise collaboration, this report can be archived as an operation log for post-event review to determine whether there were any unauthorized, malicious, or erroneous operations.
[0091] In this embodiment of the disclosure, a message-point two-level state fusion architecture is established. At the message level, permission control, operation type and timestamp are uniformly managed, and at the point level, spatial coordinates, erase state and trajectory attributes are uniformly managed, simplifying the state management logic in complex interaction scenarios. This method constructs a dual-level detection mechanism at both the message and point levels. At the message level, it determines permission conflicts based on user identity and operation semantics, achieving an atomic-level isolation strategy that ensures the creator's exclusive modification rights. This avoids cross-user misoperations or malicious tampering, resulting in a better user experience for collaborative environments with clearly defined teacher-student roles in corporate training / educational training scenarios. Under the premise of no permission conflicts, it further delves into the point-level spatial dimension for refined spatial overlap detection. By comparing the point location set of the current operation with the point set of historical operations, it determines whether there is geometric spatial overlap and deeply couples this with the operation type to decide whether to allow the current operation. This ensures that the system behavior always matches the user's true intentions, effectively solving interaction problems such as inconsistent states and unauthorized operations caused by overly coarse conflict handling granularity and lack of permission control in large-scale online collaborative whiteboard systems. It ensures data consistency and operational smoothness in multi-user collaborative environments and achieves an efficient multi-user collaborative experience through a hierarchical separation design.
[0092] Based on the arbitration rules constructed from the initiation timestamp, initiating user identifier, and operation type of the operation message as described in the foregoing embodiments, this implementation provides a method for making execution decisions on message pairs with point-level spatial overlap based on these arbitration rules. See [link to relevant documentation]. Figure 2BThe illustrative diagram illustrates the implementation steps for determining the candidate operation instruction corresponding to a message pair based on a set arbitration rule. This arbitration rule prioritizes the initiation timestamp as the first priority and the initiating user's identity as the second priority, and may include the following implementation steps: S2021, If the initiation timestamps of the current operation message and the candidate operation message in the message pair are different, then based on the time comparison results of the initiation timestamps of the current operation message and the candidate operation message, the candidate operation instruction for the current operation message under the message pair is determined. If the time comparison result indicates that the initiation timestamp of the current operation message is later than that of the candidate operation message, that is, the candidate operation message arrives before the current operation message, then it is determined that the candidate operation indication for the current operation message under the message pair indicates a rejection operation.
[0093] If the time comparison result indicates that the initiation timestamp of the current operation message is earlier than that of the candidate operation message, it is determined that the candidate operation indication for the current operation message under the message pair indicates that the operation is allowed.
[0094] For example, the initiation timestamp of the candidate operation message is T1 = 1712345678912 (corresponding to Beijing time 2024-04-05 12:14:38.912), and the initiation timestamp of the current operation message is T2 = 1712345678956 (corresponding to Beijing time 2024-04-05 12:14:38.956). This time comparison result indicates that T2 is later than T1, that is, the current operation message is initiated 44 milliseconds later than the candidate operation message. Therefore, it is determined that the candidate operation instruction for the current operation message under this message pair is rejected.
[0095] S2022, if the timestamps of the current operation message and the candidate operation message in the message pair are the same, further determine the candidate operation instruction for the current operation message under the message pair based on the comparison result of the operation priority of the initiating user of the current operation message and the candidate operation message.
[0096] If the operation priority comparison result indicates that the operation priority of the user initiating the current operation message is higher than that of the user initiating the candidate operation message, then the candidate operation indication for the current operation message under that message pair indicates that the operation is allowed; if the operation priority comparison result indicates that the operation priority of the user initiating the current operation message is lower than that of the user initiating the candidate operation message, then the candidate operation indication for the current operation message under that message pair indicates that the operation is rejected.
[0097] If the operation priority comparison result indicates that the operation priority of the user initiating the current operation message is the same as that of the user initiating the candidate operation message, since the initiation timestamps of the current operation message and the candidate operation message are the same, the message pair is in a completely equal concurrent conflict state. To ensure that the system behavior is definite and the user feedback is clear, it can be handled according to any of the following preset special case handling strategies to effectively improve the robustness of the system and the user experience under extreme concurrency scenarios: Strategy (1): For both the current operation message and the candidate operation message, return a response indicating that the operation is rejected. The response may also carry a prompt message such as "The operation was rejected due to concurrency conflict. Please try again later" and record a detailed conflict log. The conflict log may include key information such as the timestamps of the operations of both parties, user ID, operation type, point location set, and context state, for subsequent auditing or debugging.
[0098] Strategy (2): Based on the comparison result of the operation types corresponding to the current operation message and the candidate operation message, determine whether the two operations have semantic merging capability; if they can be merged, allow the two operations to take effect simultaneously and generate a merged state change; if they cannot be merged, return to strategy (1). Here, the operation type comparison result represents the semantic interaction relationship between the current operation and the historical operation, which can be determined based on the preset operation type conflict rules. The operation type comparison result is divided into two types: operation type compatibility and operation type conflict; where operation type conflict means that the operation types themselves are mutually exclusive, and one operation will directly affect the effect of another operation, such as drawing type and erasing type, screen clearing type and any other operation type; correspondingly, operation type compatibility means that the operation types are the same or can coexist, and will not be mutually exclusive due to the operation types themselves, such as drawing type and drawing type, both of which belong to creating content on the whiteboard, and there may be point-level spatial overlap but the operation types themselves do not conflict.
[0099] In this embodiment, the time comparison result, operation priority comparison result, and operation type comparison result all belong to message-level operation information. These can be obtained before performing point-level spatial overlap detection on the message pair, provided that there is no permission conflict between the current operation message and the candidate operation message in the message pair. See also Figure 2C The illustrative diagram illustrates a multi-dimensional message-level conflict detection method. After detecting that there is no permission conflict between the current operation message and the candidate operation message in a message pair, the following operations can be performed in parallel: Based on the timestamps of the current operation message and the candidate operation message, obtain the time comparison result; Furthermore, based on the initiating user identifier of the current operation message and the candidate operation message, the current operation priority can be identified, and the comparison result of the operation priority can be obtained; Furthermore, based on the operation type of the current operation message and the candidate operation message, and according to the set operation type conflict determination rules, the comparison result of the operation type can be obtained.
[0100] In some embodiments, if all message pairs indicate that the corresponding candidate operation is allowed, and if the operation type of the current operation message is an erase type, in order to further ensure the atomicity and reversibility of multi-user concurrent erase operations, a fine-grained point-level lock detection and locking mechanism can be performed on the erase target point before executing the current operation on the whiteboard, so as to avoid multiple users erasing the same content at the same time, resulting in state overwriting or data loss.
[0101] See Figure 3 The exemplary diagram illustrates the steps of point-level locking and execution for an erase-type operation. Prior to performing the current operation on the whiteboard, the following steps may be included: S301, for each erase target point in the current operation message, detect whether the erase target point is in a locked state; the locked state is used to indicate that the erase target point has been occupied by other concurrent operations; each erase target point in the current operation message is determined based on the set of point positions contained in the current operation message; Whether an erasure target point is locked can be indicated by the value of a setting field associated with that target point. Specifically, when the setting field value is an empty string, it indicates that the erasure target point is unlocked; when the setting field value is a non-empty string, it indicates that the erasure target point is locked, and the non-empty string is used to identify the user who initiated the operation currently holding the lock.
[0102] For example, each erase target point is associated with a defined `erase` field. The value of this field records the identifier of the user currently holding the erase lock for that point. When the `erase` field value is an empty string (such as ""), it indicates that the erase target point is in an unlocked state. When the `erase` field value is a non-empty string (such as "user_789"), it indicates that the point is in a locked state, and the non-empty string is the identifier of the user who initiated the operation currently holding the lock. Other operations cannot modify this point until the lock is released.
[0103] S302, if not, initiate a hardware-level atomic operation instruction to lock the erase target point, and execute the current operation corresponding to the current operation message on the whiteboard for the erase target point; S303, if so, then record the conflict log.
[0104] Taking a point P on the whiteboard as an example, its data structure contains an erase field. Before performing the erase operation, the system first reads the current value of this field: If the current field value is empty, it indicates that the point is in an unlocked state, and a CAS atomic operation can be performed to update the field value to acquire the erase lock for the point; that is, the system calls a hardware-level atomic instruction to perform an atomic update on the erase field of point P: Expected value: an empty string ("") New value: The identifier of the user who initiated the current operation message. Memory address: The storage address of the erase field at point P This operation has hardware-level atomicity, ensuring that no intermediate state will occur in a concurrent environment.
[0105] If the CAS operation succeeds, meaning the field value is still empty and successfully updated to the identifier of the user who initiated the current operation message, it indicates that the user who initiated the current operation message has successfully acquired the lock and enters the current operation execution process of the erase type. If the CAS operation fails (i.e., it is found that the field has been modified by other operations during comparison), it indicates that there is concurrent preemption. You can choose to retry the CAS operation up to N times (e.g., N=3) to deal with momentary contention. If it still fails after retrying, record the conflict log and abandon the erasure at that point.
[0106] If the current field value is not an empty string (i.e., erase != ""), it means that the point has been locked by another user, and the current operation does not have the right to directly modify it. Based on the fact that the current operation message is determined to be allowed to execute, the CAS operation can be retried several times to try to preempt the lock immediately after it is released. If the number of retries is too low, a detailed conflict log is recorded, and an operation failure message is returned to the user; the point is not erased.
[0107] Since the whiteboard system in this embodiment also supports operation undo functionality, when the current operation corresponding to the current operation message is executed on the whiteboard to erase the target point, that is, when the erase operation is performed on the target point, the visual state of the target point is updated so that the target point appears to have been erased on the whiteboard. For example, the rendering attribute of the target point is marked as erased (e.g., setting visible=false or opacity=0), making it invisible on the whiteboard interface.
[0108] Furthermore, the original data such as the original coordinates, color, and operation identifier of the erased target point are still completely preserved. This data is used to restore the visibility of the erased target point when performing an undo operation on the current operation, thus achieving lossless rollback.
[0109] In other words, the erasure operation in this embodiment is a logical hiding rather than a physical deletion. For example, when user A erases several points on a line segment drawn by user A, these points are no longer displayed on the whiteboard, but their data still exists in the whiteboard state tree. If user A subsequently clicks "Undo," the system can reactivate the visibility of the erased points based on the retained original information, thus restoring the screen before erasure. This method ensures the reversibility of operations and the integrity of the state during collaborative editing, achieving a highly available whiteboard collaborative experience.
[0110] To enable those skilled in the art to better understand the operation processing method provided in this application, this embodiment uses a scenario of three users collaboratively drawing / erasing on a whiteboard as an example for explanation and illustrative purposes. See [link to relevant documentation]. Figure 4 The example illustrates an interactive flowchart of an operation process in a scenario where three users collaborate to draw / erase on a whiteboard. This interactive scenario includes three user identities: teacher, student, and visitor. The operation priorities are as follows: teacher priority is higher than student priority, and student priority is higher than visitor priority.
[0111] (1) Operation 1: The teacher draws the operation, time: 10:30:15.123, position: (0.5, 0.5), operation: draw a red circle; If the whiteboard system receives the first operation message and there is no candidate operation message that conflicts with operation 1, it will execute the drawing operation. After the drawing operation is completed, it will notify each user who is currently using the whiteboard collaboratively of the status change and update the whiteboard display interface on each user terminal.
[0112] (2) Operation 2: Student draws operation, time: 10:30:15.125 (2ms later than the teacher), position: (0.5, 0.5) (same position as the teacher), operation: draw blue lines; like Figure 4 As shown, if operation 2 is received before operation 1 is executed, there is a possibility of conflict between operation 1 and operation 2, and a message-level check is initiated: Operation 2 was found to have no permission conflict with Operation 1. Further, the time comparison results of Operation 1 and Operation 2 (2ms later than the teacher's), operation priority comparison results (teacher's priority), and operation type comparison results (operation types are compatible) were obtained, and then point-level detection was initiated. Spatial location check: If there is point-level spatial overlap (distance between two points ≤ set distance threshold 0.001), conflict handling will be performed based on the set arbitration rules. First priority (time comparison result): If the teacher's timestamp is earlier (10:30:15.123 < 10:30:15.125), then operation 2 is rejected, and a response indicating rejection of the operation is returned to the student user. This response may include prompts such as "teacher operation priority".
[0113] In this scenario, although the operation types are compatible, the conflict can be resolved through priority arbitration due to spatial location conflicts. The conflict resolution result can be determined by the first priority (timestamp comparison).
[0114] (2.1) Operation 2.1: Student drawing operation (same timestamp scenario) Time: 10:30:15.123 (identical to the teacher's), Position: (0.5, 0.5) (same position as the teacher's), Operation: Draw a blue line. If Operation 2.1 is received before Operation 1 is executed, the same message-level and point-level detection methods as Operation 2 above are used to proceed with conflict resolution based on the set arbitration rules: First priority (time comparison result): If the timestamps are the same, proceed to the second priority; Second priority (operation priority): Teacher weight > Student weight. If the teacher's operation takes priority, then operation 2 is rejected, and a response indicating rejection is returned to the student user. This response may include prompts such as "Teacher's operation takes priority." In this scenario, operations 1 and 2.1 are received simultaneously. Since only operation 1 remains to be executed in the whiteboard system while operation 2.1 is rejected, operation 1 can continue to be executed. After the drawing operation is completed, the status change is notified to all users currently using the whiteboard collaboratively, updating the whiteboard display on each user's terminal. For example, the teacher is notified that the operation has been executed, and this is broadcast to all users to update the whiteboard on each user's terminal.
[0115] (2.2) Operation 2.2: Two students draw operations (scenarios with the same timestamp and weight) Student A: 10:30:15.123, position (0.5, 0.5), uid="student_001" Student B: 10:30:15.123, position (0.5, 0.5), uid="student_002" Spatial location checks are performed through message-level and point-level detection: if there is point-level spatial overlap (distance between two points ≤ 0.001), and the current operation is a drawing operation, then conflict resolution is initiated based on the set arbitration rules. First priority (time comparison result): If the timestamps are the same, proceed to the second priority; Second priority (operation priority): All are student weights. If the operation priorities are the same, special case handling strategy will be applied. Special case handling strategy: If both operations are rejected, a conflict log is recorded (including the initiation timestamp, user ID, operation type, location, etc.), and students are notified that operation A was rejected due to a conflict and should be retried later, and that operation B was rejected due to a conflict and should be retried later.
[0116] (3) Operation 3: Visitor wipe operation (permission denied scenario) like Figure 4 As shown, an erase operation was received from the access point, time: 10:30:15.130, location: (0.5, 0.5), operation: erase with eraser; There may be a conflict between Operation 1 and Operation 3. Enter message-level detection: Since Operation 1 and Operation 3 affect the same object but were initiated by different users, it indicates that the user initiating Operation 3 attempted to modify an operation object created by another user (the visitor cannot erase the teacher's content), resulting in a permission conflict. Therefore, a response indicating that the operation is rejected is returned to the visitor.
[0117] (4) Operation 4: The teacher erases his own content Time: 10:30:16.000, Position: (0.5, 0.5), Operation: Use the eraser to erase your own circle; There may be a conflict between Operation 1 and Operation 4. Enter message-level detection: Based on the premise that teachers can erase their own content and there is no permission conflict, the system retrieves the time comparison results of operation 1 and operation 4 (later than operation 1), the operation priority comparison results (same), and the operation type comparison results (operation type conflict), and then proceeds to point-level detection: Spatial Location Check: Spatial Overlap; Based on the current erasure operation, assuming no permission conflicts, spatial overlap indicates the existence of erasable points, allowing the execution of the current operation corresponding to the current operation message. The erasure lock of point (0.5, 0.5) is preempted via hardware-level atomic instructions. For example, the current value of a field associated with the point, such as erase, is set to the initiating user identifier of operation 4, such as "eraser_123". The visual state of the point is updated to be invisible on the whiteboard, while the original data of the point remains in the system. After the erasure operation is completed, it is broadcast to all users to update the whiteboard on each user's terminal.
[0118] (5) Operation 5: Teacher cancels the erase operation Time: 10:30:17.000, Operation: Undo erase operation; There may be a conflict between operation 4 and operation 5; proceed to message-level detection. Since teachers can revoke their own actions and there is no permission conflict, the system retrieves the time comparison results of actions 4 and 5 (later than action 1), the operation priority comparison results (same), and the operation type comparison results (operation type conflict), and then proceeds to point-level detection: Spatial location check: Spatial overlap; Based on the current erase operation, if there is no permission conflict, the existence of spatial overlap indicates the presence of undone content, allowing the execution of the current operation message, clearing the field values associated with point (0.5, 0.5), such as the erase field value, so that the circle is redisplayed on the whiteboard. After the undone operation is completed, it is broadcast to all users to update the whiteboard on each user's terminal.
[0119] Corresponding to the embodiments of the aforementioned operation processing method, see [link to relevant documentation]. Figure 5 As shown, this application also provides an embodiment of an operation processing device applied to a whiteboard system used collaboratively by multiple users, the device comprising: The conflict message filtering module 501 is configured to receive a current operation message initiated by any user when an operation needs to be performed on the whiteboard, and to filter out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard; the current operation message and each candidate operation message form a message pair respectively; The message-level conflict detection module 502 is configured to, for any message pair, if there is a permission conflict between the current operation message and the candidate operation message in the message pair, return a response result indicating that the operation is rejected to the user; the permission conflict indicates that the current operation message and the candidate operation message in the message pair are initiated by different users, and the current operation message modifies the operation object created when the historical operation corresponding to the candidate operation message was executed. The point-level spatial overlap detection module 503 is configured to, for each message pair, detect whether there is point-level spatial overlap between the current operation message and the candidate operation message if there is no permission conflict between the current operation message and the candidate operation message in each message pair, and determine the candidate operation indication corresponding to the message pair based on the detection result and the operation type of the current operation message; wherein, the candidate operation indication indicates whether the operation is allowed or denied; the point-level spatial overlap indicates that there is at least one identical point position in the first point position set and the second point position set; the first point position set includes the point positions of the current operation corresponding to the current operation message in the message pair when it is executed on the whiteboard; the second point position set includes the point positions of the historical operation corresponding to the candidate operation message when it is executed on the whiteboard; The response result return module 504 is configured to return a response result to the user, indicating that the operation has been rejected or has been executed, based on the candidate operation indication corresponding to each message pair.
[0120] In some embodiments, any operation message includes a set of point locations on the whiteboard where the operation corresponding to the operation message is executed; and any operation message has a corresponding operation type; when the conflict message filtering module is configured to filter candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard, it includes: If the operation type corresponding to the current operation message is a drawing type, then for each historical operation message in the historical operation message set, if it is detected that the first point coordinate range of the current operation message and the second point coordinate range of the historical operation message have spatial overlap, then the historical operation message is regarded as a candidate operation message; wherein, the first point coordinate range is determined based on the point position set contained in the current operation message; the second point coordinate range is based on the point position set contained in the historical operation message.
[0121] In some embodiments, when the conflict message filtering module is configured to filter candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard, it includes: If the operation type corresponding to the current operation message is an erase type, then for each historical operation message in the historical operation message set, if it is detected that the point location set included in the historical operation message includes at least one erase target point of the current operation message, then the historical operation message is regarded as a candidate operation message; wherein, the erase target point is determined based on the point location set included in the current operation message.
[0122] In some embodiments, if the operation type corresponding to the current operation message is a cancellation type, the current operation message includes a target operation identifier, which is used to determine the historical operation message corresponding to the historical operation to be cancelled in the historical operation message set; when the conflict message filtering module is configured to filter out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard, it includes: taking the historical operation message in the historical operation message set that matches the target operation identifier as the candidate operation message.
[0123] In some embodiments, when the operation type corresponding to the current operation message is an erase or undo operation, the apparatus further includes a response module configured to: If no candidate operation message is found from the historical operation message set corresponding to the whiteboard, a response indicating rejection of the operation is returned to the user; wherein, the response indicating rejection of the operation also carries an error message, which indicates that the target operation object does not exist.
[0124] In some embodiments, for any point in the first set of point locations, that point location forms a point location pair with each point in the second set of point locations; when the point-level spatial overlap detection module is configured to detect whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, it includes: For each pair of point positions, determine the distance between the two point positions in that pair; If it is detected that the distance between two points in at least one point location pair is less than a set distance threshold, then it is determined that there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair. Otherwise, it is determined that there is no point-level spatial overlap between the current operation message and the candidate operation message in the message pair.
[0125] In some embodiments, any operation message has a corresponding initiating user identifier and initiation timestamp; when the point-level spatial overlap detection module is configured to determine the corresponding candidate operation indication for the message based on the detection result and the operation type of the current operation message, it includes: The first determining module is configured to, if the operation type of the current operation message is drawing, then, if the detection result indicates that there is no point-level spatial overlap, determine that the candidate operation indication for the current operation message under the message pair indicates that the operation is allowed; if the detection result indicates that there is point-level spatial overlap, determine the candidate operation indication corresponding to the message pair based on the set arbitration rules; the arbitration rules are constructed based on the initiation timestamp of the operation message, the initiating user identifier, and the operation type.
[0126] In some embodiments, when the point-level spatial overlap detection module is configured to determine the candidate operation indication corresponding to the message pair based on the detection result and the operation type of the current operation message, it includes: The second determining module is configured to, if the operation type corresponding to the current operation message is erase or undo, determine that the candidate operation indication for the current operation message under the message pair indicates a rejection operation if the detection result indicates that there is no point-level spatial overlap; and determine that the candidate operation indication for the current operation message under the message pair indicates an allow operation if the detection result indicates that there is point-level spatial overlap.
[0127] In some embodiments, when the first determining module is configured to determine the candidate operation indication corresponding to the message pair based on a set arbitration rule, it includes: If the timestamps of the current operation message and the candidate operation message in the message pair are different, then the candidate operation instruction for the current operation message under the message pair is determined based on the comparison result of the timestamps of the current operation message and the candidate operation message. Otherwise, based on the comparison of the operation priorities of the initiating users of the current operation message and the candidate operation message, the candidate operation instruction for the current operation message under the message pair is determined.
[0128] In some embodiments, the response result returning module includes: The rejection module is configured to return a response indicating rejection to the user if at least one message indicates rejection for the corresponding candidate operation. The allow module is configured to execute the current operation corresponding to the current operation message on the whiteboard if all message pairs indicate that the operation is allowed, and return a response result indicating that the operation has been executed to the user after execution.
[0129] In some embodiments, if the operation type of the current operation message is an erase type, the enabling module is configured to: Before executing the current operation corresponding to the current operation message on the whiteboard: For each erase target point in the current operation message, it is checked whether the erase target point is in a locked state; the locked state is used to indicate that the erase target point has been occupied by other concurrent operations; each erase target point in the current operation message is determined based on the set of point positions contained in the current operation message; If not, a hardware-level atomic operation instruction is initiated to lock the erase target point, and the current operation corresponding to the current operation message is executed on the whiteboard for the erase target point; if yes, a conflict log is recorded.
[0130] In some embodiments, whether the erase target point is in a locked state is indicated by a setting field value associated with the erase target point; wherein, when the setting field value is an empty string, it indicates that the erase target point is in an unlocked state; when the setting field value is a non-empty string, it indicates that the erase target point is in a locked state, and the non-empty string is used to identify the user who initiated the operation currently holding the lock.
[0131] In some embodiments, when the permission module is configured to perform the current operation corresponding to the current operation message on the erase target point on the whiteboard, it includes: Update the visual state of the erase target point so that the erase target point appears to have been erased on the whiteboard; wherein, the original data of the erase target point is retained and used to restore the visibility state of the erase target point based on the original data when performing an undo operation on the current operation.
[0132] The specific implementation process of the functions and roles of each unit in the above device can be found in the implementation process of the corresponding steps in the above method, and will not be repeated here.
[0133] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this application according to actual needs. Those skilled in the art can understand and implement this without any inventive effort.
[0134] This application also provides an electronic device, the structural schematic diagram of which is shown below. Figure 6 As shown, the electronic device 600 includes at least one processor 601, a memory 602, and a bus 603. At least one processor 601 is electrically connected to the memory 602. The memory 602 is configured to store at least one computer-executable instruction, and the processor 601 is configured to execute the at least one computer-executable instruction to perform the steps of any operation processing method provided in any embodiment or optional implementation of this application.
[0135] Furthermore, the processor 601 can be an FPGA (Field-Programmable Gate Array) or other devices with logic processing capabilities, such as an MCU (Microcontroller Unit) or a CPU (Central Processing Unit).
[0136] This application also provides another readable storage medium storing a computer program that, when executed by a processor, implements the steps of any operation processing method provided in any embodiment or any optional implementation of this application.
[0137] The readable storage media provided in this application include, but are not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM (Read-Only Memory), RAM (Random Access Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), flash memory, magnetic cards, or optical cards. In other words, readable storage media include any medium by which a device (e.g., a computer) stores or transmits information in a readable form.
[0138] Thus, specific embodiments of the subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims may be performed in a different order and still achieve the desired result. Furthermore, the processes depicted in the drawings are not necessarily shown in a specific order or sequence to achieve the desired result. In some implementations, multitasking and parallel processing may be advantageous.
[0139] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. An operation processing method, characterized in that, The method, applied to a whiteboard system for multi-user collaborative use, includes: The system receives a current operation message initiated by any user when they need to perform an operation on the whiteboard, and filters out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard; the current operation message and each candidate operation message form a message pair. For any message pair, if there is a permission conflict between the current operation message and the candidate operation message in the message pair, a response indicating that the operation is rejected is returned to the user; the permission conflict means that the initiating user of the current operation message and the candidate operation message in the message pair are different, and the current operation message modifies the operation object created when the historical operation corresponding to the candidate operation message was executed. If there are no permission conflicts between the current operation message and the candidate operation message in each message pair, then for each message pair, it is checked whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, and the candidate operation indication corresponding to the message pair is determined based on the detection result and the operation type of the current operation message; wherein, the candidate operation indication indicates whether the operation is allowed or denied; the point-level spatial overlap indicates that there is at least one identical point position in the first point position set and the second point position set; the first point position set includes the point positions of the current operation corresponding to the current operation message in the message pair when it is executed on the whiteboard; the second point position set includes the point positions of the historical operation corresponding to the candidate operation message when it is executed on the whiteboard; Based on the candidate operation indications corresponding to each message pair, a response result is returned to the user indicating that the operation was rejected or that the operation has been executed.
2. The method according to claim 1, characterized in that, Each operation message contains a set of point locations on the whiteboard where the operation corresponding to the operation message is executed; and each operation message has a corresponding operation type. From the historical operation message set corresponding to the whiteboard, filter out candidate operation messages that may conflict with the current operation information, including: If the operation type corresponding to the current operation message is drawing type, then for each historical operation message in the historical operation message set, if it is detected that the first point coordinate range of the current operation message and the second point coordinate range of the historical operation message have spatial overlap, then the historical operation message is regarded as a candidate operation message. The first point's coordinate range is determined based on the set of point locations contained in the current operation message; the second point's coordinate range is based on the set of point locations contained in the historical operation message.
3. The method according to claim 2, characterized in that, From the historical operation message set corresponding to the whiteboard, filter out candidate operation messages that may conflict with the current operation information, including: If the operation type corresponding to the current operation message is an erase type, then for each historical operation message in the historical operation message set, if it is detected that the point location set included in the historical operation message includes at least one erase target point of the current operation message, then the historical operation message is regarded as a candidate operation message; wherein, the erase target point is determined based on the point location set included in the current operation message.
4. The method according to claim 1, characterized in that, If the operation type corresponding to the current operation message is the cancellation type, the current operation message includes a target operation identifier, which is used to determine the historical operation message corresponding to the historical operation to be cancelled in the historical operation message set; From the historical operation message set corresponding to the whiteboard, filter out candidate operation messages that may conflict with the current operation information, including: The historical operation messages in the historical operation message set that match the target operation identifier are selected as candidate operation messages.
5. The method according to any one of claims 1-4, characterized in that, If the operation type corresponding to the current operation message is an erase or undo type, the method further includes: If no candidate operation message is found from the historical operation message set corresponding to the whiteboard, a response indicating rejection of the operation is returned to the user; wherein, the response indicating rejection of the operation also carries an error message, which indicates that the target operation object does not exist.
6. The method according to claim 1, characterized in that, For any point in the first set of point locations, that point location forms a point location pair with each point in the second set of point locations; Detecting whether there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair, including: For each pair of point positions, determine the distance between the two point positions in that pair; If it is detected that the distance between two points in at least one point location pair is less than a set distance threshold, then it is determined that there is point-level spatial overlap between the current operation message and the candidate operation message in the message pair. Otherwise, it is determined that there is no point-level spatial overlap between the current operation message and the candidate operation message in the message pair.
7. The method according to claim 1, characterized in that, Each operation message has a corresponding initiating user identifier and initiation timestamp; Based on the detection results and the operation type of the current operation message, the corresponding candidate operation indication for this message is determined, including: If the operation type of the current operation message is drawing type, then if the detection result indicates that there is no point-level spatial overlap, it is determined that the candidate operation indication for the current operation message under the message pair indicates that the operation is allowed. If the detection result indicates the existence of point-level spatial overlap, the candidate operation indication corresponding to the message pair is determined based on the set arbitration rules; the arbitration rules are constructed based on the initiation timestamp of the operation message, the initiating user identifier, and the operation type.
8. The method according to claim 1, characterized in that, Based on the detection results and the operation type of the current operation message, the corresponding candidate operation indication for this message is determined, including: If the operation type corresponding to the current operation message is erase or undo, and the detection result indicates that there is no point-level spatial overlap, it is determined that the candidate operation indication for the current operation message under the message pair indicates a rejection operation. If the detection result indicates the existence of point-level spatial overlap, the candidate operation indication for the current operation message under the message pair is determined to indicate that the operation is allowed.
9. The method according to claim 7, characterized in that, Based on the established arbitration rules, determine the corresponding candidate operation instruction for the message pair, including: If the timestamps of the current operation message and the candidate operation message in the message pair are different, then the candidate operation instruction for the current operation message under the message pair is determined based on the comparison result of the timestamps of the current operation message and the candidate operation message. Otherwise, based on the comparison of the operation priorities of the initiating users of the current operation message and the candidate operation message, the candidate operation instruction for the current operation message under the message pair is determined.
10. The method according to claim 1, characterized in that, Based on the candidate operation indications corresponding to each message pair, a response result indicating whether the operation was rejected or executed is returned to the user, including: If at least one message indicates a rejection of the corresponding candidate operation, then a response indicating a rejection of the operation is returned to the user. If all messages indicate that the corresponding candidate operation is allowed, then the current operation corresponding to the current operation message is executed on the whiteboard, and after execution, a response indicating that the operation has been executed is returned to the user.
11. The method according to claim 10, characterized in that, If the operation type of the current operation message is an erase type, before executing the current operation corresponding to the current operation message on the whiteboard, the method further includes: For each erase target point in the current operation message, it is checked whether the erase target point is in a locked state; the locked state is used to indicate that the erase target point has been occupied by other concurrent operations; each erase target point in the current operation message is determined based on the set of point positions contained in the current operation message; If not, a hardware-level atomic operation instruction is initiated to lock the erase target point, and the current operation corresponding to the current operation message is executed on the whiteboard for the erase target point; if yes, a conflict log is recorded.
12. The method according to claim 11, characterized in that, Whether the erase target point is locked is indicated by the value of the setting field associated with that erase target point; where, When the value of the set field is an empty string, it indicates that the erase target point is in an unlocked state; When the value of the set field is a non-empty string, it indicates that the erase target point is in a locked state, and the non-empty string is used to identify the user who initiated the operation that currently holds the lock.
13. The method according to claim 11, characterized in that, On the whiteboard, perform the current operation corresponding to the current operation message for the erase target point, including: Update the visual state of the erase target point so that the erase target point appears to have been erased on the whiteboard; wherein, the original data of the erase target point is retained and used to restore the visibility state of the erase target point based on the original data when performing an undo operation on the current operation.
14. An operation processing apparatus, characterized in that, The device is used in a whiteboard system for multi-user collaborative use, and includes: The conflict message filtering module is configured to receive a current operation message initiated by any user when an operation needs to be performed on the whiteboard, and to filter out candidate operation messages that may conflict with the current operation information from the historical operation message set corresponding to the whiteboard; the current operation message and each candidate operation message form a message pair. The message-level conflict detection module is configured to, for any message pair, if the current operation message and the candidate operation message in the message pair have a permission conflict, return a response result indicating that the operation is rejected to the user; the permission conflict indicates that the current operation message and the candidate operation message in the message pair are initiated by different users, and the current operation message modifies the operation object created when the historical operation corresponding to the candidate operation message was executed. The point-level spatial overlap detection module is configured to, for each message pair, detect whether there is point-level spatial overlap between the current operation message and the candidate operation message if there is no permission conflict between them. Based on the detection result and the operation type of the current operation message, it determines the candidate operation indication corresponding to the message pair. The candidate operation indication indicates whether the operation is allowed or denied. The point-level spatial overlap indicates that there is at least one identical point position in the first set of point positions and the second set of point positions. The first set of point positions includes the point positions of the current operation corresponding to the current operation message in the message pair when it is executed on the whiteboard. The second set of point positions includes the point positions of the historical operation corresponding to the candidate operation message when it is executed on the whiteboard. The response result return module is configured to return a response result to the user, indicating whether the operation has been rejected or has been executed, based on the candidate operation indication corresponding to each message pair.
15. An electronic device, characterized in that, include: Memory, processor; The memory is used to store computer programs; The processor is configured to invoke the computer program to implement the method as described in any one of claims 1-13.
16. A readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-13.