Offline mode user authorization method, device, electronic device and storage medium

By introducing offline mode user authorization method in distributed production systems, creating super offline users to perform tasks instead of users, solving the task execution problem caused by uncertain user login status, and realizing system automation and permission management.

CN111767533BActive Publication Date: 2025-01-07FU TAI HUA IND SHENZHEN +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910256290.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-04-01
Publication Date
2025-01-07
Estimated Expiration
2039-04-01

AI Technical Summary

Technical Problem

In a distributed production system, when the user's login status is uncertain, the user's authorization information cannot be obtained, resulting in the inability to perform timing tasks, which exceeds the scope of authentication of Oauth2.0.

Method used

The user authorization method is adopted for offline mode, and by obtaining user permissions, judging the user's online status, if not online, create a super offline user, give them offline task permissions, and use super offline users to perform tasks instead of users.

Benefits of technology

When the user is offline, he can execute timing tasks, ensuring the automation of tasks and controllability of permissions, and solving the task execution problem caused by uncertain user login status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111767533B_ABST
    Figure CN111767533B_ABST
Patent Text Reader

Abstract

The present invention provides an offline mode user authorization method, the method comprising: obtaining the user's authority, and setting the user's offline task authority according to the authority; when the task to be executed is executed, retrieving the user information corresponding to the task to be executed in a preset task information comparison table; judging whether the user is online; if the user is online, executing the task to be executed as the user; if the user is not online, creating a super offline user, and granting the user's offline task authority to the super offline user; and using the super offline user to replace the user to execute the task to be executed. The offline mode user authorization method of the present invention can identify the user's authority in offline mode.
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 offline mode user authorization method, device, electronic device and storage medium. Background Art

[0002] Nowadays, companies developing large-scale distributed production systems often use Spring (a lightweight open source framework) + Oauth2.0 (an open authorization standard) + SSO (Single Sign On) to achieve system distribution, controllable permissions, and single sign-on to avoid repeated password entry. However, as system requirements increase, automation requirements are also increasing, and the need for scheduled automatic execution of tasks has also emerged. When executing these customized scheduled tasks, the user login status is uncertain. Since a user is limited to logging in only once at a time, the user's authorization information cannot be obtained. At this time, the user is offline and has exceeded the authentication scope of Oauth2.0. Summary of the invention

[0003] In view of the above, it is necessary to propose an offline mode user authorization method, an offline mode user authorization method device, an electronic device and a storage medium. The offline mode user authorization method can identify the user's authority in offline mode and create a super offline user to perform corresponding operations on behalf of the user.

[0004] A first aspect of the present application provides an offline mode user authorization method, the method comprising:

[0005] Obtaining the user's permissions, and setting the user's offline task permissions according to the permissions;

[0006] When the task to be executed is executed, the user information corresponding to the task to be executed is retrieved from the preset task information comparison table;

[0007] Determine whether the user is online;

[0008] If the user is online, executing the task to be executed as the user;

[0009] If the user is not online, a super offline user is created, and the offline task authority of the user is granted to the super offline user; and

[0010] The super offline user is utilized to replace the user to perform the task to be performed.

[0011] The method further comprises:

[0012] Determining whether the super offline user has completed the task to be executed;

[0013] If the task has been completed, the super offline user is logged out, and the information of the super offline user executing the task to be executed is recorded.

[0014] The content of the offline task includes: one or more of: task ID, user ID, user name, task content, task parameters, and task execution scheduling plan.

[0015] The step of determining whether the user is online includes:

[0016] Searching the user login information table for the login information of the user according to the user name information; and

[0017] It is determined whether the user is online according to the search result.

[0018] The step of using the super offline user to replace the user to perform the task to be performed includes:

[0019] When the super offline user is used to execute the task to be executed, a temporary login token is created for the super offline user; and

[0020] The temporary login token enables a super offline user to perform the task to be performed on behalf of the user.

[0021] The temporary login token is valid for a preset time.

[0022] The steps also include:

[0023] Determine whether the pending task has been completed, and when the pending task has been completed, cancel the temporary login token.

[0024] A second aspect of the present application provides a line mode user authorization device, the device comprising:

[0025] An acquisition module, used to acquire the user's authority and set the user's offline task authority according to the authority;

[0026] A calling module, used for calling the user information corresponding to the task to be executed in a preset task information comparison table when the task to be executed is executed;

[0027] A judging module, used to judge whether the user is online;

[0028] A first execution module, used for executing the task as the user when the user is online;

[0029] A creation module, used for creating a super offline user when the user is offline, and granting the user's offline task authority to the super offline user; and

[0030] The second execution module is used to utilize the super offline user to replace the user to execute the task to be executed.

[0031] A third aspect of the present application provides a computer device, the computer device comprising a processor, the processor being configured to implement the offline mode user authorization method as described above when executing a computer program stored in a memory.

[0032] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the offline mode user authorization method as described above is implemented.

[0033] The offline mode user authorization method of the present invention creates an offline super user and grants the offline super user corresponding permissions. When the user is not online, the offline super user can perform corresponding tasks on behalf of the user, so that the user can also obtain user permissions and perform corresponding operations in the offline mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a flow chart of the offline mode user authorization method provided by an embodiment of the present invention.

[0035] Figure 2 It is a structural diagram of an offline mode user authorization device provided by an embodiment of the present invention.

[0036] Figure 3 It is a schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0037] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0038] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. The embodiments described are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0040] See also Figure 1FIG. 1 is a flowchart of an offline mode user authorization method provided by a first embodiment of the present invention. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.

[0041] Step S1: Obtain the user's authority, and set the user's offline task authority according to the authority.

[0042] The content of the offline task includes: one or more of: task ID, user ID, user name, task content, task parameters, and task execution scheduling plan.

[0043] In one embodiment of the present invention, the user obtains the login permission of the Oauth2.0 system by registering. The Oauth2.0 server will assign the corresponding usage permission to the user according to the information filled in by the user during registration and the system preset specifications. After obtaining the user permission, the user sets the offline task within the scope of the user permission according to the scope of his or her permission and the scope of the task to be processed. The offline task includes one or more of the task ID, user ID, user name, task content, task parameters, and task execution scheduling plan.

[0044] Step S2: when the task to be executed is executed, the user information corresponding to the task to be executed is retrieved from the preset task information comparison table.

[0045] In one embodiment of the present invention, the execution of the task in the Oauth2.0 system will be handed over to an asynchronous queue for execution, and multiple tasks can be executed concurrently at the same time. When the task is executed, the system will retrieve the information of the user who created the task, that is, the user ID, from the task information comparison table.

[0046] Step S3: Determine whether the user is online.

[0047] The step of determining whether the user is online includes:

[0048] Searching the user login information table for the user login information according to the user name information;

[0049] And judging whether the user is online according to the search result.

[0050] In one embodiment of the present invention, in the Oauth2.0 system, when a task to be executed is executed, the system will retrieve the user information that created the task from the task information comparison table, and check whether the user is logged in by retrieving the login information of the system at this time, and determine whether the user is online by the login status.

[0051] Step S4: If the user is online, the task to be executed is executed as the user.

[0052] In one embodiment of the present invention, if the user is online and the task is executed, a login token is directly obtained as the user, and then the task is completed using the login token.

[0053] Step S5: If the user is not online, a super offline user is created, and the offline task authority of the user is granted to the super offline user.

[0054] The user information is obtained from the task information comparison table, and according to the user information, the offline task range of the user is retrieved, the authority within the offline task range is granted to the super offline user, and the super offline user completes all offline tasks of the user.

[0055] In one embodiment of the present invention, in the Oauth2.0 system, the user is offline and the login token granted by the user cannot be obtained when the offline task is executed. At this time, the system will create a super offline user, and the authority of the super offline user will be granted according to the offline task set by the user.

[0056] As shown in Table 1: At a certain moment, user A created tasks 001 and 002, and the corresponding task contents of tasks 001 and 002 are task A and task B respectively; at this time, user B created task 003, and the corresponding task content of task 003 is task C. At this time, the Oauth2.0 system will open three threads, creating super offline users 1, super offline users 2, and super offline users 3 for tasks 001, 002, and 003 respectively. Super offline users 1 and super offline users 2 will obtain all the permissions of user A, and super offline user 3 will obtain all the permissions of user B. When the preset time is 8:00 a.m., by searching for user A's login information in the user login information table, user A is not online, then super offline user 1 obtains all the permissions of user A and executes tasks 001 and 002. Similarly, when the preset time is 8:00 a.m., by searching for user B's login information in the user login information table, user B is not online, then super offline user 3 obtains all the permissions of user B and executes task 003.

[0057] username Task Name Task content Super Offline User time User A 001 Task A Super Offline User 1 8:00am User A 002 Task B Super Offline 2 8:00am User B 003 Task C Super Offline 3 8:00am

[0058] Table 1

[0059] Step S6: Using the super offline user to replace the user to perform the task to be performed.

[0060] The step of using the super offline user to replace the user to perform the task to be performed includes:

[0061] When the super offline user is used to execute the task to be executed, a temporary login token is created for the super offline user;

[0062] And based on the temporary login token, the super offline user replaces the user to perform the task to be performed.

[0063] The temporary login token is valid for a preset time.

[0064] If the task has been completed, the super offline user is logged out, and information about the super offline user executing the task to be executed is recorded, wherein the information includes: one or more of the execution time, the executor, and the execution result.

[0065] In one embodiment of the present invention, when a super offline user logs in to the Oauth2.0 system, a temporary login token is generated. The login token is only used to execute this task, and the login token has a validity period. It can be used normally within the validity period. If the validity period is exceeded, a new temporary login token needs to be applied for. When the super offline user completes this task, the login token corresponding to this task will be cancelled, and the Oauth2.0 system will automatically record the detailed information of the execution of this task, such as the execution time, executor, execution results, etc. If the next task still needs to use the super offline user, a new login token will be generated.

[0066] Above Figure 1 The offline mode user authorization method of the present invention is introduced in detail. In conjunction with Figures 2-3, the functional modules of the software device that implements the offline mode user authorization method and the hardware device architecture that implements the offline mode user authorization method are introduced below.

[0067] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited by this structure.

[0068] Figure 2 It is a structural diagram of a preferred embodiment of the offline mode user authorization device of the present invention.

[0069] In some embodiments, the offline mode user authorization device 10 runs in a computer device. The computer device is connected to multiple user terminals via a network. The offline mode user authorization device 10 may include multiple functional modules composed of program code segments. The program code of each program segment in the offline mode user authorization device 10 may be stored in the memory of the computer device and executed by the at least one processor to implement the offline mode user authorization function.

[0070] In this embodiment, the offline mode user authorization device 10 can be divided into multiple functional modules according to the functions it performs. Figure 2As shown, the functional modules may include: an acquisition module 101, a call module 102, a judgment module 103, a first execution module 104, a creation module 105, and a second execution module 106. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0071] The acquisition module 101 is used to acquire the user's authority and set the user's offline task authority according to the authority.

[0072] The content of the offline task includes: one or more of: task ID, user ID, user name, task content, task parameters, and task execution scheduling plan.

[0073] In one embodiment of the present invention, the user obtains the login permission of the Oauth2.0 system by registering. The Oauth2.0 server will assign the corresponding usage permission to the user according to the information filled in by the user during registration and the system preset specifications. After obtaining the user permission, the user sets the offline task within the scope of the user permission according to the scope of his or her permission and the scope of the task to be processed. The offline task includes one or more of the task ID, user ID, user name, task content, task parameters, and task execution scheduling plan.

[0074] The retrieving module 102 is used to retrieve the user information corresponding to the task to be executed from a preset task information comparison table when the task to be executed is executed.

[0075] In one embodiment of the present invention, the execution of the task in the Oauth2.0 system will be handed over to an asynchronous queue for execution, and multiple tasks can be executed concurrently at the same time. When the task is executed, the system will retrieve the information of the user who created the task, that is, the user ID, from the task information comparison table.

[0076] The determination module 103 is used to determine whether the user is online.

[0077] The step of determining whether the user is online includes:

[0078] Searching the user login information table for the login information of the user according to the user name information;

[0079] And judging whether the user is online according to the search result.

[0080] In one embodiment of the present invention, in the Oauth2.0 system, when a task to be executed is executed, the system will retrieve the user information that created the task from the task information comparison table, and check whether the user is logged in by retrieving the login information of the system at this time, and determine whether the user is online by the login status.

[0081] The first execution module 104 is used to execute the task as the user when the user is online.

[0082] In one embodiment of the present invention, if the user is online and the task is executed, a login token is directly obtained as the user, and then the task is completed using the login token.

[0083] The creation module 105 is used to create a super offline user when the user is offline, and grant the user's offline task authority to the super offline user.

[0084] The user information is obtained from the task information comparison table, and according to the user information, the offline task range of the user is retrieved, the authority within the offline task range is granted to the super offline user, and the super offline user completes all offline tasks of the user.

[0085] In one embodiment of the present invention, in the Oauth2.0 system, the user is offline and the login token granted by the user cannot be obtained when the offline task is executed. At this time, the system will create a super offline user, and the authority of the super offline user will be granted according to the offline task set by the user.

[0086] At a certain moment, user A creates tasks 001 and 002. The corresponding task contents of tasks 001 and 002 are task A and task B respectively. At this time, user B creates task 003. The corresponding task content of task 003 is task C. At this time, the Oauth2.0 system will open three threads, and create super offline user 1, super offline user 2, and super offline user 3 for tasks 001, 002, and 003 respectively. Super offline user 1 and super offline user 2 will obtain all the permissions of user A, and super offline user 3 will obtain all the permissions of user B. When the preset time is 8:00 a.m., by searching for user A's login information in the user login information table, user A is not online, then super offline user 1 obtains all the permissions of user A and executes tasks 001 and 002. Similarly, when the preset time is 8:00 a.m., by searching for user B's login information in the user login information table, user B is not online, then super offline user 3 obtains all the permissions of user B and executes task 003.

[0087] The second execution module 106 is used to utilize the super offline user to replace the user to execute the task to be executed.

[0088] The step of using the super offline user to replace the user to perform the task to be performed includes:

[0089] When the super offline user is used to execute the task to be executed, a temporary login token is created for the super offline user;

[0090] And based on the temporary login token, a super offline user is enabled to perform the task to be performed on behalf of the user.

[0091] The temporary login token is valid for a preset time.

[0092] If the task has been completed, the super offline user is logged out, and information about the super offline user executing the task to be executed is recorded, wherein the information includes: one or more of the execution time, the executor, and the execution result.

[0093] In one embodiment of the present invention, when a super offline user logs in to the Oauth2.0 system, a temporary login token is generated. The login token is only used to execute this task, and the login token has a validity period. It can be used normally within the validity period. If the validity period is exceeded, a new temporary login token needs to be applied for. When the super offline user completes this task, the login token corresponding to this task will be cancelled, and the Oauth2.0 system will automatically record the detailed information of the execution of this task, such as the execution time, executor, execution results, etc. If the next task still needs to use the super offline user, a new login token will be generated.

[0094] Figure 3 FIG. 4 is a schematic diagram of a preferred embodiment of a computer device of the present invention.

[0095] The computer device 1 includes a memory 20, a processor 30, and a computer program 40 stored in the memory 20 and executable on the processor 30, such as an offline mode user authorization program. When the processor 30 executes the computer program 40, the steps in the offline mode user authorization method embodiment are implemented, such as Figure 1 Alternatively, when the processor 30 executes the computer program 40, the functions of each module / unit in the above-mentioned offline mode user authorization device embodiment are realized, for example Figure 2 Modules 101-106 in.

[0096] Exemplarily, the computer program 40 may be divided into one or more modules / units, which are stored in the memory 20 and executed by the processor 30 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program 40 in the computer device 1. For example, the computer program 40 may be divided into Figure 3 The acquisition module 101, the retrieval module 102, the judgment module 103, the first execution module 104, the creation module 105, and the second execution module 106 in the embodiment. For the specific functions of each module, please refer to the third embodiment.

[0097] The computer device 1 may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. Those skilled in the art will appreciate that the schematic diagram is merely an example of the computer device 1 and does not limit the computer device 1. The computer device 1 may include more or fewer components than shown in the diagram, or may combine certain components, or may include different components. For example, the computer device 1 may also include input and output devices, network access devices, buses, etc.

[0098] The processor 30 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor 30 may be any conventional processor, etc. The processor 30 is the control center of the computer device 1, and uses various interfaces and lines to connect various parts of the entire computer device 1.

[0099] The memory 20 can be used to store the computer program 40 and / or modules / units. The processor 30 implements various functions of the computer device 1 by running or executing the computer program and / or modules / units stored in the memory 20 and calling the data stored in the memory 20. The memory 20 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the computer device 1 (such as audio data, a phone book, etc.), etc. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0100] If the module / unit integrated in the computer device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0101] In the several embodiments provided by the present invention, it should be understood that the disclosed computer device and method can be implemented in other ways. For example, the computer device embodiment described above is only illustrative, for example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation.

[0102] In addition, each functional unit in each embodiment of the present invention may be integrated into the same processing unit, each unit may exist physically separately, or two or more units may be integrated into the same unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0103] It is obvious to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or computer devices stated in the computer device claim can also be implemented by the same unit or computer device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.

[0104] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.

Claims

1. An offline mode user authorization method, characterized in that: The method comprises: Obtaining the user's permissions, and setting the user's offline task permissions according to the permissions; When the task to be executed is executed by the asynchronous queue, the user information corresponding to the task to be executed is retrieved from the preset task information comparison table; Determine whether the user is online; If the user is online, executing the task to be executed as the user; If the user is not online, a super offline user is created, and the offline task authority of the user is granted to the super offline user; and Utilizing the super offline user to replace the user to perform the task to be performed includes: when utilizing the super offline user to perform the task to be performed, creating a temporary login token for the super offline user; and enabling the super offline user to replace the user to perform the task to be performed based on the temporary login token.

2. The offline mode user authorization method according to claim 1, characterized in that: The method further comprises: Determining whether the super offline user has completed the task to be executed; If the task has been completed, the super offline user is logged out, and the information of the super offline user executing the task to be executed is recorded.

3. The offline mode user authorization method according to claim 1, characterized in that: The content of the offline task includes: one or more of: task ID, user ID, user name, task content, task parameters, and task execution scheduling plan.

4. The offline mode user authorization method according to claim 1, characterized in that: The step of determining whether the user is online includes: Searching the user login information table for the login information of the user according to the user name information; and It is determined whether the user is online according to the search result.

5. The offline mode user authorization method according to claim 1, characterized in that: The temporary login token is valid for a preset time.

6. The offline mode user authorization method according to claim 1, characterized in that: The steps also include: Determine whether the pending task has been completed, and when the pending task has been completed, cancel the temporary login token.

7. An offline mode user authorization device, characterized in that: The device comprises: An acquisition module, used to acquire the user's authority and set the user's offline task authority according to the authority; A calling module, used for calling the user information corresponding to the task to be executed in the preset task information comparison table when the task to be executed is executed by the asynchronous queue; A judging module, used to judge whether the user is online; A first execution module, used for executing the task as the user when the user is online; A creation module, used for creating a super offline user when the user is offline, and granting the user's offline task authority to the super offline user; and The second execution module is used to use the super offline user to replace the user to execute the task to be executed, including: when using the super offline user to execute the task to be executed, creating a temporary login token for the super offline user; and enabling the super offline user to replace the user to execute the task to be executed based on the temporary login token.

8. A computer device, characterized in that: The computer device includes a processor and a memory, and the processor is used to implement the offline mode user authorization method according to any one of claims 1 to 6 when executing a computer program stored in the memory.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the offline mode user authorization method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • System, method, and computer-readable medium for just in time access through dynamic group memberships

    US20070157292A1

  • Impersonating target account via account redirection

    US20180337906A1