Token contract extension method and device for online editor, electronic equipment and computer program product

By monitoring user editing operations and setting thresholds, we intelligently judge the timing of token renewal, solving the problem of token renewal in online editors, improving user experience and performance, and ensuring document security.

CN119167341APending Publication Date: 2024-12-20中国邮政储蓄银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411313319.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

Due to frequent text operations and few interface calls on the online editor page, it is difficult to set the token duration of the existing token renewal method, resulting in the insecure or frequent disconnection of documents. The automatic saving function consumes performance and is not suitable for all documents.

Method used

Monitor user editing operations, obtain the remaining time and editing time interval of the token validity period, decide whether to renew the token based on the set threshold, generate a renewal request to reset the token validity time, and avoid frequent or untimely renewal.

Benefits of technology

It realizes intelligent renewal of tokens in online editors, improves user experience, avoids frequent renewals and untimely renewals, does not rely on automatic saving function, and improves performance and document security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119167341A_ABST
    Figure CN119167341A_ABST
Patent Text Reader

Abstract

The invention discloses a token renewing method and device of an online editor, electronic equipment and a computer program product. The token renewing method of the online editor comprises the steps that editing operation of a user on an online document is monitored; under the condition that the editing operation of the user is monitored, obtaining the remaining time of the validity period of the current token of the user; and according to the remaining time of the validity period of the current token and a token continuation time threshold value, determining whether token continuation is carried out or not. The token extension method specially applied to the online editor page is provided and is a new strategy different from general webpage token extension, intelligent token extension of the user in the document editing process can be achieved on the basis of monitoring of the editing behavior of the user on the basis of the online editor page end, and the user experience is improved. The problems of frequent token renewal and untimely renewal are avoided, the method does not depend on an automatic storage function of an online editor, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of token renewal, and in particular to a token renewal method, device, electronic device, and computer program product for an online editor. Background Art

[0002] In order to avoid the client frequently sending requests to the server to verify the legitimacy of the current user's identity, tokens are usually used in the current network communication process to act as a "secret code" between the server and the client to exchange information. Token is a string of characters generated by the server as a token for the client to make requests. After the first login, the server generates a token and returns it to the client. In the future, the client only needs to bring this token to request data, without having to bring the username and password again.

[0003] Token has an expiration date. When the validity of the token is about to end, token renewal needs to be executed. Token renewal refers to a mechanism to refresh the user permission token so that it can continue to operate. Token renewal needs to be initiated by the client and verified by the server, so renewal occurs during the process of the client calling the server's interface. In general web pages and apps, users will frequently call the add, delete, modify, and query data interfaces when they click on controls. In the process of calling these interfaces, renewal can be completed automatically.

[0004] However, the editor web page is different from the general page. Users will perform long-term document editing operations on the editor web page. These operations are generally front-end behaviors and will not initiate requests to the server. Only when the user completes the editing and clicks Save, there will be interaction with the server.

[0005] Existing token renewal methods are designed for general web pages, and are usually performed when calling the server interface. There is no token renewal method specifically for online editors. However, online editor pages have the characteristics of "frequent text operations and few interface calls". Applying the token renewal method of general web pages will make it difficult to set the token duration. If the setting time is too long, it is easy to make the document unsafe. If the setting time is too short, it is easy to cause frequent disconnection and difficult to control.

[0006] In addition, although the renewal problem can be solved by setting the "auto save" function on the editor webpage, that is, forcibly saving the online document every few minutes, on the one hand, when the online document content is large, this method consumes a lot of client and server performance, and each automatic save will make the user feel a sudden freeze; on the other hand, due to the particularity of some documents, these documents do not allow automatic saving to be turned on. Summary of the invention

[0007] Embodiments of the present application provide a token renewal method, device, electronic device, and computer program product for an online editor to implement intelligent token renewal for an online editor.

[0008] The present application embodiment adopts the following technical solutions:

[0009] In a first aspect, an embodiment of the present application provides a token renewal method for an online editor, the token renewal method for an online editor comprising:

[0010] Monitor users’ editing operations on online documents;

[0011] When the user's editing operation is detected, the remaining validity period of the user's current token is obtained;

[0012] Whether to renew the token is determined according to the remaining time of the current token's validity period and the token renewal time threshold.

[0013] Optionally, when an editing operation of the user is detected, obtaining the remaining validity period of the current token of the user includes:

[0014] Obtaining the token validity period set by the system, and determining the remaining validity period of the user's current token according to the token validity period set by the system; or,

[0015] Send a token time detection request to the server, and receive the remaining validity period of the user's current token returned by the server.

[0016] Optionally, when the user's editing operation is monitored, the token renewal method of the online editor further includes:

[0017] In the case where the user's editing operation is monitored, determining the user's editing time interval according to the monitored editing operation;

[0018] comparing the edit time interval with an edit time threshold;

[0019] If the editing time interval is greater than or equal to the editing time threshold, obtaining the remaining time of the validity period of the user's current token;

[0020] Otherwise, the remaining validity period of the user's current token will not be obtained.

[0021] Optionally, comparing the editing time interval with an editing time threshold comprises:

[0022] Get the token validity period set by the system;

[0023] The editing time threshold is determined according to the token validity period.

[0024] Optionally, determining whether to renew the token according to the remaining validity period of the current token and the token renewal time threshold includes:

[0025] Compare the remaining validity period of the current token with the token renewal time threshold;

[0026] If the remaining validity period of the current token is not greater than the token renewal time threshold, determining to renew the token;

[0027] Otherwise, it is determined that the token renewal will not be performed.

[0028] Optionally, after determining to renew the token, the token renewal method of the online editor further includes:

[0029] Generate a token renewal request and send it to the server, so that the server can generate a new token for the user and reset the token validity period;

[0030] Receive the user's new token returned by the server.

[0031] Optionally, determining whether to renew the token according to the remaining validity period of the current token and the token renewal time threshold includes:

[0032] Get the token validity period set by the system;

[0033] The token renewal time threshold is determined according to the token validity period.

[0034] In a second aspect, an embodiment of the present application further provides a token renewal device for an online editor, the token renewal device for an online editor comprising:

[0035] A monitoring unit, used to monitor the user's editing operation on the online document;

[0036] An acquisition unit, used to acquire the remaining time of the validity period of the user's current token when an editing operation of the user is detected;

[0037] The renewal unit is used to determine whether to renew the token according to the remaining time of the validity period of the current token and the token renewal time threshold.

[0038] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0039] Processor; and

[0040] A memory arranged to store computer executable instructions, which, when executed, cause the processor to perform any of the aforementioned token renewal methods for the online editor.

[0041] In a fourth aspect, an embodiment of the present application further provides a computer program product, comprising a computer program or instructions, which, when executed by a processor, implements the token renewal method of any of the aforementioned online editors.

[0042] At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects: the token renewal method of the online editor in the embodiments of the present application first monitors the user's editing operations on the online document; then, when the user's editing operations are monitored, the remaining validity period of the user's current token is obtained; finally, whether to renew the token is determined based on the remaining validity period of the current token and the token renewal time threshold. The embodiments of the present application propose a token renewal method specifically applied to online editor pages, which is a new strategy different from general web page token renewal. Based on the monitoring of user editing behavior on the online editor page end, it can realize the intelligent renewal of the user's token during the document editing process, avoiding the problem of frequent token renewal and untimely renewal, and does not rely on the automatic save function of the online editor, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0044] Figure 1 A flowchart of a token renewal method for an online editor in an embodiment of the present application;

[0045] Figure 2 This is a schematic diagram of a token renewal process of an online editor in an embodiment of the present application;

[0046] Figure 3 This is a schematic diagram of the structure of a token renewal device for an online editor in an embodiment of the present application;

[0047] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0049] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0050] In order to maintain the login status of a web page or APP, there are several existing methods for token renewal:

[0051] (1) Every time the server receives a network request from a user, it automatically refreshes the token duration to the set value. The disadvantages of this solution are that it is not flexible enough and that refreshing the token duration for each call increases the pressure on the server.

[0052] (2) The client creates a network request interceptor. After the network initiates a request, it obtains the remaining time of the token. If the remaining time is less than a certain value, it initiates a renewal request to execute token renewal and update. The disadvantage of this solution is that if the user does not trigger a request within the time period when the token is "about to expire", the user will be disconnected.

[0053] (3) When the webpage is loaded and opened, the last renewal time of the current token is obtained, and the time distance to the next renewal time is determined based on the current time. If the distance is less than the set value, the token is renewed. This method increases the chance of renewal to a certain extent, but it cannot optimize the renewal problem when the user stays on a certain page for a long time.

[0054] Currently, none of the above three existing solutions can effectively solve the token renewal problem on the online editor page.

[0055] Based on this, the embodiment of the present application provides a token renewal method for an online editor, such as Figure 1 As shown, a flow chart of a token renewal method of an online editor in an embodiment of the present application is provided, and the token renewal method of the online editor at least includes the following steps S110 to S130:

[0056] Step S110: monitoring the user's editing operation on the online document.

[0057] The embodiment of the present application needs to monitor the user's editing operation on the online document in real time. The monitoring of the editing operation means that the online editor webpage front end needs to monitor the user's editing behavior on the online document and record the time when the editing occurs. The "editing behavior" here may include, for example, editing text, inserting pictures, inserting tables, deleting content, and other user behaviors that may change the overall content of the document.

[0058] Step S120, when the user's editing operation is detected, the remaining validity period of the user's current token is obtained.

[0059] When a user editing operation is detected, it is necessary to further obtain the remaining time T of the validity period of the user's current token rest , remaining validity period Trest It means that the current token has passed T rest It will become invalid afterwards.

[0060] Step S130: determining whether to renew the token according to the remaining time of the validity period of the current token and the token renewal time threshold.

[0061] Remaining time of validity period T rest The length of can directly reflect how long the user's current token will expire. Based on actual business needs, the remaining time of the current token can be compared with the set token renewal time threshold. According to the comparison result, it can be determined whether the token needs to be renewed at present, so as to better control the timing of token renewal and avoid frequent renewal or untimely renewal.

[0062] The embodiment of the present application proposes a token renewal method specifically applied to online editor pages. It is a new strategy different from the general web page token renewal. Based on the monitoring of user editing behavior on the online editor page, it can realize the intelligent renewal of user tokens during the document editing process, avoiding the problems of frequent token renewal and untimely renewal, and does not rely on the automatic save function of the online editor, thereby improving the user experience.

[0063] In some embodiments of the present application, when a user's editing operation is monitored, obtaining the remaining validity period of the user's current token includes: obtaining the token validity period set by the system, and determining the remaining validity period of the user's current token based on the token validity period set by the system; or, sending a token time detection request to a server, and receiving the remaining validity period of the user's current token returned by the server.

[0064] In this embodiment of the present application, the remaining time T of the validity period of the user's current token rest There are two ways to obtain the token. One is to use the online editor front end to directly obtain the token based on the token validity period ST token Perform a countdown or calculate the remaining time T of the current token based on the current system time rest ,Token validity time refers to the total time that the token is in a valid state.

[0065] Another way is that the online editor can send a token time detection request to the backend server. The request can carry identification information related to the current user's token. After the server receives the token time detection request, it can return the remaining validity period of the user's current token to the front end.

[0066] Of the above two methods, the first method does not require the online editor front end to access the back end, which can reduce latency. The second method does not require the online editor front end to store and manage the token validity period and calculate the remaining validity period of the token, which is uniformly managed and calculated by the server. The specific method to be adopted can be flexibly selected by technicians in this field according to actual needs, and no specific limitation is made here.

[0067] In some embodiments of the present application, when the user's editing operation is monitored, the token renewal method of the online editor also includes: when the user's editing operation is monitored, determining the user's editing time interval based on the monitored editing operation; comparing the editing time interval with an editing time threshold; if the editing time interval is greater than or equal to the editing time threshold, obtaining the remaining validity period of the user's current token; otherwise, not obtaining the remaining validity period of the user's current token.

[0068] In the embodiment of the present application, when the user's editing operation is detected, the user's editing time interval T can be further calculated according to the monitored editing operation. span The purpose of calculating the editing time interval is, on the one hand, to avoid the need to frequently detect the remaining time of the token validity period when the user edits frequently, resulting in unnecessary performance loss between the online editor front end or the back-end server. On the other hand, it is to effectively control the document security issues that may occur when the user does not edit for a long time.

[0069] In view of the first aspect above, the embodiment of the present application sets an editing time threshold ST span To reasonably control the timing of token validity and remaining time detection, the currently calculated user editing time interval T span With edit time threshold ST span For comparison, if T span ≥ST span , indicating that the editing time interval meets the requirement of detecting the remaining valid time of the token, then the remaining valid time of the current token can be obtained based on any of the methods in the above embodiments. On the contrary, it means that the editing time interval is still short and does not meet the requirement of detecting the remaining valid time of the token, and the remaining valid time of the current token can be temporarily not obtained.

[0070] With respect to the second aspect above, the embodiment of the present application can edit the time interval T span The token validity period is ST token By comparison, the token validity time is a larger value than all the thresholds mentioned in the above embodiments, and is the total time that the token is valid. span ≥ST token, indicating that the user has not edited for a long time. In this case, the document can be automatically disconnected to prevent others from modifying the document without authorization, thus improving the security of online document editing.

[0071] In some embodiments of the present application, comparing the editing time interval with the editing time threshold includes: obtaining a token validity period set by a system; and determining the editing time threshold according to the token validity period.

[0072] Edit time threshold ST span The size can be adjusted based on the actual system conditions and the token validity period token The size of the flexibly set, for example, the embodiment of the present application ST span The size can be set as:

[0073]

[0074] Of course, it should be noted that the above ST span With ST token The size relationship is only an illustration in the embodiment of the present application. The specific setting can be flexibly set by technicians in this field according to actual needs, and no specific limitation is made here.

[0075] In some embodiments of the present application, determining whether to renew the token based on the remaining validity period of the current token and the token renewal time threshold includes: comparing the remaining validity period of the current token with the token renewal time threshold; if the remaining validity period of the current token is not greater than the token renewal time threshold, determining to renew the token; otherwise, determining not to renew the token.

[0076] When determining whether to renew a token, the remaining time T of the current token can be rest Token renewal time threshold ST renew By comparison, the token renewal time threshold refers to the maximum value of the remaining expiration time allowed for the token. That is, once it is detected that the remaining time of the user's token is less than the token renewal time threshold, renewal should be performed to avoid users being disconnected during normal use of the online editor due to failure to renew the token in time.

[0077] In some embodiments of the present application, after determining to renew the token, the token renewal method of the online editor also includes: generating a token renewal request and sending it to the server, so that the server generates a new token for the user and resets the token validity period; receiving the new token of the user returned by the server.

[0078] If it is determined that the token needs to be renewed, a token renewal request can be sent to the server. The request can carry the identification information related to the user's current token. After verifying the user's identity, the server regenerates the token for the current user, and the validity period of the newly generated token is reset to ST token , thereby completing the token renewal for the online editing page.

[0079] In some embodiments of the present application, determining whether to renew the token based on the remaining validity period of the current token and the token renewal time threshold includes: obtaining the token validity period set by the system; and determining the token renewal time threshold based on the token validity period.

[0080] The token renewal time threshold ST of the embodiment of the present application renew The size can also be set according to the actual situation. This value is mainly related to the token validity period ST token About, ST renew The value range of is:

[0081] 0 <ST renew <ST token

[0082] The ST in the embodiments of this application renew Can be set to:

[0083]

[0084] Of course, it should be noted that the above ST renew With ST token The size relationship is only an illustration in the embodiments of the present application. The specific setting can be flexibly set by technicians in this field according to actual needs, and no specific limitation is made here.

[0085] In order to facilitate the understanding of the above embodiments, Figure 2 As shown, a token renewal process diagram of an online editor in an embodiment of the present application is provided, which mainly includes the following steps:

[0086] S1: Set the validity period of the Token token , Edit time threshold ST span And the token renewal time threshold ST renew ;

[0087] S2: In the online editor webpage, monitor the user's editing behavior and determine the editing time interval T span Is it greater than or equal to the editing time threshold ST? span , if yes, execute S3, if no, repeat S2;

[0088] S3: Determine the remaining validity period T of the current Token rest Is it less than or equal to the renewal time threshold ST? renew , if yes, execute S4, if no, return to S2;

[0089] S4: The editor web page initiates a token renewal request, and the server executes the token renewal and returns the latest token and expiration time to the web page.

[0090] S5: Repeat S2 to S4 until T span ≥ST token (i.e. it has not been edited for a long time), or the user closes the webpage and exits the system.

[0091] In summary, the key points of the token renewal method of the online editor of this application mainly include:

[0092] 1) This application innovatively proposes a token renewal method specifically applied to online editor pages. Different from the new strategy of general web page token renewal, this method is based on page-side editing monitoring and can realize the intelligent renewal of tokens during the document editing process;

[0093] 2) The relevant settings and formulas for process control based on time thresholds proposed in this application use these core parameter settings and dynamic behavior algorithms to intelligently determine the timing of token renewal.

[0094] The token renewal method of the online editor of this application achieves at least the following technical effects:

[0095] 1) The token renewal method designed by this application and specifically applied to the online editor page can realize automatic renewal even if the user does not call the interface during the editing process, without relying on the automatic save function of the online editor, thereby improving the user experience;

[0096] 2) The method designed in this application reasonably sets the relevant time threshold, which can improve the performance of the editor client and server, and avoid the problem of frequent token renewal and untimely renewal;

[0097] 3) The method designed in this application can achieve automatic disconnection when the user does not edit the editor webpage for a long time, thereby preventing others from modifying the document and improving the security of the document.

[0098] The present application embodiment also provides a token renewal device 300 for an online editor, such as Figure 3 As shown, a schematic diagram of the structure of a token renewal device for an online editor in an embodiment of the present application is provided. The token renewal device 300 for the online editor includes: a monitoring unit 310, an acquisition unit 320 and a renewal unit 330, wherein:

[0099] A monitoring unit 310, used to monitor the user's editing operation on the online document;

[0100] The acquisition unit 320 is used to acquire the remaining time of the validity period of the current token of the user when the editing operation of the user is detected;

[0101] The renewal unit 330 is used to determine whether to renew the token according to the remaining time of the validity period of the current token and the token renewal time threshold.

[0102] In some embodiments of the present application, the acquisition unit 320 is specifically used to: obtain the token validity period set by the system, and determine the remaining validity period of the user's current token based on the token validity period set by the system; or, send a token time detection request to the server, and receive the remaining validity period of the user's current token returned by the server.

[0103] In some embodiments of the present application, when the user's editing operation is monitored, the token renewal device 300 of the online editor also includes: a determination unit, which is used to determine the user's editing time interval according to the monitored editing operation when the user's editing operation is monitored; a comparison unit, which is used to compare the editing time interval with the editing time threshold; the acquisition unit is also used to acquire the remaining validity period of the user's current token if the editing time interval is greater than or equal to the editing time threshold; otherwise, the remaining validity period of the user's current token is not acquired.

[0104] In some embodiments of the present application, the comparison unit is specifically used to: obtain a token validity period set by the system; and determine the editing time threshold according to the token validity period.

[0105] In some embodiments of the present application, the renewal unit 330 is specifically used to: compare the remaining validity period of the current token with the token renewal time threshold; if the remaining validity period of the current token is not greater than the token renewal time threshold, determine to renew the token; otherwise, determine not to renew the token.

[0106] In some embodiments of the present application, the token renewal device 300 of the online editor also includes: a generation unit, which is used to generate a token renewal request and send it to the server after determining to renew the token, so that the server generates a new token for the user and resets the token validity period; a receiving unit, which is used to receive the new token of the user returned by the server.

[0107] In some embodiments of the present application, the renewal unit 330 is specifically used to: obtain the token validity period set by the system; and determine the token renewal time threshold according to the token validity period.

[0108] It can be understood that the token renewal device of the above-mentioned online editor can implement the various steps of the token renewal method of the online editor provided in the aforementioned embodiment. The relevant explanations about the token renewal method of the online editor are applicable to the token renewal device of the online editor and will not be repeated here.

[0109] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0110] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0111] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0112] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a token renewal device of the online editor at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0113] Monitor users’ editing operations on online documents;

[0114] When the user's editing operation is detected, the remaining validity period of the user's current token is obtained;

[0115] Whether to renew the token is determined according to the remaining time of the current token's validity period and the token renewal time threshold.

[0116] The above application Figure 1 The method performed by the token renewal device of the online editor disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in software form. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0117] The present application also provides a computer program product, including a computer program or an instruction, which is implemented when the computer program or the instruction is executed by a processor. Figure 1 The token renewal method of the online editor in the illustrated embodiment is specifically used to execute:

[0118] Monitor users’ editing operations on online documents;

[0119] When the user's editing operation is detected, the remaining validity period of the user's current token is obtained;

[0120] Whether to renew the token is determined according to the remaining time of the current token's validity period and the token renewal time threshold.

[0121] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0122] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0123] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0124] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0125] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0126] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0127] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0128] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0130] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A token renewal method for an online editor, characterized in that: The token renewal method of the online editor includes: Monitor users’ editing operations on online documents; When the user's editing operation is detected, the remaining validity period of the user's current token is obtained; Whether to renew the token is determined according to the remaining time of the current token's validity period and the token renewal time threshold.

2. The token renewal method of the online editor according to claim 1, characterized in that: In the case where the editing operation of the user is monitored, obtaining the remaining validity period of the current token of the user includes: Obtaining the token validity period set by the system, and determining the remaining validity period of the user's current token according to the token validity period set by the system; or, Send a token time detection request to the server, and receive the remaining validity period of the user's current token returned by the server.

3. The token renewal method of the online editor according to claim 1, characterized in that: In the case where the user's editing operation is monitored, the token renewal method of the online editor further includes: In the case where the user's editing operation is monitored, determining the user's editing time interval according to the monitored editing operation; comparing the edit time interval with an edit time threshold; If the editing time interval is greater than or equal to the editing time threshold, obtaining the remaining time of the validity period of the user's current token; Otherwise, the remaining validity period of the user's current token will not be obtained.

4. The token renewal method of the online editor according to claim 3, characterized in that: The comparing the editing time interval with the editing time threshold comprises: Get the token validity period set by the system; The editing time threshold is determined according to the token validity period.

5. The token renewal method of the online editor according to claim 1, characterized in that: The determining whether to renew the token according to the remaining validity period of the current token and the token renewal time threshold comprises: Compare the remaining validity period of the current token with the token renewal time threshold; If the remaining validity period of the current token is not greater than the token renewal time threshold, determining to renew the token; Otherwise, it is determined that the token renewal will not be performed.

6. The token renewal method of the online editor according to claim 5, characterized in that: After determining to renew the token, the token renewal method of the online editor further includes: Generate a token renewal request and send it to the server, so that the server can generate a new token for the user and reset the token validity period; Receive the user's new token returned by the server.

7. The token renewal method of the online editor according to any one of claims 1 to 6, characterized in that: The determining whether to renew the token according to the remaining validity period of the current token and the token renewal time threshold comprises: Get the token validity period set by the system; The token renewal time threshold is determined according to the token validity period.

8. A token renewal device for an online editor, characterized in that: The token renewal device of the online editor includes: A monitoring unit, used to monitor the user's editing operation on the online document; An acquisition unit, used to acquire the remaining time of the validity period of the user's current token when an editing operation of the user is detected; The renewal unit is used to determine whether to renew the token according to the remaining time of the validity period of the current token and the token renewal time threshold.

9. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, which, when executed, cause the processor to perform the token renewal method of the online editor of any one of claims 1 to 7.

10. A computer program product, comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the token renewal method of the online editor of any one of claims 1 to 7 is implemented.