Editing lock control method and device, equipment and medium

By using object fingerprints and business identifiers for editing lock control in the internal network environment of a manufacturing enterprise, the data loss problem caused by simultaneous editing by multiple users is solved, and data security and integrity are achieved.

CN120012064APending Publication Date: 2025-05-16CISDI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510117343.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-16

AI Technical Summary

Technical Problem

In the internal network environment of a manufacturing enterprise, when multiple users edit the same service at the same time, data loss is likely to occur.

Method used

The client sends application information to the server, including object fingerprint and service identification. The server determines whether the service has been locked and binds the object fingerprint to ensure that only authorized objects can edit the service.

Benefits of technology

It effectively reduces the risk of business data loss due to simultaneous editing and ensures data integrity and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120012064A_ABST
    Figure CN120012064A_ABST
Patent Text Reader

Abstract

The invention provides an editing lock control method and device, equipment and a medium, and the method comprises the steps that a client side sends application information to a server side, the application information is used for applying for an editing lock of a first service, and the application information comprises a first object fingerprint and a first service identifier of the first service; the first object fingerprint is used for identifying a first object applying for the editing lock; the server determines whether a bound object fingerprint exists in the first service identifier based on the first service identifier; and under the condition that the bound object fingerprint does not exist in the first service identifier, the server binds the first service identifier with the first object fingerprint, so that the first object has the authority to edit the first service. According to the invention, the risk of business data loss caused by simultaneous editing can be effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an edit lock control method, device, equipment and medium. Background Art

[0002] For manufacturing companies, the internal network environment is relatively large and complex, and as the number of people using the system increases, data overlaps easily, for example, two people edit a form, configure the same application, and adjust the same screen at the same time. As the complexity of the business increases, the content of simultaneous editing, configuration, and adjustment becomes increasingly complex. Once the data is overlapped by simultaneous editing, the business data of one person will be lost.

[0003] It can be seen that in the related technology, there is a problem that business data is easily lost due to editing the same business at the same time. Summary of the invention

[0004] In view of the above-mentioned shortcomings of the prior art, an object of the present invention is to provide an edit lock control method, device, equipment and medium for solving the above-mentioned problems.

[0005] The editing lock control method provided by the present invention comprises:

[0006] The client sends application information to the server, the application information is used to apply for an edit lock for a first service, the application information includes a first object fingerprint and a first service identifier of the first service, the first object fingerprint is used to identify the first object for which the edit lock is applied;

[0007] The server determines, based on the first service identifier, whether the first service identifier has a bound object fingerprint;

[0008] In the case that the first service identifier does not have a bound object fingerprint, the server binds the first service identifier with the first object fingerprint so that the first object has the authority to edit the first service.

[0009] In one embodiment of the present invention, the application information further includes first information, and the first information is used to indicate whether to forcibly apply for the editing lock;

[0010] After the client sends the application information to the server, the method further includes:

[0011] The server determines, based on the first service identifier, a lock mode corresponding to the first service in a preset lock mode, where the preset lock mode includes a strict lock mode and a shared lock mode;

[0012] When the lock mode corresponding to the first service is a shared lock mode, when the first service identifier has an object fingerprint that has been bound to it, and when the first information indicates that the edit lock must be applied for, the server releases the object fingerprint that has been bound to the first service identifier, and binds the first service identifier to the first object fingerprint;

[0013] When the lock mode corresponding to the first business is a strict lock mode, when the first business identifier has a bound object fingerprint, and when the first information indicates a forced application for the editing lock, second information is sent to the client, and the second information indicates that the editing lock application has failed.

[0014] In an embodiment of the present invention, after the server binds the first service identifier with the first object fingerprint, the method further includes:

[0015] The server sends third information to the client, where the third information indicates that the edit lock application is successful;

[0016] After receiving the third information, the client sends fourth information to the server at a preset time interval, where the fourth information includes a heartbeat signal, and the first object fingerprint and the first service identifier carried by the heartbeat signal;

[0017] The server periodically scans the update time of the fourth information, and when the time difference between the current scanning time and the update time is greater than a first threshold, determines that the status of the client is inactive, and unbinds the first service identifier from the first object fingerprint.

[0018] In one embodiment of the present invention, after receiving the third information, the client sends fourth information to the server at a preset time interval, including:

[0019] In the case that the client can establish a WebSocket channel with the server, the client establishes a WebSocket channel with the server, and sends the fourth information to the server at a preset time interval through the WebSocket channel;

[0020] In the case that the client cannot establish a WebSocket channel with the server, the subthread opened by the client obtains the first object fingerprint and the first service identifier from the main thread, and sends the fourth information to the server at a preset time interval through the subthread;

[0021] In the case that the client cannot establish a WebSocket channel with the server and the client cannot open the child thread, the fourth information is sent to the server at a preset time interval through the main thread.

[0022] In an embodiment of the present invention, after the server binds the first service identifier with the first object fingerprint, the method further includes:

[0023] The client sends an unlock request to the server;

[0024] The server performs unbinding processing on the first service identifier and the first object fingerprint.

[0025] In an embodiment of the present invention, after the server binds the first service identifier with the first object fingerprint, the method further includes:

[0026] When the binding time between the first service identifier and the first object fingerprint is greater than a second threshold, the server performs unbinding processing on the first service identifier and the first object fingerprint.

[0027] In one embodiment of the present invention, the first object fingerprint is determined based on a hash value of a first object element, wherein the first object element includes: current display parameters of the client, a user agent of the client, a random number, and a unique identifier of a current user of the client.

[0028] The editing lock control device provided by the present invention comprises:

[0029] A first sending module, configured for a client to send application information to a server, wherein the application information is used to apply for an edit lock for a first service, and the application information includes a first object fingerprint and a first service identifier of the first service, wherein the first object fingerprint is used to identify a first object for which the edit lock is applied;

[0030] A first determination module, configured for the server to determine, based on the first service identifier, whether the first service identifier has a bound object fingerprint;

[0031] The binding module is used for binding the first service identifier with the first object fingerprint by the server when there is no bound object fingerprint for the first service identifier, so that the first object has the authority to edit the first service.

[0032] In one embodiment of the present invention, the application information further includes first information, and the first information is used to indicate whether to forcibly apply for the editing lock;

[0033] The device also includes:

[0034] A second determination module is used for the server to determine, based on the first service identifier, a lock mode corresponding to the first service in a preset lock mode, where the preset lock mode includes a strict lock mode and a shared lock mode;

[0035] The first determining module is specifically used for:

[0036] When the lock mode corresponding to the first service is a shared lock mode, when the first service identifier has an object fingerprint that has been bound to it, and when the first information indicates that the edit lock must be applied for, the server releases the object fingerprint that has been bound to the first service identifier, and binds the first service identifier to the first object fingerprint;

[0037] When the lock mode corresponding to the first business is a strict lock mode, when the first business identifier has a bound object fingerprint, and when the first information indicates a forced application for the editing lock, second information is sent to the client, and the second information indicates that the editing lock application has failed.

[0038] In one embodiment of the present invention, the device further comprises:

[0039] A second sending module, configured for the server to send third information to the client, wherein the third information indicates that the editing lock application is successful;

[0040] a third sending module, configured to send fourth information to the server at a preset time interval after the client receives the third information, wherein the fourth information includes a heartbeat signal, and the first object fingerprint and the first service identifier carried by the heartbeat signal;

[0041] A third determination module is used for the server to periodically scan the update time of the fourth information, and determine that the state of the client is an inactive state when the time difference between the current scanning time and the update time is greater than a first threshold;

[0042] The first unbinding module is used to unbind the first service identifier from the first object fingerprint when the client is in an inactive state.

[0043] In one embodiment of the present invention, the third sending module is specifically used for:

[0044] In the case that the client can establish a WebSocket channel with the server, the client establishes a WebSocket channel with the server, and sends the fourth information to the server at a preset time interval through the WebSocket channel;

[0045] In the case that the client cannot establish a WebSocket channel with the server, the subthread opened by the client obtains the first object fingerprint and the first service identifier from the main thread, and sends the fourth information to the server at a preset time interval through the subthread;

[0046] In the case that the client cannot establish a WebSocket channel with the server and the client cannot open the child thread, the fourth information is sent to the server at a preset time interval through the main thread.

[0047] In one embodiment of the present invention, the device further comprises:

[0048] A fourth sending module, used for the client to send an unlock request to the server;

[0049] The second unbinding module is used for the server to unbind the first service identifier from the first object fingerprint based on the unlock request.

[0050] In one embodiment of the present invention, the device further comprises:

[0051] The third unbinding module is used to, when the binding time between the first service identifier and the first object fingerprint is greater than a second threshold, cause the server to unbind the first service identifier from the first object fingerprint.

[0052] In one embodiment of the present invention, the first object fingerprint is determined based on a hash value of a first object element, wherein the first object element includes: current display parameters of the client, a user agent of the client, a random number, and a unique identifier of a current user of the client.

[0053] The electronic device provided by the present invention comprises:

[0054] one or more processors;

[0055] The storage device is used to store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device implements the editing lock control method.

[0056] The computer-readable storage medium provided by the present invention stores a computer program thereon, and when the computer program is executed by a processor of a computer, the computer is enabled to execute the editing lock control method.

[0057] Beneficial effects of the present invention: In the present invention, the server can determine whether there is a bound object fingerprint for the first business identifier based on the first object fingerprint and the first business identifier sent by the client; when the first business identifier does not have a bound object fingerprint, it can be explained that no object currently has the authority to edit the first business, that is, the current first business is not locked; based on this, the server can only grant the current first object the authority to edit the first business by binding the first business identifier with the first object fingerprint, thereby effectively reducing the risk of business data loss due to simultaneous editing.

[0058] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0060] Figure 1 is one of the flow charts of an edit lock control method shown in an exemplary embodiment of the present application;

[0061] Figure 2 This is the second flowchart of the editing lock control method shown in an exemplary embodiment of the present application;

[0062] Figure 3 is a flow chart of a one-way heartbeat mechanism shown in an exemplary embodiment of the present application;

[0063] Figure 4 is a flowchart of business locking shown in an exemplary embodiment of the present application;

[0064] Figure 5 is a flowchart of service unlocking shown in an exemplary embodiment of the present application;

[0065] Figure 6 is a block diagram of an editing lock control device shown in an exemplary embodiment of the present application;

[0066] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0067] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0068] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0069] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0070] See also Figure 1 , Figure 1 FIG. 1 is a flowchart of an exemplary embodiment of the present invention showing an editing lock control method. Figure 1 As shown, in an exemplary embodiment, the editing lock control method includes at least steps S110 to S140, which are described in detail as follows:

[0071] Step S110: The client sends application information to the server, where the application information is used to apply for an edit lock for a first service. The application information includes a first object fingerprint and a first service identifier for the first service, where the first object fingerprint is used to identify the first object for which the edit lock is applied.

[0072] Step S120, the server determines whether the first service identifier has a bound object fingerprint based on the first service identifier;

[0073] Step S130: When the first service identifier does not have a bound object fingerprint, the server binds the first service identifier to the first object fingerprint, so that the first object has the authority to edit the first service.

[0074] In step S110, the client may be a browser or a mobile application, etc. After the user logs in to the client, the application information may be sent to the server through the client to apply for an editing lock for the service. Taking the client as a browser as an example, the data interaction between the browser and the server may be implemented based on XMLHttpRequest (XHR) or fetch, that is, the client may send the above application information to the server through XMLHttpRequest or fetch. Among them, the application information includes an object fingerprint, which is determined by a hash value of an object element, and the object element may include parameters of the hardware device corresponding to the above client, software parameters corresponding to the above client, a random number, and a unique identifier of the current user of the client, etc. Since the object element includes hardware parameters, software parameters, user parameters and random numbers at the same time, the determined hash value can basically identify a unique object, and the object fingerprint is different when the same user logs in to different clients.

[0075] In some embodiments, the object elements include: the current display parameters of the client, the user agent of the client, a random number, and a unique identifier of the current user of the client. The display parameters include the current display resolution and the current display color depth. That is, the above object fingerprint may be composed of the following object elements:

[0076] P1,P2,P3,R1,U1

[0077] Wherein P1 represents the current display resolution, P2 represents the current display color depth, P3 represents the user agent, R1 represents a random number, and U1 represents the unique identifier of the current user. The hash value calculated from the above elements can be used as the current object fingerprint (ie, the first object fingerprint).

[0078] In step S120, the first business identifier is a unique identifier for the first business. In the database of the server, for locked businesses, the business unique identifier and its bound object fingerprint are stored. In the case where the first business identifier has a bound object fingerprint, it indicates that the first business is locked. Assuming that the first business identifier is bound to the fingerprint of the second object, it indicates that the second object has editing authority over the first business. In the case where the first business identifier does not have a bound object fingerprint, it means that the first business is not locked and no object currently has editing authority over it.

[0079] In step S130, when the first service identifier does not have a bound object fingerprint, no object has the editing authority for the first service. Based on this, the server binds the first service identifier to the first object fingerprint, that is, the first service is locked and only the first object can use the editing lock, so that only the first object has the editing authority for the first service. It can be seen that the technical solution of the present application can avoid two or more objects having editing authority for the same service, based on which the risk of business data loss caused by editing the same service at the same time can be reduced.

[0080] In one embodiment of the present invention, the application information further includes first information, and the first information is used to indicate whether to forcibly apply for the editing lock;

[0081] After the client sends the application information to the server, the method further includes:

[0082] The server determines, based on the first service identifier, a lock mode corresponding to the first service in a preset lock mode, where the preset lock mode includes a strict lock mode and a shared lock mode;

[0083] When the lock mode corresponding to the first service is a shared lock mode, when the first service identifier has an object fingerprint that has been bound to it, and when the first information indicates that the edit lock must be applied for, the server releases the object fingerprint that has been bound to the first service identifier, and binds the first service identifier to the first object fingerprint;

[0084] When the lock mode corresponding to the first business is a strict lock mode, when the first business identifier has a bound object fingerprint, and when the first information indicates a forced application for the editing lock, second information is sent to the client, and the second information indicates that the editing lock application has failed.

[0085] In this implementation, the lock mode of the service can be pre-set on the server side, and the unique identifier of the service is bound to the lock mode. Among them, the lock mode in the embodiment of the present application includes a strict lock mode and a shared lock mode.

[0086] The difference between the strict lock mode and the shared lock mode is that the shared lock supports forced unlocking, while the strict lock does not support forced unlocking. Specifically, when the business is already locked, if the business lock mode is a strict lock, then the client's edit lock application will be rejected regardless of whether the above first information indicates forced unlocking; when the business is already locked, if the business lock mode is a shared lock and the above first information indicates a forced application, then the current business will be forced to unlock and bind the first object fingerprint in the current application information to change the editing permission of the business to the first object; when the business is already locked, if the business lock mode is a shared lock and the above first information of the client indicates a non-forced application, the client's edit lock application will be rejected.

[0087] The common point between the strict lock mode and the shared lock mode is that no matter which lock mode the business is in, if the business is not locked, that is, the business unique identifier in the current application information does not contain a bound object fingerprint, the business can be locked, that is, the business unique identifier in the current application information is bound to the object fingerprint in the current application information.

[0088] Among them, see Figure 2 After the client applies for the edit lock from the server, the server may feed back the result to the client to inform the client whether the application is successful. For example, when the server rejects the client's edit lock application, the server sends the second information to the client, and the second information indicates that the edit lock application failed; for another example, after the server binds the first service identifier with the first object fingerprint, the server sends the third information to the client, and the third information indicates that the edit lock application is successful.

[0089] In the embodiment of the present application, the locking strategy can be adaptively configured according to the operating network environment to determine the lock mode corresponding to the business, thereby improving the flexibility of locking and unlocking.

[0090] In some embodiments, whether the business has the right to edit the business is mainly based on the edit lock verification. For all business interfaces that need to verify the edit lock, nginx can be used to send all interface traffic to the unified control gateway, and the interface specification requires that the object fingerprint and business unique identifier must be carried. Figure 2 When the interface traffic enters, the server obtains the fingerprint of the object holding the edit lock from the edit lock pool through the business unique identifier and compares it with the object fingerprint carried in the request. If they match, the request is released. If the match fails, the 4001 error code is returned to indicate that the edit is not authorized.

[0091] In this implementation, a unified control gateway is used to uniformly control the business interfaces that need to be locked, including unified lock exception prompts and normal releases, which facilitates management.

[0092] In an embodiment of the present invention, after the server binds the first service identifier with the first object fingerprint, the method further includes:

[0093] The server sends third information to the client, where the third information indicates that the edit lock application is successful;

[0094] After receiving the third information, the client sends fourth information to the server at a preset time interval, where the fourth information includes a heartbeat signal, and the first object fingerprint and the first service identifier carried by the heartbeat signal;

[0095] The server periodically scans the update time of the fourth information, and when the time difference between the current scanning time and the update time is greater than a first threshold, determines that the status of the client is inactive, and unbinds the first service identifier from the first object fingerprint.

[0096] like Figure 2 As shown, after the client receives the feedback information sent by the server (i.e., the third information mentioned above), it establishes a heartbeat channel with the server and performs heartbeat communication. Figure 3 According to the business characteristics of the edit lock, the heartbeat is determined to be a one-way heartbeat (heartbeat), that is, the client sends a heartbeat signal to the server in a one-way manner at a preset time interval, and carries [F1, B1], where F1 is the current object fingerprint and B1 is the unique identifier of the current business object.

[0097] The server periodically scans the heartbeat signals sent by each client and the information it carries, and determines whether the update time and current scan time of each heartbeat signal and the information it carries exceed the first threshold, so as to determine whether the client is in an active state. Specifically, when the update time and current scan time of the heartbeat signal sent by client A and the [F1, B1] it carries do not exceed the above-mentioned first threshold, client A is in an active state; when the update time and current scan time of the heartbeat signal sent by client C and the [F1, B1] it carries exceed the above-mentioned first threshold, client C is in an inactive state (no-active). When the server determines that client C is in an inactive state, it can unlock the business corresponding to the business unique identifier sent by client C, that is, unbind the business unique identifier sent by client C and the object fingerprint sent by client C; when the server determines that client A is in an active state, no processing is required.

[0098] In an embodiment of the present application, when the client is in an inactive state, the service unique identifier and object fingerprint sent by it are unbound, which can achieve passive release of the editing lock, thereby preventing the service editing lock from being occupied for a long time by the inactive client.

[0099] In one embodiment of the present invention, after receiving the third information, the client sends fourth information to the server at a preset time interval, including:

[0100] In the case that the client can establish a WebSocket channel with the server, the client establishes a WebSocket channel with the server, and sends the fourth information to the server at a preset time interval through the WebSocket channel;

[0101] In the case that the client cannot establish a WebSocket channel with the server, the subthread opened by the client obtains the first object fingerprint and the first service identifier from the main thread, and sends the fourth information to the server at a preset time interval through the subthread;

[0102] In the case that the client cannot establish a WebSocket channel with the server and the client cannot open the child thread, the fourth information is sent to the server at a preset time interval through the main thread.

[0103] In this implementation, if the WebSocket (WS) protocol and port are available and can communicate normally in the current network environment of the client, the client can establish a WS channel with the server. The WS channel established between the client and the server is used as a heartbeat channel for heartbeat communication.

[0104] If the client cannot establish a WebSocket channel with the server, it will be downgraded to the secondary local polling to send heartbeats. Among them, the client main thread is mainly used to generate object fingerprints, etc. In order to avoid blocking the main thread, a new child thread independent of the main thread is opened using webworker technology to poll and send heartbeats. SetInterval is used in the child thread to send heartbeats, including sending heartbeat signals and the [F1, B1] (the fourth information mentioned above) it carries. Among them, the information required in the child thread ([F1, B1]) is obtained from the main thread through IPC.

[0105] If the client cannot support the use of web workers due to restrictions on the production intranet, resulting in the client being unable to open the sub-thread, it will be downgraded to the third-level local polling, that is, using the browser main thread's native setInterval to send heartbeats, and the content sent is the same as the second-level local polling solution.

[0106] The embodiments of the present application set the above three channel modes, which can be applied to different network environments and improve the reliability of the heartbeat channel in a complex network environment.

[0107] In an embodiment of the present invention, after the server binds the first service identifier with the first object fingerprint, the method further includes:

[0108] The client sends an unlock request to the server;

[0109] The server performs unbinding processing on the first service identifier and the first object fingerprint.

[0110] In this implementation, the client can actively send an unlock request to the server. Specifically, the client can actively send an unlock request to the server when the client's state changes to a preset state. The preset state is, for example, exiting business editing, and closing the client browser or application.

[0111] In an embodiment of the present invention, after the server binds the first service identifier with the first object fingerprint, the method further includes:

[0112] When the binding time between the first service identifier and the first object fingerprint is greater than a second threshold, the server performs unbinding processing on the first service identifier and the first object fingerprint.

[0113] This implementation method is a server-side guaranteed release mechanism, which sets a cache expiration policy and a maximum lock retention threshold (i.e., the second threshold). If the second threshold is exceeded, the editing lock is released directly without going through the business logic, that is, the above-mentioned unbinding process of the first business identifier and the first object fingerprint is performed.

[0114] The second threshold in the embodiment of the present application and the above-mentioned first threshold can be set according to needs. As an example, the second threshold can be set to twice the first threshold.

[0115] This embodiment sets the above-mentioned guaranteed release mechanism to release the edit lock when both the server and the client exceed the second threshold and do not release the edit lock, which can prevent the edit lock from being occupied for a long time due to unknown reasons.

[0116] This application can select the locking mode according to the business scenario, distinguish between strict locks and shared locks, and distinguish the control granularity of unlocking; based on the object fingerprint and the business unique identifier, the editing lock can be applied for, and a multi-mode heartbeat channel that can be downgraded in sequence can be established for the client whose application is approved; based on a unified control gateway, the business interface that needs to be locked can be uniformly controlled, including unified lock exception prompts and normal release; for the shared lock mode, the lock of the locked business can be replaced, first execute the lock release and then execute the application for the editing lock again; at the same time, it provides dual channels of active release for multiple abnormal situations and passive release for heartbeat timeout scanning to release the editing lock in time. This application can greatly improve the locking accuracy and timeliness of the editing lock of the web client in complex network environments and comprehensive application scenarios, and has high compatibility and stability.

[0117] In order to more clearly understand the technical solution of the embodiment of the present application, the following Figure 4 and Figure 5 Further explanation of this application.

[0118] See also Figure 4 , Figure 4 This is a schematic diagram of the business locking process. Figure 4 As shown, the locking mode of the business can be set on the server; after the client generates the object fingerprint, it can carry the object fingerprint and the business unique identifier to apply for the edit lock; the server determines the business lock mode and whether to lock based on the business unique identifier, and determines whether to agree to the client application (that is, whether it is legal); if it is legal, the client application is successful: the server stores the edit lock in the Redis database, that is, binds the current business unique identifier and the current object fingerprint and stores them in the database, and the client establishes a heartbeat channel and performs heartbeat communication with reference to the above embodiment.

[0119] See also Figure 5 , Figure 5 The figure is a schematic diagram of the business unlocking process. Business unlocking is divided into client-initiated release, server-initiated release and exception mechanism release. Among them, when the client actively releases and sends an unlocking request to the server, it can be determined whether the client supports Beacon. If the client supports it, the unlocking request is sent to the server through SendBeacon; if the client does not support Beacon, the unlocking request is sent to the server through XMLHttpRequest (XHR).

[0120] Figure 6 FIG. 1 is a block diagram of an editing lock control device shown in an exemplary embodiment of the present application. Figure 6 As shown, the exemplary editing lock control device includes:

[0121] A first sending module 601 is used for the client to send application information to the server, wherein the application information is used to apply for an edit lock for a first service, and the application information includes a first object fingerprint and a first service identifier of the first service, wherein the first object fingerprint is used to identify the first object for which the edit lock is applied;

[0122] A first determination module 602, configured for the server to determine, based on the first service identifier, whether the first service identifier has a bound object fingerprint;

[0123] The binding module 603 is used to bind the first service identifier to the first object fingerprint by the server when there is no bound object fingerprint for the first service identifier, so that the first object has the authority to edit the first service.

[0124] In one embodiment of the present invention, the application information further includes first information, and the first information is used to indicate whether to forcibly apply for the editing lock;

[0125] The device also includes:

[0126] A second determination module is used for the server to determine, based on the first service identifier, a lock mode corresponding to the first service in a preset lock mode, where the preset lock mode includes a strict lock mode and a shared lock mode;

[0127] The first determining module 602 is specifically configured to:

[0128] When the lock mode corresponding to the first service is a shared lock mode, when the first service identifier has an object fingerprint that has been bound to it, and when the first information indicates that the edit lock must be applied for, the server releases the object fingerprint that has been bound to the first service identifier, and binds the first service identifier to the first object fingerprint;

[0129] When the lock mode corresponding to the first business is a strict lock mode, when the first business identifier has a bound object fingerprint, and when the first information indicates a forced application for the editing lock, second information is sent to the client, and the second information indicates that the editing lock application has failed.

[0130] In one embodiment of the present invention, the device further comprises:

[0131] A second sending module, configured for the server to send third information to the client, wherein the third information indicates that the editing lock application is successful;

[0132] a third sending module, configured to send fourth information to the server at a preset time interval after the client receives the third information, wherein the fourth information includes a heartbeat signal, and the first object fingerprint and the first service identifier carried by the heartbeat signal;

[0133] A third determination module is used for the server to periodically scan the update time of the fourth information, and determine that the state of the client is an inactive state when the time difference between the current scanning time and the update time is greater than a first threshold;

[0134] The first unbinding module is used to unbind the first service identifier from the first object fingerprint when the client is in an inactive state.

[0135] In one embodiment of the present invention, the third sending module is specifically used for:

[0136] In the case that the client can establish a WebSocket channel with the server, the client establishes a WebSocket channel with the server, and sends the fourth information to the server at a preset time interval through the WebSocket channel;

[0137] In the case that the client cannot establish a WebSocket channel with the server, the subthread opened by the client obtains the first object fingerprint and the first service identifier from the main thread, and sends the fourth information to the server at a preset time interval through the subthread;

[0138] In the case that the client cannot establish a WebSocket channel with the server and the client cannot open the child thread, the fourth information is sent to the server at a preset time interval through the main thread.

[0139] In one embodiment of the present invention, the device further comprises:

[0140] A fourth sending module, used for the client to send an unlock request to the server;

[0141] The second unbinding module is used for the server to unbind the first service identifier from the first object fingerprint based on the unlock request.

[0142] In one embodiment of the present invention, the device further comprises:

[0143] The third unbinding module is used to, when the binding time between the first service identifier and the first object fingerprint is greater than a second threshold, cause the server to unbind the first service identifier from the first object fingerprint.

[0144] In one embodiment of the present invention, the first object fingerprint is determined based on a hash value of a first object element, wherein the first object element includes: current display parameters of the client, a user agent of the client, a random number, and a unique identifier of a current user of the client.

[0145] It should be noted that the editing lock control device provided in the above embodiment and the editing lock control method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In actual application, the editing lock control device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0146] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the editing lock control method provided in the above-mentioned embodiments.

[0147] Figure 7 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0148] like Figure 7 As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method described in the above embodiment. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, ROM 702 and RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0149] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.

[0150] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.

[0151] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0152] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0153] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0154] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the editing lock control method as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0155] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the editing lock control method provided in each of the above embodiments.

[0156] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. An edit lock control method, characterized in that: include: The client sends application information to the server, the application information is used to apply for an edit lock for a first service, the application information includes a first object fingerprint and a first service identifier of the first service, the first object fingerprint is used to identify the first object for which the edit lock is applied; The server determines, based on the first service identifier, whether the first service identifier has a bound object fingerprint; In the case that the first service identifier does not have a bound object fingerprint, the server binds the first service identifier with the first object fingerprint so that the first object has the authority to edit the first service.

2. The method according to claim 1, characterized in that: The application information further includes first information, wherein the first information is used to indicate whether to forcibly apply for the editing lock; After the client sends the application information to the server, the method further includes: The server determines, based on the first service identifier, a lock mode corresponding to the first service in a preset lock mode, where the preset lock mode includes a strict lock mode and a shared lock mode; When the lock mode corresponding to the first service is a shared lock mode, when the first service identifier has an object fingerprint that has been bound to it, and when the first information indicates that the edit lock must be applied for, the server releases the object fingerprint that has been bound to the first service identifier, and binds the first service identifier to the first object fingerprint; When the lock mode corresponding to the first business is a strict lock mode, when the first business identifier has a bound object fingerprint, and when the first information indicates a forced application for the editing lock, second information is sent to the client, and the second information indicates that the editing lock application has failed.

3. The method according to claim 1 or 2, characterized in that: After the server binds the first service identifier with the first object fingerprint, the method further includes: The server sends third information to the client, where the third information indicates that the edit lock application is successful; After receiving the third information, the client sends fourth information to the server at a preset time interval, where the fourth information includes a heartbeat signal, and the first object fingerprint and the first service identifier carried by the heartbeat signal; The server periodically scans the update time of the fourth information, and when the time difference between the current scanning time and the update time is greater than a first threshold, determines that the status of the client is inactive, and unbinds the first service identifier from the first object fingerprint.

4. The method according to claim 3, characterized in that After receiving the third information, the client sends fourth information to the server at a preset time interval, including: In the case that the client can establish a WebSocket channel with the server, the client establishes a WebSocket channel with the server, and sends the fourth information to the server at a preset time interval through the WebSocket channel; In the case that the client cannot establish a WebSocket channel with the server, the subthread opened by the client obtains the first object fingerprint and the first service identifier from the main thread, and sends the fourth information to the server at a preset time interval through the subthread; In the case that the client cannot establish a WebSocket channel with the server and the client cannot open the child thread, the fourth information is sent to the server at a preset time interval through the main thread.

5. The method according to claim 1 or 2, characterized in that: After the server binds the first service identifier with the first object fingerprint, the method further includes: The client sends an unlock request to the server; The server performs unbinding processing on the first service identifier and the first object fingerprint based on the unlock request.

6. The method according to claim 1 or 2, characterized in that: After the server binds the first service identifier with the first object fingerprint, the method further includes: When the binding time between the first service identifier and the first object fingerprint is greater than a second threshold, the server performs unbinding processing on the first service identifier and the first object fingerprint.

7. The method according to claim 1, characterized in that The first object fingerprint is determined based on a hash value of a first object element, wherein the first object element includes: current display parameters of the client, a user agent of the client, a random number, and a unique identifier of a current user of the client.

8. An editing lock control device, characterized in that: include: A first sending module, configured for a client to send application information to a server, wherein the application information is used to apply for an edit lock for a first service, and the application information includes a first object fingerprint and a first service identifier of the first service, wherein the first object fingerprint is used to identify a first object for which the edit lock is applied; A first determination module, configured for the server to determine whether the first service identifier has a bound object fingerprint based on the first service identifier; The binding module is used for binding the first service identifier with the first object fingerprint by the server when there is no bound object fingerprint for the first service identifier, so that the first object has the authority to edit the first service.

9. A device, characterized in that: include: one or more processors and memory, A computer program is stored in the memory, and when the one or more processors execute the computer program, the device executes the method for editing lock control as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, which, when executed by one or more processors, enables the device to execute the editing lock control method as described in any one of claims 1-7.