Working group isolation method and related equipment
By initializing the authorization relationship grouping table between users and workgroups in the scheduling platform and creating corresponding interfaces and instructions, user-level workgroup group isolation is realized, solving the problem of difficult user-level isolation in the existing technology, and improving the Availability of a workgroup cluster.
Patent Information
- Application Number
- CN202210216545.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-07
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-03-07
AI Technical Summary
In a multi-user distributed platform, it is difficult for existing workgroup isolation technology to achieve effective isolation at the user level, resulting in a single user using a large number of resources to drag down the entire cluster, affecting the jobs of other users, and reducing the availability of workgroup clusters.
By initializing the authorization relationship grouping table between users and workgroups at the data layer of the scheduling platform, and creating corresponding interfaces and instructions at the data access layer, service layer and control layer, allowing users to modify and query their authorization relationship with workgroups. , thereby achieving user-level workgroup group isolation.
Effectively isolate user-level jobs, improve the availability of workgroup clusters, reduce the impact on jobs between users, and ensure the reasonable allocation and use of resources.
Smart Images

Figure CN114840314B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of service scheduling technology, and more particularly to a workgroup grouping isolation method and related equipment. Background Art
[0002] When the scheduling platform schedules a work group consisting of a large number of working servers, each work group needs to be isolated in order to isolate the failure.
[0003] In related workgroup isolation technologies, workgroup isolation is usually achieved by isolating system functional modules or isolating resources.
[0004] However, in actual production, due to the large number of users, after the above method is used to isolate the workgroup, there will often be mutual influence between users during user-level operations. Specifically, a single user uses a large amount of resources at the same time, dragging down all workgroup clusters, which in turn causes other users' jobs to be seriously affected, greatly reducing the availability of the entire workgroup cluster.
[0005] Based on this, a solution is needed that can achieve workgroup isolation at the user level. Summary of the invention
[0006] In view of this, the purpose of this application is to propose a workgroup grouping isolation method and related equipment.
[0007] Based on the above purpose, the present application provides a workgroup group isolation method, which is applied to a scheduling platform, and the scheduling platform may include a data layer, a data access layer, a service layer and a control layer; the method includes:
[0008] Initialize a group table of authorization relationships between users and workgroups in the data layer, create an interface for the group table in the data access layer, preset an authorized workgroup query instruction and a multi-workgroup authorization instruction for calling the interface in the service layer, and preset a workgroup query instruction and a workgroup authorization instruction for calling the service layer instruction in the control layer;
[0009] For each of the users, in response to determining that the user issues a modification request to modify the workgroup, modify the authorization relationship between the user and the workgroup in the grouping table by calling the interface using the workgroup authorization instruction and the multi-workgroup authorization instruction, and return the modification result;
[0010] For each of the users, in response to determining that the user requests to query the workgroup in the grouping table, the workgroup query instruction and the authorized workgroup query instruction are used to query the workgroup corresponding to the user in the grouping table by calling the interface, the query results are returned, and the queried workgroup is called for the user.
[0011] Furthermore, the group table for initializing the authorization relationship between the user and the workgroup includes:
[0012] For each user, the group table is created using the user name, user ID, group names of each work group and the authorization rights between the user and each work group, and in the group table, the authorization relationship between a user and a work group is taken as a data strip;
[0013] The group table records the user's authority over each of the work groups.
[0014] Furthermore, the creating an interface for the grouping table in the data access layer includes:
[0015] In the data access layer, all data strips in the group table are created as workgroup-user classes;
[0016] Based on the workgroup-user class, the interface is created to perform at least one function of deleting, adding and querying the data strips in the grouping table;
[0017] The step of creating the interface includes:
[0018] Using the user name and the group name, create an interface query instruction for querying the authorized work group for the user in the grouping table;
[0019] Creating an interface insertion instruction for adding a new authorized workgroup for the user in the grouping table;
[0020] An interface deletion instruction for deleting an authorized workgroup is created for the user in the grouping table.
[0021] Furthermore, the authorized workgroup query instruction of the preset calling interface in the service layer includes:
[0022] Creating a workgroup service class in the service layer;
[0023] In the workgroup service class, creating the authorized workgroup query instruction using the user name and the user identifier;
[0024] The execution logic of the authorized workgroup query instruction is created as: calling the interface query instruction in the interface, and returning the query result to the service layer.
[0025] Furthermore, the presetting and use of the multi-workgroup authorization instruction includes:
[0026] Creating a user service class in the service layer;
[0027] In the user service class, creating the multi-workgroup authorization instruction using the user name, the user identifier and the group name;
[0028] Among them, the execution logic of the multi-workgroup authorization instruction is created as follows: based on the query result of the authorized workgroup query instruction on the authorized workgroup, the interface insertion instruction and the interface deletion instruction in the interface are called, and the modification result is returned to the service layer.
[0029] Further, the preset working group query instruction for calling the service layer instruction includes:
[0030] Creating a workgroup control class in the control layer;
[0031] In the workgroup control class, creating the workgroup query instruction using the user identifier;
[0032] The execution logic of the workgroup query instruction is created as follows: calling the authorized workgroup query instruction in the service layer, and returning the query result of the workgroup to the control layer.
[0033] Furthermore, the preset and use of the workgroup authorization instruction includes:
[0034] Creating a user control class in the control layer;
[0035] In the user control class, the workgroup authorization instruction is created using the user name, the user identifier and the group name of the authorized workgroup;
[0036] The execution logic of the workgroup authorization instruction is created as follows: calling the multi-workgroup authorization instruction in the service layer, and returning the modification result of the workgroup to the control layer.
[0037] Based on the same inventive concept, the present application also provides a workgroup group isolation device, which is applied to a scheduling platform. The scheduling platform includes a data layer, a data access layer, a service layer and a control layer. The device includes:
[0038] The preprocessing module is configured to: initialize a group table of authorization relationships between users and workgroups in the data layer, create an interface for the group table in the data access layer, preset an authorized workgroup query instruction and a multi-workgroup authorization instruction for calling the interface in the service layer, and preset a workgroup query instruction and a workgroup authorization instruction for calling the service layer instruction in the control layer;
[0039] The modification module is configured to: for each of the users, in response to determining that the user issues a modification request to modify the workgroup, modify the authorization relationship between the user and the workgroup in the grouping table by calling the interface using the workgroup authorization instruction and the multi-workgroup authorization instruction, and return the modification result;
[0040] The query module is configured as follows: for each of the users, in response to determining that the user requests to query the workgroup in the grouping table, using the workgroup query instruction and the authorized workgroup query instruction, querying the workgroup corresponding to the user in the grouping table by calling the interface, returning the query result, and calling the queried workgroup for the user.
[0041] Based on the same inventive concept, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the workgroup grouping isolation method as described in any one of the above items is implemented.
[0042] Based on the same inventive concept, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the workgroup group isolation method as described above.
[0043] From the above, it can be seen that the workgroup grouping isolation method and related devices provided by the present application create different classes and instructions based on the data layer, data access layer, service layer and control layer of the scheduling platform. The grouping table created by the data layer comprehensively considers the relationship between users and workgroups, and creates an interface for the grouping table in the data access layer, so that the authorized workgroup query instructions and multi-workgroup authorization instructions in the service layer, as well as the workgroup query instructions and workgroup authorization instructions in the control layer can start from the user, and call their respective instructions layer by layer according to different users to regulate the workgroup, thereby realizing effective isolation of workgroup groups when working at the user level, improving the availability of the entire workgroup cluster, and reducing the impact of operations between users. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A flowchart of a method for isolating working groups by grouping according to an embodiment of the present application;
[0046] Figure 2 This is a schematic diagram of a working group group isolation method device module according to an embodiment of the present application;
[0047] Figure 3 A schematic diagram of a modification process of a working group in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of a working group usage process of an embodiment of the present application;
[0049] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0051] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprising" and similar words mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects.
[0052] As described in the background technology section, the related workgroup grouping isolation method is still difficult to meet the needs of actual production.
[0053] In the process of implementing the present application, the applicant discovered that the main problems with the related workgroup grouping isolation methods are that thread-level isolation or process-level isolation achieved through system functional modules, as well as isolation of all resources through distributed systems, are difficult to resolve the mutual impact caused by a large number of user operations.
[0054] Specifically, although the other related technologies mentioned above have achieved fault isolation to a certain extent, even if cluster isolation is performed in the workgroup grouping, in a multi-user distributed platform, if user-level jobs cannot be isolated, a single user using a large amount of resources at the same time will drag down all clusters and affect the execution of other users' jobs, thereby reducing the high availability of the entire cluster.
[0055] It can be understood that the method can be executed by any device, equipment, platform, or device cluster having computing and processing capabilities.
[0056] The technical method of the present application is described in detail below through specific embodiments.
[0057] refer to Figure 1 A method for isolating working groups according to an embodiment of the present application includes the following steps:
[0058] Step S101, initialize a group table of authorization relationships between users and workgroups in the data layer, create an interface for the group table in the data access layer, preset authorized workgroup query instructions and multi-workgroup authorization instructions for calling the interface in the service layer, and preset workgroup query instructions and workgroup authorization instructions for calling the service layer instructions in the control layer.
[0059] In an embodiment of the present application, a scheduling platform including a data layer, a DAO layer (data access layer), a service layer and a control layer is taken as a specific example to describe the implementation method of WorkerGroup (workgroup) group isolation at the User (user) level.
[0060] Among them, in this embodiment, a workgroup includes at least one Worker Server (hereinafter referred to as Worker), and usually includes multiple Worker Servers; a user can be authorized to use at least one workgroup, and a workgroup is only authorized to one user. Furthermore, in this embodiment, the corresponding relationship between the above-mentioned user and the workgroup regarding the usage rights is called the authorization relationship between the user and the workgroup.
[0061] Therefore, based on the above settings, the workgroup grouping isolation method in this embodiment can isolate user-level jobs.
[0062] First, the data layer may be preprocessed, wherein the data layer of the scheduling platform has a database for storing data. In this embodiment, the specific type of the database is not limited, and it may be any type of database.
[0063] Furthermore, a group table for recording the authorization relationship between users and workgroups is created in the database, and the group table is named; as a specific example, the group table can be named: RelationWorkerGroupUser in this embodiment.
[0064] Furthermore, in the group table, a one-to-one authorization relationship between a user and a workgroup is taken as a data item in the group table and is specifically reflected as a column in the group table.
[0065] The fields included in each data strip include: relevant information of the user, relevant information of the workgroup, and authorization rights between the user and the workgroup, and the creation time is added to the data strip.
[0066] As a specific example, the fields of the user-related information may include, for example, the user's user name and the user ID (user identification) of the user; the fields of the workgroup-related information may include, for example, the group name of the workgroup.
[0067] In this embodiment, since different users are identified by user names when various operations are performed on users, the corresponding user name can be used to refer to the user in the following pseudocode expressing the logic and related explanations, and the user name is also represented by User; since different workgroups are identified by group names when calling and modifying operations on workgroups, the entire workgroup can be referred to by group name in the following pseudocode expressing the logic and related explanations, and the group name is also represented by WorkerGroup.
[0068] Through the group table of authorization relationships created in the database, the corresponding authorization relationships between users and workgroups can be persisted in the database to achieve smooth calling and modification of the workgroup.
[0069] In this embodiment, based on the grouping table created in the data layer, an interface between the data layer and the service layer can be further created in the DAO layer.
[0070] The creation of the interface may specifically include creating a class related to the grouping table, and creating related instructions for operating the grouping table.
[0071] Specifically, for the content in the grouping table, a workgroup-user class is created in the DAO layer. The workgroup-user class can be a class that only contains variables but not operations. The columns containing the above fields in the above grouping table, that is, the data strips, can be set as variables of the workgroup-user class.
[0072] As a specific example, this class may be referred to as the WorkGroupUser class in this embodiment.
[0073] Furthermore, based on the workgroup-user class created above, one or more instructions for performing operations on the group table in the database are created. Specifically, the workgroup-user class can be called to perform operations such as querying, modifying, deleting and adding on columns in the group table.
[0074] As a specific example in this embodiment, the instructions created in the interface include: an interface query instruction, an interface insertion instruction, and an interface deletion instruction.
[0075] Among them, the interface query instruction is used to query the work group that the selected user has the authority to use, and is named in this embodiment: QueryWorkGroupByUserID. When querying, based on the value of the selected UserID, the group name WorkerGroup corresponding to the value of the called variable User_ID can be determined in the grouping table, and the select statement can be used to select the work group in the grouping table RelationWorkerGroupUser.
[0076] Specifically, the execution logic of the interface query instruction is set as the pseudo code shown below: selectWorkerGroup from RelationWorkerGroupUser where user_id=#{UserID}
[0077] Furthermore, the interface insert instruction is used to add a new workgroup that needs to be authorized for the selected user, that is, to insert a new column for the user into the group table; in this embodiment, the Insert statement can be used as the interface insert instruction.
[0078] Furthermore, the interface delete instruction is used to delete the specified authorized workgroup for the selected user, that is, to delete the corresponding column for the user from the group table; and in this embodiment, it is named: DeleteWorkerGroupUserRelation. When deleting, the UserID and WorkerGroup to be deleted can be determined by calling the variables user_id and worker_group, and the delete statement can be used to delete the columns in the group table RelationWorkerGroupUser.
[0079] Specifically, the execution logic of the interface deletion instruction is set as the pseudo code shown below: delete fromRelationWorkerGroupUser where 1=1and user_id=#{UserID}and worker_group=#{workerGroup}
[0080] As a specific example of this embodiment, the interface created above can be named WorkerGroupUserMapper interface.
[0081] In an embodiment of the present application, based on the above preprocessing of the data layer and the DAO layer, the service layer can be further preprocessed, including: creating multiple instructions in the service layer that can perform different processing on the data in the grouping table by calling interfaces.
[0082] Specifically, the processing logic of the service layer can be set to make different classes responsible for different operation objects. In this embodiment, it can be set to make one class responsible for all operations related to the workgroup and another class responsible for all operations related to the user.
[0083] Furthermore, a class responsible for all operations related to the workgroup is created as: a class with the workgroup as the object and query as the action. The query action is used to query the authorized workgroup of the selected user in the group table by calling the interface query instruction in the interface; and in this embodiment, the class is named WorkGroupService class (workgroup service class).
[0084] Furthermore, the class responsible for all user-related operations can be created as: a class with user as the object and adding and deleting workgroups as actions, wherein the adding action is used to call the interface inserting instruction in the interface to add a new workgroup for the selected user in the grouping table to implement authorization; the deleting action is used to call the interface deleting instruction in the interface to delete the authorized workgroup of the selected user in the grouping table; in this embodiment, this class is named UserService class (user service class).
[0085] It should be noted that the creation of actions in the WorkGroupService class and the UserService class in this embodiment is merely exemplary. Each class may have the ability to perform other actions. The query action, add action, and delete action in this embodiment may be regarded as new actions newly added in the corresponding class, or may be regarded as the only actions in the corresponding class.
[0086] Furthermore, the query action in the WorkGroupService class can be implemented by creating a corresponding instruction; as a specific example in this embodiment, the instruction can be named QueryAuthorizedWorkerGroup instruction (authorized work group query instruction).
[0087] Specifically, the execution logic of the QueryAuthorizedWorkerGroup instruction is created as follows:
[0088] Use the value of the input UserID to determine the user to be queried;
[0089] Determine whether the user is an administrator;
[0090] If the user is not an administrator, all work groups in the group table are returned to the service layer;
[0091] Call the interface query command in the interface to query the workgroups authorized to the user among all the workgroups returned above;
[0092] Get the query results and return them to the service layer
[0093] End the QueryAuthorizedWorkerGroup directive.
[0094] As a specific example of this embodiment, the above execution logic created for the QueryAuthorizedWorkerGroup instruction can be expressed as the pseudo code shown in the following Table 1:
[0095] Table 1. Pseudo-code execution logic of the QueryAuthorizedWorkerGroup instruction
[0096]
[0097] Furthermore, the adding and deleting actions in the UserService class can be implemented by creating corresponding instructions; as a specific example in this embodiment, the instruction can be named GrantWorkerGroups instruction (multi-workgroup authorization instruction), and further, in the GrantWorkerGroups instruction, an authorization instruction for adding a new authorized workgroup to the user and a deletion instruction for deleting an authorized workgroup can be created for two operation situations respectively.
[0098] Specifically, the execution logic of the GrantWorkerGroups instruction is created as follows:
[0099] Use the value of the input UserID to determine the user to be queried, and use the input group name to determine the workgroup to be operated;
[0100] Determine whether the user is an administrator;
[0101] If the user is not an administrator, the execution result returned is failure;
[0102] Determine whether the user's UserID exists;
[0103] If the UserID does not exist, the execution result is returned as failure;
[0104] Create an authorization directive, including:
[0105] Call the interface query command in the interface to return the work group authorized to the user;
[0106] Determine whether each workgroup authorized to the user contains the input group name;
[0107] If not included, create a new workgroup;
[0108] Set a new object in the WorkGroupUser class, including: the group name of the new workgroup, the UserID of its authorized users, etc.
[0109] Call the interface insertion instruction in the interface to insert the newly set object in the WorkGroupUser class into the group table;
[0110] End the creation of authorization instructions;
[0111] Create a deletion instruction, including:
[0112] Among the authorized work groups, determine the work group that does not belong to the user in the group table;
[0113] Call the interface deletion instruction in the interface to delete the above-determined working group;
[0114] End the deletion instruction and get the execution result as success;
[0115] Returns the execution result and ends the GrantWorkerGroups instruction.
[0116] As a specific example of this embodiment, the above execution logic created for the GrantWorkerGroups instruction can be expressed as the pseudo code shown in the following Table 2:
[0117] Table 2. Pseudo-code execution logic of the GrantWorkerGroups directive
[0118]
[0119]
[0120] In an embodiment of the present application, based on the above-mentioned preprocessing of classes and instructions of the service layer, the control layer can be preprocessed, including: creating multiple instructions in the control layer that can perform different processing on the data in the grouping table by calling different instructions in the service layer.
[0121] Specifically, similar to the service layer, the processing logic of the control layer can be set to make different classes responsible for different operation objects. In this embodiment, it can be set to: make one class responsible for all operations related to the workgroup, and make another class responsible for all operations related to the user.
[0122] Furthermore, a class responsible for all operations related to the workgroup is created as: a class with the workgroup as the object and query as the action. The query action is used to call the interface query instruction in the interface by calling the QueryAuthorizedWorkerGroup instruction in the service layer, and then query the authorized workgroup of the selected user in the group table; and in this embodiment, this class is named WorkGroupController class (workgroup control class).
[0123] Furthermore, the class responsible for all user-related operations can be created as: a class with user as the object and adding and deleting workgroups as actions, wherein the adding action can be set to call the GrantWorkerGroups instruction in the service layer to call the interface insert instruction in the interface, so as to add a new workgroup for the selected user in the grouping table to achieve authorization; the deleting action can be set to call the GrantWorkerGroups instruction in the service layer to call the interface delete instruction in the interface to delete the authorized workgroup of the selected user in the grouping table; in this embodiment, this class is named UserController class (user service class).
[0124] It should be noted that the creation of actions in the WorkGroupController class and the UserController class in this embodiment is merely exemplary. Each class may have the ability to perform other actions. The query action, add action, and delete action in this embodiment may be regarded as new actions newly added in the corresponding class, or as the only actions in the corresponding class.
[0125] Furthermore, the query action in the WorkGroupController class can be implemented by creating a corresponding instruction; as a specific example in this embodiment, the instruction can be named QueryAllWorkerGroups (work group query instruction).
[0126] Specifically, the execution logic of the QueryAllWorkerGroups instruction is created as follows:
[0127] Use the value of the input UserID to determine the user to be queried;
[0128] Get all working groups;
[0129] Determine whether the UserID is valid;
[0130] If the UserID is valid, call the QueryAuthorizedWorkerGroup instruction to the service layer;
[0131] Execute the QueryAuthorizedWorkerGroup command and return the workgroups authorized to the user among all workgroups;
[0132] Get the query results and return them to the control layer
[0133] End the QueryAllWorkerGroups directive.
[0134] As a specific example of this embodiment, the above execution logic created for the QueryAllWorkerGroups instruction can be expressed as the pseudo code shown in the following Table 3:
[0135] Table 3. Pseudo-code execution logic of the QueryAllWorkerGroups instruction
[0136]
[0137]
[0138] Furthermore, for the adding and deleting actions in the UserController class, they can be implemented by creating corresponding instructions; as a specific example in this embodiment, the instruction can be named GrantWorkerGroup instruction (workgroup authorization instruction). Further, for the above-mentioned adding and deleting operations, both can be implemented by calling the service layer through the GrantWorkerGroup instruction.
[0139] Specifically, the execution logic of the GrantWorkerGroup instruction is created as follows:
[0140] Use the value of the input UserID to determine the user to be queried, and use the input group name to determine the workgroup to be operated;
[0141] Call GrantWorkerGroups command to the service layer;
[0142] Execute the GrantWorkerGroups instruction and return the execution result of the GrantWorkerGroups instruction in the service layer, DAO layer and data layer, where the execution result is execution success or execution failure;
[0143] End the GrantWorkerGroup directive.
[0144] As a specific example of this embodiment, the above execution logic created for the GrantWorkerGroup instruction can be expressed as the pseudo code shown in the following Table 4:
[0145] Table 4. Pseudo-code execution logic of the GrantWorkerGroup instruction
[0146]
[0147] Step S102: For each of the users, in response to determining that the user has issued a modification request to modify the workgroup, the authorization relationship between the user and the workgroup in the grouping table is modified by calling the interface using the workgroup authorization instruction and the multi-workgroup authorization instruction, and the modification result is returned.
[0148] In an embodiment of the present application, based on the above-mentioned preprocessing of the data layer, DAO layer, service layer and control layer, corresponding operations can be performed when the user issues a corresponding request. According to the above-mentioned preprocessing, in this embodiment, the request issued by the user may include modifying the authorization relationship with the corresponding workgroup and calling the specified workgroup.
[0149] In this embodiment, reference Figure 3 As shown, when a user sends a request to add or delete a work group, first, step S102-1 is executed to send a modification request.
[0150] Specifically, a request is sent to the scheduling platform. The modification request may be an authorization request for adding a new work group, or a deletion request for deleting a work group that the user has authorized.
[0151] Further, step S102-2 is executed to call the user control class.
[0152] Specifically, when the scheduling platform receives the above request from the user, it calls the user control class created in the control layer and specifically calls the workgroup authorization instruction therein. After calling the workgroup authorization instruction, it starts the execution of the instruction according to the execution logic created for the workgroup authorization instruction in the above control layer preprocessing.
[0153] Further, execute step S102-3, call the user service class.
[0154] Specifically, when executing a workgroup authorization instruction, the user service class created in the service layer is called to the service layer in accordance with the execution logic created for it, and the multi-workgroup authorization instruction therein is specifically called. After calling the multi-workgroup authorization instruction, the execution of the multi-workgroup authorization instruction is started in accordance with the execution logic created for the multi-workgroup authorization instruction in the above-mentioned service layer preprocessing.
[0155] Further, execute step S102-4, calling the interface.
[0156] Specifically, when executing a multi-workgroup authorization instruction, the instruction created in the WorkerGroupUserMapper interface is called according to the execution logic created for it, and the interface insertion instruction or interface deletion instruction is called for the authorization request or deletion request according to the user's specific request. After calling the interface insertion instruction or interface deletion instruction, the execution of the instruction is started according to the execution logic created for the instruction in the above-mentioned DAO layer.
[0157] Further, step S102-5 is executed, inserting or deleting in the grouping table.
[0158] Specifically, when an interface insertion instruction or an interface deletion instruction is executed, a corresponding working group is inserted into or deleted from the grouping table according to the execution logic created therefor, and the execution result of the request is obtained.
[0159] Further, execute step S102-6 and return the execution result.
[0160] Specifically, according to Figure 3 As shown, the execution results obtained above are returned layer by layer in the order of data layer, DAO layer, service layer and control layer, and finally returned to the user or the front end.
[0161] Step S103, for each of the users, in response to determining that the user requests to query the workgroup in the grouping table, use the workgroup query instruction and the authorized workgroup query instruction to query the workgroup corresponding to the user in the grouping table by calling the interface, return the query result, and call the queried workgroup for the user.
[0162] In this embodiment, reference Figure 4 As shown, when a user sends a request to query a certain work group that he is authorized to work with, first, step S104-1 is executed to send a query request; specifically, the query request is sent to the scheduling platform.
[0163] Further, step S104-2 is executed to call the work group control class.
[0164] Specifically, when the scheduling platform receives the above-mentioned query request from the user, it calls the workgroup control class created in the control layer to the control layer, and specifically calls the workgroup query instruction therein. After calling the workgroup query instruction, it starts the execution of the instruction according to the execution logic created for the workgroup query instruction in the above-mentioned control layer preprocessing.
[0165] Further, step S104-3 is executed to call the workgroup service class.
[0166] Specifically, when executing a workgroup query instruction, the workgroup service class created in the service layer is called to the service layer in accordance with the execution logic created for it, and the authorization workgroup query instruction therein is specifically called. After calling the authorization workgroup query instruction, the execution of the authorization workgroup query instruction is started in accordance with the execution logic created for the authorization workgroup query instruction in the above-mentioned service layer preprocessing.
[0167] Further, execute step S104-4, calling the interface.
[0168] Specifically, when executing the authorized workgroup query instruction, the instruction created in the interface is called to the WorkerGroupUserMapper interface according to the execution logic created for it, and the interface query instruction is called according to the user query request. After calling the interface query instruction, the execution of the instruction is started according to the execution logic created for the instruction in the above DAO layer.
[0169] Further, step S104-5 is executed, querying in the group table.
[0170] Specifically, when the interface query instruction is executed, the authorized work group specified by the user is queried in the group table according to the execution logic created for it, and the query result of the query request is obtained.
[0171] Further, step S104-6 is executed to return the query result.
[0172] Specifically, according to Figure 4 As shown, the query results obtained above are returned layer by layer in the order of data layer, DAO layer, service layer and control layer, and finally returned to the user or the front end.
[0173] From the above, it can be seen that the workgroup grouping isolation method and related devices provided by the present application create different classes and instructions based on the data layer, data access layer, service layer and control layer of the scheduling platform. The grouping table created by the data layer comprehensively considers the relationship between users and workgroups, and creates an interface for the grouping table in the data access layer, so that the authorized workgroup query instructions and multi-workgroup authorization instructions in the service layer, as well as the workgroup query instructions and workgroup authorization instructions in the control layer can start from the user, and call their respective instructions layer by layer according to different users to regulate the workgroup, thereby realizing effective isolation of workgroup groups when working at the user level, improving the availability of the entire workgroup cluster, and reducing the impact of operations between users.
[0174] It should be noted that the method of the embodiment of the present application can be performed by a single device, such as a computer or server. The method of this embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In the case of such a distributed scenario, one of the multiple devices can only perform one or more steps in the method of the embodiment of the present application, and the multiple devices will interact with each other to complete the described method.
[0175] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0176] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, an embodiment of the present application further provides a working group grouping isolation device.
[0177] refer to Figure 2 The workgroup group isolation device is applied to a scheduling platform, which includes a data layer, a data access layer, a service layer and a control layer; the device includes: a preprocessing module 201, a modification module 202 and a query module 203.
[0178] The preprocessing module 201 is configured to: initialize a group table of authorization relationships between users and workgroups in the data layer, create an interface for the group table in the data access layer, preset an authorized workgroup query instruction and a multi-workgroup authorization instruction for calling the interface in the service layer, and preset a workgroup query instruction and a workgroup authorization instruction for calling the service layer instruction in the control layer;
[0179] The modification module 202 is configured to: for each of the users, in response to determining that the user has sent a modification request to modify the work group, modify the authorization relationship between the user and the work group in the grouping table by calling the interface using the work group authorization instruction and the multi-work group authorization instruction, and return the modification result;
[0180] The query module 203 is configured as follows: for each of the users, in response to determining that the user requests to query the workgroup in the grouping table, using the workgroup query instruction and the authorized workgroup query instruction, querying the workgroup corresponding to the user in the grouping table by calling the interface, returning the query result, and calling the queried workgroup for the user.
[0181] As an optional embodiment, the preprocessing module 201 is specifically configured as follows:
[0182] For each user, the group table is created using the user name, user ID, group names of each work group and the authorization rights between the user and each work group, and in the group table, the authorization relationship between a user and a work group is taken as a data strip;
[0183] The group table records the user's authority over each of the work groups.
[0184] Further, in the data access layer, all data strips in the grouping table are created as workgroup-user classes;
[0185] Based on the workgroup-user class, the interface is created to perform at least one function of deleting, adding and querying the data strips in the grouping table;
[0186] Wherein, creating the interface includes:
[0187] Using the user name and the group name, create an interface query instruction for querying the authorized work group for the user in the grouping table;
[0188] Creating an interface insertion instruction for adding a new authorized workgroup for the user in the grouping table;
[0189] An interface deletion instruction for deleting an authorized workgroup is created for the user in the grouping table.
[0190] Further, creating a workgroup service class in the service layer;
[0191] In the workgroup service class, creating the authorized workgroup query instruction using the user name and the user identifier;
[0192] The execution logic of the authorized workgroup query instruction is created as: calling the interface query instruction in the interface, and returning the query result to the service layer.
[0193] Further, creating a user service class in the service layer;
[0194] In the user service class, creating the multi-workgroup authorization instruction using the user name, the user identifier and the group name;
[0195] Among them, the execution logic of the multi-workgroup authorization instruction is created as follows: based on the query result of the authorized workgroup query instruction on the authorized workgroup, the interface insertion instruction and the interface deletion instruction in the interface are called, and the modification result is returned to the service layer.
[0196] Further, creating a workgroup control class in the control layer;
[0197] In the workgroup control class, creating the workgroup query instruction using the user identifier;
[0198] The execution logic of the workgroup query instruction is created as follows: calling the authorized workgroup query instruction in the service layer, and returning the query result of the workgroup to the control layer.
[0199] Further, creating a user control class in the control layer;
[0200] In the user control class, the workgroup authorization instruction is created using the user name, the user identifier and the group name of the authorized workgroup;
[0201] The execution logic of the workgroup authorization instruction is created as follows: calling the multi-workgroup authorization instruction in the service layer, and returning the modification result of the workgroup to the control layer.
[0202] As an optional embodiment, the modification module 202 is specifically configured to:
[0203] Based on the above preprocessing of the data layer, DAO layer, service layer and control layer, corresponding operations can be performed when the user issues a corresponding request. According to the above preprocessing, in this embodiment, the request issued by the user may include modifying the authorization relationship with the corresponding workgroup and calling the specified workgroup.
[0204] In this embodiment, when a user sends a request to add or delete a work group, first, the step of sending a modification request is performed.
[0205] Further, the step of: calling the user control class is performed.
[0206] Further, the step of: calling the user service class is performed.
[0207] Further, the step of: calling an interface is performed.
[0208] Further, the step of inserting or deleting in the grouping table is performed.
[0209] Further, the execution step: returns the execution result.
[0210] As an optional embodiment, the query module 203 is specifically configured as follows:
[0211] In this embodiment, when a user sends a request to query a certain work group that he is authorized to work for, first, the step of sending a query request is executed.
[0212] Further, the execution step: calling the workgroup control class.
[0213] Further, the execution step: calling the workgroup service class.
[0214] Further, the step of: calling an interface is performed.
[0215] Further, the execution step: query in the group table.
[0216] Further, the step of executing: returning the query result.
[0217] For the convenience of description, the above devices are described in terms of functions and are divided into various modules. Of course, when implementing the embodiments of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0218] The device of the above embodiment is used to implement the corresponding working group group isolation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0219] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, an embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the workgroup grouping isolation method as described in any of the above embodiments is implemented.
[0220] Figure 5 A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 in the device.
[0221] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0222] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solution provided in the embodiment of the present application is implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0223] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.
[0224] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0225] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).
[0226] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiment of the present application, and does not necessarily include all the components shown in the figure.
[0227] The device of the above embodiment is used to implement the corresponding working group group isolation method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.
[0228] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the workgroup group isolation method described in any of the above embodiments.
[0229] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, tape 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.
[0230] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the workgroup grouping isolation method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0231] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.
[0232] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the known power supply / ground connection with the integrated circuit (IC) chip and other components may or may not be shown in the provided drawings. In addition, the device can be shown in the form of a block diagram to avoid making the embodiments of the present application difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the embodiments of the present application will be implemented (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details (e.g., circuits) to describe exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0233] Although the present application has been described in conjunction with specific embodiments of the present application, many replacements, modifications and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
[0234] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the protection scope of the present application.
Claims
1. A method for isolating workgroups by groups, characterized in that: Applied to a scheduling platform, the scheduling platform includes a data layer, a data access layer, a service layer and a control layer; the method includes: Initialize a group table of authorization relationships between users and workgroups in the data layer, create an interface for the group table in the data access layer, preset an authorized workgroup query instruction and a multi-workgroup authorization instruction for calling the interface in the service layer, and preset a workgroup query instruction and a workgroup authorization instruction for calling the service layer instruction in the control layer; For each of the users, in response to determining that the user issues a modification request to modify the workgroup, modify the authorization relationship between the user and the workgroup in the grouping table by calling the interface using the workgroup authorization instruction and the multi-workgroup authorization instruction, and return the modification result; For each of the users, in response to determining that the user requests to query the workgroup in the grouping table, the workgroup query instruction and the authorized workgroup query instruction are used to query the workgroup corresponding to the user in the grouping table by calling the interface, the query results are returned, and the queried workgroup is called for the user.
2. The method according to claim 1, characterized in that The group table for initializing the authorization relationship between users and workgroups includes: For each user, the group table is created using the user name, user ID, group names of each work group and the authorization rights between the user and each work group, and in the group table, the authorization relationship between a user and a work group is taken as a data strip; The group table records the user's authority over each of the work groups.
3. The method according to claim 2, characterized in that The step of creating an interface for the grouping table in the data access layer includes: In the data access layer, all data strips in the group table are created as workgroup-user classes; Based on the workgroup-user class, the interface is created to perform at least one function of deleting, adding and querying the data strips in the grouping table; The step of creating the interface includes: Using the user name and the group name, create an interface query instruction for querying the authorized work group for the user in the grouping table; Creating an interface insertion instruction for adding a new authorized workgroup for the user in the grouping table; An interface deletion instruction for deleting an authorized workgroup is created for the user in the grouping table.
4. The method according to claim 3, characterized in that The authorized workgroup query instruction of the preset calling interface in the service layer includes: Creating a workgroup service class in the service layer; In the workgroup service class, creating the authorized workgroup query instruction using the user name and the user identifier; The execution logic of the authorized workgroup query instruction is created as: calling the interface query instruction in the interface, and returning the query result to the service layer.
5. The method according to claim 3, characterized in that: The preset and use of the multi-workgroup authorization instruction includes: Creating a user service class in the service layer; In the user service class, creating the multi-workgroup authorization instruction using the user name, the user identifier and the group name; Among them, the execution logic of the multi-workgroup authorization instruction is created as follows: based on the query result of the authorized workgroup query instruction on the authorized workgroup, the interface insertion instruction and the interface deletion instruction in the interface are called, and the modification result is returned to the service layer.
6. The method according to claim 3, characterized in that The preset working group query instruction for calling the service layer instruction includes: Creating a workgroup control class in the control layer; In the workgroup control class, creating the workgroup query instruction using the user identifier; The execution logic of the workgroup query instruction is created as follows: calling the authorized workgroup query instruction in the service layer, and returning the query result of the workgroup to the control layer.
7. The method according to claim 3, characterized in that The preset and use of the working group authorization instructions include: Creating a user control class in the control layer; In the user control class, the workgroup authorization instruction is created using the user name, the user identifier and the group name of the authorized workgroup; The execution logic of the workgroup authorization instruction is created as follows: calling the multi-workgroup authorization instruction in the service layer, and returning the modification result of the workgroup to the control layer.
8. A working group isolation device, characterized in that: Applied to a scheduling platform, the scheduling platform includes a data layer, a data access layer, a service layer and a control layer; the device includes: The preprocessing module is configured to: initialize a group table of authorization relationships between users and workgroups in the data layer, create an interface for the group table in the data access layer, preset an authorized workgroup query instruction and a multi-workgroup authorization instruction for calling the interface in the service layer, and preset a workgroup query instruction and a workgroup authorization instruction for calling the service layer instruction in the control layer; The modification module is configured to: for each of the users, in response to determining that the user issues a modification request to modify the workgroup, modify the authorization relationship between the user and the workgroup in the grouping table by calling the interface using the workgroup authorization instruction and the multi-workgroup authorization instruction, and return the modification result; The query module is configured as follows: for each of the users, in response to determining that the user requests to query the workgroup in the grouping table, using the workgroup query instruction and the authorized workgroup query instruction, querying the workgroup corresponding to the user in the grouping table by calling the interface, returning the query result, and calling the queried workgroup for the user.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium stores computer instructions for causing a computer to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data platform control method, system and device and storage medium
CN111522843A
Micro-service access control method and device, electronic equipment and storage medium
CN111600899A
Supporting multi-tenant applications on a shared database using pre-defined attributes
US20160292236A1
