CN113721926A - Organization tree authority management method - Google Patents

Organization tree authority management method Download PDF

Info

Publication number
CN113721926A
CN113721926A CN202111058354.8A CN202111058354A CN113721926A CN 113721926 A CN113721926 A CN 113721926A CN 202111058354 A CN202111058354 A CN 202111058354A CN 113721926 A CN113721926 A CN 113721926A
Authority
CN
China
Prior art keywords
node
user
department
real
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111058354.8A
Other languages
Chinese (zh)
Inventor
张国营
韩松涛
王子正
赵迪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Group System Integration Co Ltd
Original Assignee
China Telecom Group System Integration Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Group System Integration Co Ltd filed Critical China Telecom Group System Integration Co Ltd
Priority to CN202111058354.8A priority Critical patent/CN113721926A/en
Publication of CN113721926A publication Critical patent/CN113721926A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/447Target code generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • Databases & Information Systems (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Quality & Reliability (AREA)
  • Computational Linguistics (AREA)
  • Operations Research (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method for managing authority of an organization tree, which comprises the following steps: acquiring user information, converting a user into a real node for storage, wherein the real node ID is a user ID; setting at least one virtual node for each user, wherein users with consistent visibility have the same virtual node ID, constructing a visible relation between the virtual node ID and the real node ID, and one virtual node ID can see at least one real node ID; and responding to a user query instruction, querying the virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, constructing a complete organization tree of the user visible range in a recursive mode, returning the organization tree to the user, and displaying a query result. The invention also discloses an organization tree authority management device, electronic equipment and a storage medium. The invention can improve the query efficiency of the organization tree, strictly controls the node visibility of the user to the organization tree and realizes the data isolation on business logic.

Description

Organization tree authority management method
Technical Field
The invention relates to the technical field of software development. More particularly, the present invention relates to a method of organizational tree rights management.
Background
In modern business systems, department organization trees and permissions are an important ring for the normal circulation of the system. The department organization tree and the user display thereof are an indispensable part in a modern business system of a government department, for example, notification bulletins are pushed according to the department, files are distributed according to the department, and the like.
The complete department organization tree usually maintains all departments and users in the system, however, in the prior art, the organization tree of the user visible department/user range is usually generated according to the hierarchical relationship between the department and the department to which the user belongs, which has several disadvantages in the actual business system: if the data volume of departments and users is particularly large, the construction speed of the organization tree is particularly slow; all users see the same organization tree, but in actual work, visibility of different departments and users to different organization tree nodes is often inconsistent, for example, department a has no right to see organization architecture and staff in department B.
Therefore, how to perform node visibility control and data range limitation on the organization tree for the user is the direction of research in the present application.
Disclosure of Invention
An object of the present invention is to solve at least the above problems and to provide at least the advantages described later.
It is still another object of the present invention to provide a method for managing authority of organization tree, which can improve the query efficiency of organization tree, and strictly control the visibility of user to nodes of organization tree, thereby implementing data isolation in business logic.
To achieve these objects and other advantages in accordance with the purpose of the invention, there is provided an organization tree rights management method comprising:
acquiring user information, converting a user into a real node for storage, wherein the real node ID is a user ID;
setting at least one virtual node for each user, wherein the users with consistent visibility have the same virtual node ID;
constructing a visible relation between virtual node IDs and real node IDs, wherein one virtual node ID can see at least one real node ID;
and responding to a user query instruction, querying the virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, constructing a complete organization tree of the user visible range in a recursive mode, returning the organization tree to the user, and displaying a query result.
It is preferable that the first and second liquid crystal layers are formed of,
the user information is stored in a user basic table and comprises a user ID, a user name and a user password;
generating an organization tree node basic table based on the user basic table, wherein the organization tree node basic table comprises real node IDs, node names, father node IDs, sequencing and whether the organization tree node basic table is a user node or not;
the information of the virtual node set by each user is stored in a virtual node user relation table and comprises a user ID and a virtual node ID;
and the constructed visible relation between the virtual node ID and the real node ID is stored in a virtual node visibility relation table, and comprises the virtual node ID and the real node ID.
Preferably, the method comprises the following steps:
acquiring user information, department information and information of a unique subordinate department of a user;
converting both a user and a department into real nodes for storage, wherein the real node IDs are respectively a user ID and a department ID, and the father node ID of each real node is respectively a unique user subordinate department ID and a superior department ID;
setting at least one virtual node for each user and department, wherein users with consistent visibility have the same virtual node ID;
constructing a visible relation between virtual node IDs and real node IDs, wherein one virtual node ID can see at least one real node ID;
responding to a user query instruction, querying a virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, further taking the condition that the father node ID is equal to the real node ID of the user parameter, obtaining the real node ID of the user parameter downward from the real node ID, returning the visible real node ID to the user in a list mode, and displaying a query result in a multi-level directory mode.
It is preferable that the first and second liquid crystal layers are formed of,
when the real node is a department, the real node ID, the real node name and the father node ID are respectively a department ID, a department name and a superior department ID, and whether the real node is a user node or not is false; when the real node is a user node, the real node ID, the real node name and the father node ID are respectively a user ID, a user name and a user unique subordinate department ID, and whether the real node is the user node or not is true.
It is preferable that the first and second liquid crystal layers are formed of,
the user information is stored in a user basic table and comprises a user ID, a user name and a user password;
the department information is stored in a department basic table and comprises a department ID, a department name and a superior department ID;
the information of the user unique membership department is stored in a user department relation table and comprises a user ID and a unique membership department ID;
generating an organization tree node basic table based on the user basic table, the department basic table and the user department relation table, wherein the organization tree node basic table comprises real node IDs, node names, father node IDs, sequencing and whether the organization tree node basic table is a user node or not;
the information of the virtual node set by each user is stored in a virtual node user relation table and comprises a user ID and a virtual node ID;
and the constructed visible relation between the virtual node ID and the real node ID is stored in a virtual node visibility relation table, and comprises the virtual node ID and the real node ID.
An organization tree rights management apparatus comprising:
the real node configuration module is used for acquiring user information, converting a user into a real node for storage, and taking the real node ID as a user ID;
the virtual node configuration module is used for setting at least one virtual node for each user, and the users with consistent visibility have the same virtual node ID;
the virtual-real node visible relation configuration module is used for constructing visible relations between virtual node IDs and real node IDs, and one virtual node ID can see at least one real node ID;
the information query module is used for responding to a user query instruction, querying the virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, and constructing a complete organization tree of the user visible range in a recursive mode;
and the information display module is used for performing front-end rendering, generating an organization tree and displaying the query result.
Preferably, the method comprises the following steps:
the real node configuration module is used for acquiring user information, department information and information of a unique user subordinate department, converting the user and the department into real nodes for storage, wherein the real node IDs are respectively a user ID and a department ID, and the father node ID of each real node is respectively a unique user subordinate department ID and a superior department ID;
the virtual node configuration module is used for setting at least one virtual node for each user and department, and the users with consistent visibility have the same virtual node ID;
the virtual-real node visible relation configuration module is used for constructing visible relations between virtual node IDs and real node IDs, and one virtual node ID can see at least one real node ID;
the information query module is used for responding to a user query instruction, the transmission parameter of the user comprises a real node ID, querying a virtual node ID of the user ID by the information query module, querying all visible real node IDs of the virtual node ID based on the visible relation, further taking the father node ID equal to the real node ID of the transmission parameter of the user as a condition, obtaining a real node ID of the transmission parameter of the user downwards, and constructing an organization tree in a visible range of the user in a list mode;
and the information display module is used for performing front-end rendering, generating an organization tree and displaying the query result in a multi-level directory mode.
Preferably, the method further comprises the following steps:
an information storage module for storing a user basic table, a department basic table, a user department relation table, a virtual node user relation table, a virtual and real node visibility relation table and an organization tree node basic table, the user basic table comprises a user ID, a user name and a user password, the department basic table comprises a department ID, a department name and a superior department ID, the user department relation table comprises a user ID and a unique membership department ID, the virtual node user relation table comprises a user ID and a virtual node ID, the virtual and real node visibility relation table comprises virtual node ID and node ID, the organization tree node basic table comprises real node ID, node name, father node ID, sequence, whether it is user node, when the real node is a department, the real node ID, the real node name and the father node ID are respectively a department ID, a department name and a superior department ID, and whether the real node is a user node or not is false; when the node is a user node, the real node ID, the real node name and the father node ID are respectively a user ID, a user name and a unique subordinate department ID of the user, and whether the node is the user node or not is true.
An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method.
A storage medium having stored thereon a computer program which, when executed by a processor, implements the method.
The invention at least comprises the following beneficial effects:
the invention adopts the department as the dimension to carry out the visibility control and the data range limitation of the nodes of the organization tree, improves the query efficiency of the organization tree, strictly controls the node visibility of the organization tree by the user and realizes the data isolation on business logic.
Secondly, the departments and the users are creatively subjected to proper table redundancy, a full organization tree is constructed through specific query, and a single construction mode is adopted (namely, the full organization tree is constructed by converting the full departments and the users into nodes after the user adjustment is completed each time, the visibility query of the users is participated, the process that the nodes are converted by the departments and the users in the subsequent user organization tree query process each time is reduced), so that the query efficiency of data is improved;
thirdly, the virtual node concept is introduced, so that the flexible and accurate control of the user visible organization tree is realized through the user-virtual node-real node (department + user), and meanwhile, the data redundancy is greatly reduced, and the query efficiency is improved;
fourthly, the visibility control between all nodes is realized by configuring the visible relation between each virtual node and each real node (department + user), so that users in different departments can only check the organization tree in the authority range of the users, the visibility of each node to each user in the departments can be completely customized, the customization degree is high, and the flexibility is strong.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention.
Drawings
FIG. 1 is a diagram of a full organizational tree and the organizational trees seen by different users in one example of the invention;
FIG. 2 is a schematic overall construction flow diagram of the present invention;
FIG. 3 is an entity relationship diagram of various tables of the present invention;
FIG. 4 is a schematic view of a visible organizational tree for users A11, A12 in accordance with an aspect of the present invention;
FIG. 5 is a schematic view of a visible organizational tree of users A11, A12 in accordance with another aspect of the present invention.
Detailed Description
The present invention is further described in detail below with reference to the attached drawings so that those skilled in the art can implement the invention by referring to the description text.
It will be understood that terms such as "having," "including," and "comprising," as used herein, do not preclude the presence or addition of one or more other elements or groups thereof.
The system manages and organizes users by departments and virtual node dimensions, one user only belongs to one department, the roles of the users in the system in the same department are the same, and the departments have clear superior and subordinate relationships; the visibility of the user address book under the same virtual node is consistent. The invention can realize that the content of the organization tree seen by the users in different departments and the different users in the same department is different, for example, FIG. 1a is a full organization tree, the door of the A department has two users of A-user, A-user and A departments, the door of the A department has two users of A-user and A-user, the door of the A department has two users of A-user and A2-user, the door of the B department has one user of B-user and two departments of B and B, the door of B department has two users of B-user and B-user, the door of C department has three users of C-user, C-user and C-user, FIG. 1B is the organization tree seen by the user A-user, FIG. 1C is the organization tree seen by the user A-user, and the roles of the users in the system in the same department are the same, but it can be seen that the address book is different.
To achieve the above, the present invention relates to the following two entity objects: user and department, one virtual object: a virtual node. Wherein, the user and the department are in a many-to-one relationship; the departments have a superior-inferior relation; the visibility relation exists between the user and the virtual nodes, the visibility of the nodes between the organization trees is controlled by taking the virtual nodes as dimensions, and the visibility is displayed by departments and user nodes. The visibility of the user address lists under the same virtual node is consistent, and the flexible configuration of the visibility of the address lists among different users in the same department is realized. When the functions of issuing notice announcements, sending files in batches and the like in the system are used for selecting users needing to receive messages, the selection of the receivers can be completed through two dimensions of departments and users.
The organization tree authority management method comprises the following steps:
acquiring user information, converting a user into a real node for storage, wherein the real node ID is a user ID;
setting at least one virtual node for each user, wherein the users with consistent visibility have the same virtual node ID;
constructing a visible relation between virtual node IDs and real node IDs, wherein one virtual node ID can see at least one real node ID;
and responding to a user query instruction, querying the virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, constructing a complete organization tree of the user visible range in a recursive mode, returning the organization tree to the user, and displaying a query result.
The USER information is stored in the USER base table, which includes the USER ID, the USER name, and the USER password, as shown in table 1.
TABLE 1
Field(s) Type of field Description of the invention
ID NUMBER User ID
USERNAME VARchar User name
PASSWORD VARchar User password
And generating a CONTACT _ BASIC organization tree node BASIC table based on the user BASIC table, wherein the BASIC table comprises a node ID, a node name, a father node ID, a sequence and whether the node is a user node or not, and the table 2 shows that the node is a user node.
TABLE 2
Field(s) Type of field Description of the invention
KEY_ID NUMBER Main key
SCOPE_ID NUMBER Real node ID
SCOPE_NAME VARchar Node name
P_SCOPE_ID NUMBER Parent node ID
ORDERBY NUMBER Sorting
IS_USER_NODE NUMBER Whether it is a user node
The information of each USER setting virtual node is stored in a VNODE _ USER virtual node USER relationship table, which includes a USER ID and a virtual node ID, as shown in table 3.
TABLE 3
Figure BDA0003255472730000061
Figure BDA0003255472730000071
The visible relationship between the virtual node ID and the real node ID is stored in the CONTACT _ VNODE virtual and real node visibility relationship table, which includes the virtual node ID and the real node ID, as shown in table 4.
TABLE 4
Field(s) Type of field Description of the invention
VNODE_ID NUMBER Virtual node ID
SCOPE_ID NUMBER Real node ID
In the above technical solution, when a certain user logs in the system and performs an organization tree query, the organization tree query may be performed in the following manner:
s1, inquiring the virtual node to which the USER belongs through the VNODE _ USER table to obtain a VNODE _ ID;
SELECT VNODE_ID FROM VNODE_USER WHERE USER_ID=?;
s2, carrying out correlation query on a CONTACT _ BASIC table and a CONTACT _ VNODE table to obtain all visible user real nodes of the user;
Figure BDA0003255472730000072
s3, a complete organization tree of the visible range of the user is constructed in a recursive manner and returned to the user.
Figure BDA0003255472730000073
Figure BDA0003255472730000081
S4, the returned data result is as follows:
Figure BDA0003255472730000082
Figure BDA0003255472730000091
Figure BDA0003255472730000101
the invention realizes the flexible control of the visibility of the organization tree with small granularity by certain data redundancy storage and a specific query method, and improves the data query efficiency. And constructing the visibility of the nodes of the organization tree by taking the virtual nodes as dimensions, and completing the visibility maintenance by configuring the relationship between each virtual node and each node.
The method is mainly applied to the condition that flexible configuration management needs to be carried out on the visibility of the organization tree of each user, and meanwhile, the storage magnitude is reduced as much as possible, the query efficiency is improved, and the stability of the system and the experience of the user are guaranteed. In actual business requirements, the visibility of the user in the organization tree species and the visible organization tree range of the user are required to be flexibly configured according to user jobs, special attribute conditions of the user and the like, and the traditional scheme for controlling the visibility of the user by departments cannot meet the flexible configuration requirement; in the conventional solution, in order to implement flexible configuration of the user organization tree, one-to-one visibility configuration needs to be performed between each user, which results in an exponential increase in the storage level of the organization tree, thereby affecting the query efficiency and further affecting the system stability and user experience. The method introduces the virtual nodes, classifies and designs the visibility user range, and realizes the flexible configuration of each user on the visibility of the user through the corresponding relation of the user and the virtual nodes, thereby reducing the storage magnitude of the organization tree and improving the query efficiency.
In another aspect, the method comprises:
acquiring user information, department information and information of a unique subordinate department of a user;
converting both a user and a department into real nodes for storage, wherein the real node IDs are respectively a user ID and a department ID, the father node ID of each real node is respectively a unique subordinate department ID and a superior department ID of the user, and when the department is a top-level department, the father node ID is identified by 0;
setting at least one virtual node for each user and department, wherein users with consistent visibility have the same virtual node ID;
constructing a visible relation between virtual node IDs and real node IDs, wherein one virtual node ID can see at least one real node ID;
responding to a user query instruction, querying a virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, further taking the condition that the father node ID is equal to the real node ID of the user parameter, obtaining the real node ID of the user parameter downward from the real node ID, returning the visible real node ID to the user in a list mode, and displaying a query result in a multi-level directory mode.
When the real node is a department, the real node ID, the real node name and the father node ID are respectively a department ID, a department name and a superior department ID, and whether the real node is a user node or not is false; when the real node is a user node, the real node ID, the real node name and the father node ID are respectively a user ID, a user name and a user unique subordinate department ID, and whether the real node is the user node or not is true.
The USER information is stored in the USER base table, which includes the USER ID, the USER name, and the USER password, as shown in table 5.
TABLE 5
Field(s) Type of field Description of the invention
ID NUMBER User ID
USERNAME VARchar User name
PASSWORD VARchar User password
The department information is stored in the OFFICE department basis table, and includes a department ID, a department name, and a superior department ID, as shown in table 6.
TABLE 6
Field(s) Type of field Description of the invention
OFFICE_ID NUMBER Department ID
OFFICE_NAME VARchar Name of department
OFFICE_ID_P NUMBER Parent ID
The information of the USER unique subordinate department is stored in a USER _ OFFICE USER department relation table, and comprises a USER ID and a unique subordinate department ID, as shown in a table 7.
TABLE 7
Field(s) Type of field Description of the invention
ID NUMBER Primary key ID
USER_ID NUMBER User ID
OFFICE_ID NUMBER Department ID
Generating a CONTACT _ BASIC organization tree node BASIC table based on the user BASIC table, the department BASIC table and the user department relation table, wherein the CONTACT _ BASIC organization tree node BASIC table comprises a node ID, a node name, a father node ID, sequencing and whether the node is a user node or not, and the table 8 shows the result.
TABLE 8
Field(s) Type of field Description of the invention
KEY_ID NUMBER Main key
SCOPE_ID NUMBER Real node ID
SCOPE_NAME VARchar Node name
P_SCOPE_ID NUMBER Parent node ID
ORDERBY NUMBER Sorting
IS_USER_NODE NUMBER Whether it is a user node
The information of each USER setting virtual node is stored in the VNODE _ USER virtual node USER relationship table, which includes the USER ID and the virtual node ID, as shown in table 9.
TABLE 9
Field(s) Type of field Description of the invention
USER_ID NUMBER User ID
VNODE_ID NUMBER Virtual node ID
The corresponding relationship between the user ID and the virtual node ID is stored in the CONTACT _ VNODE virtual and real node visibility relationship table, which includes the virtual node ID and the real node ID, as shown in table 10.
Watch 10
Field(s) Type of field Description of the invention
VNODE_ID NUMBER Virtual node ID
SCOPE_ID NUMBER Real node ID
When a user logs in the system and makes an organizational tree query, the organizational tree query can be made as follows:
s1, the transmission parameter of the user comprises the node ID;
s2, inquiring the visible virtual node of the USER through the VNODE _ USER table to obtain a VNODE _ ID;
SELECT VNODE_ID FROM VNODE_USER WHERE USER_ID=?
s3, carrying out correlation query on a CONTACT _ BASIC table and a CONTACT _ VNODE table, and obtaining a user child node visible to a user under the node, wherein the query condition is that the parent node ID is equal to the node ID of the user transmission parameter;
Figure BDA0003255472730000131
and S4, returning the visible nodes to the user in a list mode.
Figure BDA0003255472730000132
Figure BDA0003255472730000141
The method is mainly applied to the situation that when the organization tree is too many and the hierarchy is too deep, the layer-by-layer request loading of the data is realized, the virtual nodes and the real nodes are associated, the flexible configuration of the visibility of the organization tree nodes by a user is realized, the recursion query process during each time of the organization tree query is reduced, the query efficiency is improved, and the server loss is reduced.
The method creatively carries out appropriate table redundancy on departments and users, constructs a full organization tree through specific query, and adopts a single construction mode (namely, the full organization tree is constructed by converting the full departments and the users into nodes after the user adjustment is completed each time, the user visibility query is participated, the process that the nodes are converted by the departments and the users in the process of querying the organization tree of each subsequent user is reduced), and the query efficiency of data is improved;
the method introduces a virtual node concept, realizes the flexible and accurate control of the user visible organization tree through the user-virtual node-real node (department + user), greatly reduces data redundancy and improves the query efficiency;
the invention realizes the visibility control among all nodes by configuring the visible relation between each virtual node and each real node (department + user), so that different department users can only check the organizational tree in the authority range of the users, the visibility of each node to each department user can be completely customized, the customization degree is very high, and the flexibility is strong.
In the actual operation process, virtual nodes may also be set for each department, users with consistent visibility have the same virtual node ID, the virtual node ID of a unique subordinate department of a user is set according to the virtual node ID of the user, and information is stored in the VNODE _ OFFICE virtual node department relationship table, including the department ID and the virtual node ID, as shown in table 11.
TABLE 11
Field(s) Type of field Description of the invention
USER_ID NUMBER Department ID
VNODE_ID NUMBER Virtual node ID
Compared with the method, one recursion can be reduced, the memory consumption is avoided, and the query speed is higher.
In another aspect, the method comprises:
the real node configuration module is used for acquiring user information, converting a user into a real node for storage, and taking the real node ID as a user ID;
the virtual node configuration module is used for setting at least one virtual node for each user, and the users with consistent visibility have the same virtual node ID;
the virtual-real node visible relation configuration module is used for constructing visible relations between virtual node IDs and real node IDs, and one virtual node ID can see at least one real node ID;
the information query module is used for responding to a user query instruction, querying the virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, and constructing a complete organization tree of the user visible range in a recursive mode;
and the information display module is used for performing front-end rendering, generating an organization tree and displaying the query result.
The information storage module is used for storing a user basic table, a virtual node user relation table, a virtual and real node visibility relation table and an organization tree node basic table, wherein the user basic table comprises a user ID, a user name and a user password, the virtual node user relation table comprises a user ID and a virtual node ID, the virtual and real node visibility relation table comprises a virtual node ID and a node ID, and the organization tree node basic table comprises a real node ID, a node name, a father node ID, sequencing and whether the organization tree node is a user node or not.
In another aspect, the method comprises:
the real node configuration module is used for acquiring user information, department information and information of a unique user subordinate department, converting the user and the department into real nodes for storage, wherein the real node IDs are respectively a user ID and a department ID, and the father node ID of each real node is respectively a unique user subordinate department ID and a superior department ID;
the virtual node configuration module is used for setting at least one virtual node for each user and department, and the users with consistent visibility have the same virtual node ID;
the virtual-real node visible relation configuration module is used for constructing visible relations between virtual node IDs and real node IDs, and one virtual node ID can see at least one real node ID;
the information query module is used for responding to a user query instruction, the transmission parameter of the user comprises a real node ID, the information query module queries a virtual node ID of the user ID, queries all visible real node IDs of the virtual node ID based on the visible relation, further obtains a real node ID of the user with the downward real node ID of the transmission parameter of the user under the condition that the father node ID is equal to the real node ID of the transmission parameter of the user, and constructs a complete organization tree in a visible range of the user in a list mode;
and the information display module is used for performing front-end rendering, generating an organization tree and displaying the query result in a multi-level directory mode.
In another technical solution, the method further comprises:
an information storage module for storing a user basic table, a department basic table, a user department relation table, a virtual node user relation table, a virtual and real node visibility relation table and an organization tree node basic table, the user basic table comprises a user ID, a user name and a user password, the department basic table comprises a department ID, a department name and a superior department ID, the user department relation table comprises a user ID and a unique membership department ID, the virtual node user relation table comprises a user ID and a virtual node ID, the virtual and real node visibility relation table comprises virtual node ID and node ID, the organization tree node basic table comprises real node ID, node name, father node ID, sequence, whether it is user node, when the real node is a department, the real node ID, the real node name and the father node ID are respectively a department ID, a department name and a superior department ID, and whether the real node is a user node or not is false; when the node is a user node, the real node ID, the real node name and the father node ID are respectively a user ID, a user name and a unique subordinate department ID of the user, and whether the node is the user node or not is true.
An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method.
A storage medium having stored thereon a computer program which, when executed by a processor, implements the method.
In one specific example, a query is organized into a tree of full users:
step 1, converting department information into a node information table, wherein the data of an original department information table is shown in a table 12:
TABLE 12
OFFICES_ID OFFICES_NAME OFFICES_ID_P
1 Headquarters 0
11 Department A 1
12 Department B 1
13 Department C 1
111 Department A1 11
112 Department A2 11
121 Department B1 12
122 Department B2 12
131 Department C1 13
132 Department C2 13
1321 Department C21 132
Converting the original department information table into a node information table, wherein the data of the node information table is shown as a table 13:
watch 13
Figure BDA0003255472730000161
Figure BDA0003255472730000171
Step 2, converting the user information into a node information table, wherein the data of the original user information table is shown in table 14:
TABLE 14
USER_ID USER_NAME
10101 User1
10102 User2
101101 User A1
101102 User A2
101201 User B1
101202 User B2
101301 User C1
101302 User C2
1011101 User A11
1011102 User A12
1011201 User A21
1011202 User A22
1012101 User B11
1012102 User B12
1012201 User B21
1012202 User B22
1013101 User C11
1013102 User C12
1013201 User C21
1013202 User C22
10132101 User C211
10132102 User C212
Convert the original user information table to the node information table, the data of the node information table is shown in table 15:
watch 15
Figure BDA0003255472730000172
Figure BDA0003255472730000181
At this time, all data in the node table is as shown in table 16:
TABLE 16
Figure BDA0003255472730000182
Figure BDA0003255472730000191
And 3, constructing a virtual node user relationship table as shown in the table 17.
TABLE 17
USER_ID VNODE_ID
1011101 1
1011102 11
And 4, constructing a visibility relation of the virtual nodes and the real nodes (only the headquarter and the department A are configured in the example), as shown in a table 18.
Watch 18
Figure BDA0003255472730000192
Figure BDA0003255472730000201
Figure BDA0003255472730000211
Step 5, users A11 and A12 query the organization tree flow:
the first scheme is as follows:
step one, based on a user basic table, a user and department relation table and a department basic table, converting departments and users into organization tree nodes and generating a hierarchical relation tree table;
introducing a virtual node concept, classifying virtual nodes of users with consistent visibility, and generating a user and virtual node relation table and a virtual node and organization tree node visibility relation table in a distributed manner;
step three, inquiring a virtual node corresponding to the user according to the user ID;
step four, inquiring the visible organization node range of the virtual node according to the virtual node ID associated with the virtual node and the visibility relation table of the organization tree node in the step two;
step five, the node hierarchical relation tree in the step one is associated according to the inquired visible range of the organization node, construction of the organization tree data is completed in a recursive mode, and the organization tree data is returned through an interface;
and step six, the front end performs front end rendering according to the organization tree data returned by the interface to generate an organization tree.
The results of the users a11 and a12 after query are shown in fig. 4, the left side 4a is the organization tree displayed by the user a11 query, and the right side 4b is the organization tree displayed by the user a11 query.
The second scheme is as follows:
step one, based on a user basic table, a user and department relation table and a department basic table, converting departments and users into organization tree nodes and generating a hierarchical relation tree table;
introducing a virtual node concept, classifying virtual nodes of users with consistent visibility, and generating a user and virtual node relation table and a virtual node and organization tree node visibility relation table in a distributed manner;
step three, inquiring a virtual node corresponding to the user according to the user ID;
step four, according to the virtual node ID and the real node information which is requested to be inquired, the virtual node and the organization tree node visibility relation table in the step two are correlated to inquire all the organization node ranges which are visible for the virtual node and under the inquired real node;
step five, the node hierarchical relation tree in the step one is associated according to the inquired visible range of the organization node, the construction of the organization tree data is completed in a list mode, and the organization tree data is returned through an interface;
and step six, the front end performs front end rendering according to the organization tree data returned by the interface and the inquired real node information to generate the organization tree.
The results of the queries by users a11 and a12 are shown in fig. 5, where 5a is the displayed organization tree of user a11 for the headquarters, 5B is the displayed organization tree of user a12 for the headquarters, 5c is the displayed organization tree of user a11 for department B, and 5d is the displayed organization tree of user a12 for department B.
The above example illustrates that, compared with the prior art, the method and the system for generating the organization tree node hierarchy table have the advantages that one redundant organization tree node hierarchy table is generated after the departments and the users are converted into the organization nodes, the process that the node relationships are generated according to the relationships between the users and the departments and the hierarchy relationships between the departments in the user organization tree generation process each time can be reduced, query complexity is simplified, and query efficiency is improved;
the method introduces a concept of virtual nodes, groups and merges users with consistent visible range of an organization tree, generates a user and virtual node relation table and a virtual node and organization tree node visibility relation table, and realizes control of user-node visibility based on a user-virtual node-node visibility process, compared with the prior art, the method can greatly reduce data redundancy in a traditional process for maintaining user and visibility department/user modes (in a traditional mode, a power relation is formed between the data magnitude of a user visible range relation table and the total data magnitude of a department/user, and when the total data magnitude of a user is too many, the data magnitude of the user visible range relation table is too many, in an innovation mode, as the virtual nodes merge the users, the data magnitude redundancy is greatly reduced, and in the case that the total data magnitude of the department/user is too many, when the number of the merged virtual nodes is over hundred, the data volume of the virtual nodes and the visibility relation table of the nodes of the organization tree is in the million level), and the query efficiency is improved.
The number of apparatuses and the scale of the process described herein are intended to simplify the description of the present invention. Applications, modifications and variations of the present invention will be apparent to those skilled in the art.
While embodiments of the invention have been described above, it is not limited to the applications set forth in the description and the embodiments, which are fully applicable in various fields of endeavor to which the invention pertains, and further modifications may readily be made by those skilled in the art, it being understood that the invention is not limited to the details shown and described herein without departing from the general concept defined by the appended claims and their equivalents.

Claims (10)

1. The organization tree authority management method is characterized by comprising the following steps:
acquiring user information, converting a user into a real node for storage, wherein the real node ID is a user ID;
setting at least one virtual node for each user, wherein the users with consistent visibility have the same virtual node ID;
constructing a visible relation between virtual node IDs and real node IDs, wherein one virtual node ID can see at least one real node ID;
and responding to a user query instruction, querying the virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, constructing a complete organization tree of the user visible range in a recursive mode, returning the organization tree to the user, and displaying a query result.
2. The organizational tree rights management method of claim 1 wherein,
the user information is stored in a user basic table and comprises a user ID, a user name and a user password;
generating an organization tree node basic table based on the user basic table, wherein the organization tree node basic table comprises real node IDs, node names, father node IDs, sequencing and whether the organization tree node basic table is a user node or not;
the information of the virtual node set by each user is stored in a virtual node user relation table and comprises a user ID and a virtual node ID;
and the constructed visible relation between the virtual node ID and the real node ID is stored in a virtual node visibility relation table, and comprises the virtual node ID and the real node ID.
3. The organizational tree rights management method of claim 1 comprising:
acquiring user information, department information and information of a unique subordinate department of a user;
converting both a user and a department into real nodes for storage, wherein the real node IDs are respectively a user ID and a department ID, and the father node ID of each real node is respectively a unique user subordinate department ID and a superior department ID;
setting at least one virtual node for each user and department, wherein users with consistent visibility have the same virtual node ID;
constructing a visible relation between virtual node IDs and real node IDs, wherein one virtual node ID can see at least one real node ID;
responding to a user query instruction, querying a virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, further taking the condition that the father node ID is equal to the real node ID of the user parameter, obtaining the real node ID of the user parameter downward from the real node ID, returning the visible real node ID to the user in a list mode, and displaying a query result in a multi-level directory mode.
4. The organizational tree rights management method of claim 3 wherein,
when the real node is a department, the real node ID, the real node name and the father node ID are respectively a department ID, a department name and a superior department ID, and whether the real node is a user node or not is false; when the real node is a user node, the real node ID, the real node name and the father node ID are respectively a user ID, a user name and a user unique subordinate department ID, and whether the real node is the user node or not is true.
5. The organizational tree rights management method of claim 4 wherein,
the user information is stored in a user basic table and comprises a user ID, a user name and a user password;
the department information is stored in a department basic table and comprises a department ID, a department name and a superior department ID;
the information of the user unique membership department is stored in a user department relation table and comprises a user ID and a unique membership department ID;
generating an organization tree node basic table based on the user basic table, the department basic table and the user department relation table, wherein the organization tree node basic table comprises real node IDs, node names, father node IDs, sequencing and whether the organization tree node basic table is a user node or not;
the information of the virtual node set by each user is stored in a virtual node user relation table and comprises a user ID and a virtual node ID;
and the constructed visible relation between the virtual node ID and the real node ID is stored in a virtual node visibility relation table, and comprises the virtual node ID and the real node ID.
6. An organization tree rights management apparatus comprising:
the real node configuration module is used for acquiring user information, converting a user into a real node for storage, and taking the real node ID as a user ID;
the virtual node configuration module is used for setting at least one virtual node for each user, and the users with consistent visibility have the same virtual node ID;
the virtual-real node visible relation configuration module is used for constructing visible relations between virtual node IDs and real node IDs, and one virtual node ID can see at least one real node ID;
the information query module is used for responding to a user query instruction, querying the virtual node ID of the user ID, querying all visible real node IDs of the virtual node ID based on the visible relation, and constructing a complete organization tree of the user visible range in a recursive mode;
and the information display module is used for performing front-end rendering, generating an organization tree and displaying the query result.
7. The organizational tree rights management device of claim 6 comprising:
the real node configuration module is used for acquiring user information, department information and information of a unique user subordinate department, converting the user and the department into real nodes for storage, wherein the real node IDs are respectively a user ID and a department ID, and the father node ID of each real node is respectively a unique user subordinate department ID and a superior department ID;
the virtual node configuration module is used for setting at least one virtual node for each user and department, and the users with consistent visibility have the same virtual node ID;
the virtual-real node visible relation configuration module is used for constructing visible relations between virtual node IDs and real node IDs, and one virtual node ID can see at least one real node ID;
the information query module is used for responding to a user query instruction, the transmission parameter of the user comprises a real node ID, querying a virtual node ID of the user ID by the information query module, querying all visible real node IDs of the virtual node ID based on the visible relation, further taking the father node ID equal to the real node ID of the transmission parameter of the user as a condition, obtaining a real node ID of the transmission parameter of the user downwards, and constructing an organization tree in a visible range of the user in a list mode;
and the information display module is used for performing front-end rendering, generating an organization tree and displaying the query result in a multi-level directory mode.
8. The organizational tree rights management device of claim 7 further comprising:
an information storage module for storing a user basic table, a department basic table, a user department relation table, a virtual node user relation table, a virtual and real node visibility relation table and an organization tree node basic table, the user basic table comprises a user ID, a user name and a user password, the department basic table comprises a department ID, a department name and a superior department ID, the user department relation table comprises a user ID and a unique membership department ID, the virtual node user relation table comprises a user ID and a virtual node ID, the virtual and real node visibility relation table comprises virtual node ID and node ID, the organization tree node basic table comprises real node ID, node name, father node ID, sequence, whether it is user node, when the real node is a department, the real node ID, the real node name and the father node ID are respectively a department ID, a department name and a superior department ID, and whether the real node is a user node or not is false; when the node is a user node, the real node ID, the real node name and the father node ID are respectively a user ID, a user name and a unique subordinate department ID of the user, and whether the node is the user node or not is true.
9. An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of any of claims 1-5.
10. Storage medium on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 5.
CN202111058354.8A 2021-09-09 2021-09-09 Organization tree authority management method Pending CN113721926A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111058354.8A CN113721926A (en) 2021-09-09 2021-09-09 Organization tree authority management method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111058354.8A CN113721926A (en) 2021-09-09 2021-09-09 Organization tree authority management method

Publications (1)

Publication Number Publication Date
CN113721926A true CN113721926A (en) 2021-11-30

Family

ID=78683046

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111058354.8A Pending CN113721926A (en) 2021-09-09 2021-09-09 Organization tree authority management method

Country Status (1)

Country Link
CN (1) CN113721926A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107784088A (en) * 2017-09-30 2018-03-09 杭州博世数据网络有限公司 The knowledge mapping construction method of knowledge based point annexation
CN108009408A (en) * 2017-12-04 2018-05-08 山东浪潮通软信息科技有限公司 A kind of right management method, device, computer-readable recording medium and storage control
CN108475508A (en) * 2015-12-10 2018-08-31 阿斯卡瓦公司 The simplification of audio data and the data being stored in block processing storage system
CN111698526A (en) * 2020-06-10 2020-09-22 中邮建技术有限公司 Method and system for realizing viewing of live video by scanning two-dimensional code

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108475508A (en) * 2015-12-10 2018-08-31 阿斯卡瓦公司 The simplification of audio data and the data being stored in block processing storage system
CN107784088A (en) * 2017-09-30 2018-03-09 杭州博世数据网络有限公司 The knowledge mapping construction method of knowledge based point annexation
CN108009408A (en) * 2017-12-04 2018-05-08 山东浪潮通软信息科技有限公司 A kind of right management method, device, computer-readable recording medium and storage control
CN111698526A (en) * 2020-06-10 2020-09-22 中邮建技术有限公司 Method and system for realizing viewing of live video by scanning two-dimensional code

Similar Documents

Publication Publication Date Title
US11093631B2 (en) Data access authority management method, apparatus, terminal device and storage medium
US7251653B2 (en) Method and system for mapping between logical data and physical data
US7788305B2 (en) Hierarchy nodes derived based on parent/child foreign key and/or range values on parent node
US7650335B2 (en) High-level database management system
US6601071B1 (en) Method and system for business to business data interchange using XML
US7941785B2 (en) System and method for managing information objects
AU2011201360B2 (en) Systems and methods for creating a form for receiving data relating to a health care incident
KR100692330B1 (en) System and method for selectively defining accesss to application features
US20020019827A1 (en) Method and apparatus for managing documents in a centralized document repository system
US20090024652A1 (en) Object relational mapping layer
US8700560B2 (en) Populating a multi-relational enterprise social network with disparate source data
US20080071823A1 (en) System with user interface for efficiently checking availability statuses of, and selecting, muliple items such as domain names
US8180789B1 (en) Techniques for query generation, population, and management
US6886016B2 (en) Method and system for supporting multivalue attributes in a database system
US20090292711A1 (en) Constraints With Hidden Rows in a Database
US7617211B2 (en) System and method for automatically synchronizing security-relevant information between a relational database and a multidimensional database
JP2006085717A (en) Durable storage of .net data type and instance
KR100529661B1 (en) Object integrated management system
US7555486B2 (en) Data storage and retrieval system with optimized categorization of information items based on category selection
US20040210468A1 (en) System and method for providing a territory management tool
CN114090695A (en) Query optimization method and device for distributed database
JP2006524376A (en) Generic database schema
CN113721926A (en) Organization tree authority management method
KR101098181B1 (en) N- OLAP N- OLAP N+Q- N- A method and a system for analyzing data in an N-dimensional native OLAP cube and a method for converting an N+Q-dimensional custom query into an N-dimensional query for execution by an N-dimensional native OLAP cube
US9400814B2 (en) Hierarchy nodes derived based on parent/child foreign key and/or range values on parent node

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: Room 1308, 13th floor, East Tower, 33 Fuxing Road, Haidian District, Beijing 100036

Applicant after: China Telecom Digital Intelligence Technology Co.,Ltd.

Address before: Room 1308, 13th floor, East Tower, 33 Fuxing Road, Haidian District, Beijing 100036

Applicant before: CHINA TELECOM GROUP SYSTEM INTEGRATION Co.,Ltd.

CB02 Change of applicant information