Query method and device, computer equipment, storage medium and program product
By obtaining the queried object identification and query object information, determining the target query conditions, and directly determining the query results based on the query permissions, the problem of low query efficiency in traditional technology is solved, and a faster query process is achieved.
Patent Information
- Application Number
- CN202510074017.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-05-23
AI Technical Summary
In traditional technology, querying employee information is less efficient, and it is necessary to obtain candidate employee information from the database and filter information that meets query permissions.
By obtaining the query object identification and query object information, the target query conditions are determined, and the query results are directly determined based on the query object identification, the query permissions in the target query conditions and the target query condition identification.
It avoids obtaining query information from massive data with unqueried query permissions, shortens query time, and improves query efficiency.
Smart Images

Figure CN120030047A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a query method, apparatus, computer equipment, storage medium and program product. Background Art
[0002] With the development of computer technology, enterprises can store a large amount of enterprise employee information in a database. When a query operator queries the enterprise employee information in the database, it is necessary to determine the queried employee information based on the query authority of the query operator.
[0003] In traditional technology, the search engine uses the queried employee ID to obtain the candidate employee information corresponding to the queried employee ID from the database, and then filters out the queried employee information that meets the query authority of the query person from the candidate employee information, resulting in low information query efficiency. Summary of the invention
[0004] Based on this, it is necessary to provide a query method, apparatus, computer device, computer-readable storage medium and program product that can improve query efficiency in response to the above technical problems.
[0005] In a first aspect, the present application provides a query method. The method comprises:
[0006] Obtaining the queried object identifier and the query object information corresponding to the queried object identifier;
[0007] Determine target query conditions based on query object information;
[0008] Based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition, a query result corresponding to the queried object identifier is determined.
[0009] In one embodiment, determining a target query condition based on query object information includes:
[0010] Obtain candidate query conditions; the candidate query conditions include a query set;
[0011] A candidate query condition corresponding to a query set including at least one query object information is determined as a target query condition.
[0012] In one embodiment, based on the queried object identifier, the query authority in the target query condition, and the target query condition identifier of the target query condition, determining the query result corresponding to the queried object identifier includes:
[0013] Obtain the matching query condition identifier corresponding to the queried object identifier from the index table;
[0014] Determine the target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier;
[0015] Based on the queried object identifier and the target query authority, a query result corresponding to the queried object identifier is determined.
[0016] In one embodiment, determining the target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier includes:
[0017] When the query permissions corresponding to the target query condition identifiers are the same, the target query condition identifiers are compared with the matching query condition identifiers;
[0018] In the case that there is at least one matching query condition identifier that is identical to the target query condition identifier, the query permission corresponding to the target query condition identifier is determined as the target query permission.
[0019] In one embodiment, determining the target query permission corresponding to the queried object identifier by matching the query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier includes:
[0020] When the query permissions corresponding to the target query condition identifier are different, the target query condition identifier with the query permission being non-queryable is compared with the matching query condition identifier;
[0021] In the case where there is at least one matching query condition identifier that is the same as the target query condition identifier of the query permission being not queryable, determining not queryable as the first query permission;
[0022] Compare the target query condition identifier whose query permission is queryable with the matching query condition identifier;
[0023] In the case that there is at least one matching query condition identifier that is the same as the target query condition identifier of the query permission being queryable, determining queryable as the second query permission;
[0024] Based on the first query authority and the second query authority, a target query authority corresponding to the queried object identifier is determined.
[0025] In one embodiment, the process of generating the index table includes:
[0026] For each candidate object identifier, obtaining candidate object information corresponding to the candidate object identifier;
[0027] Determine a candidate query condition corresponding to a queried set including at least one candidate object information as a matching query condition; the candidate query condition includes the queried set;
[0028] An index table is generated based on each candidate object identifier and the matching query condition identifier of the matching query condition corresponding to the candidate object identifier.
[0029] In one embodiment, the update process of the index table includes:
[0030] Obtaining an update object identifier and update object information corresponding to the update object identifier;
[0031] Determine the candidate query condition corresponding to the queried set including at least one update object information as the update query condition;
[0032] The matching query condition identifier corresponding to the update object identifier in the index table is updated to the update query condition identifier of the update query condition, so as to obtain an updated index table.
[0033] In a second aspect, the present application also provides a query device. The device includes:
[0034] An acquisition module, used to acquire a queried object identifier and query object information corresponding to the queried object identifier;
[0035] A determination module, used to determine a target query condition based on query object information;
[0036] The query module is used to determine the query result corresponding to the queried object identifier based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition.
[0037] In a third aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods in the first aspect when executing the computer program.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any one of the methods in the first aspect when the computer program is executed by a processor.
[0039] In a fifth aspect, the present application also provides a program product, including a computer program, which implements the steps of any one of the methods in the first aspect when executed by a processor.
[0040] The above-mentioned query method, apparatus, computer equipment, storage medium and program product determine the target query condition through the query object information, and determine the query result corresponding to the queried object identifier based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition. Compared with first determining the queried object information corresponding to the queried object identifier and then screening the queried object information according to the query authority, the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition are directly used to determine the query result corresponding to the queried object identifier, thereby avoiding obtaining the queried object information that cannot be queried with the query authority from massive data, shortening the query time, and thus improving the query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 An application environment diagram of a query method in an embodiment;
[0042] Figure 2 A flowchart of a query method in an embodiment;
[0043] Figure 3 is a schematic diagram of a candidate query condition table in one embodiment;
[0044] Figure 4 A schematic diagram of a filtering condition table in one embodiment;
[0045] Figure 5 A schematic diagram of a query flow in an embodiment;
[0046] Figure 6 A schematic diagram of a process of Zhang San searching for Li Si in an embodiment;
[0047] Figure 7 is a schematic diagram of an index table in one embodiment;
[0048] Figure 8 A schematic diagram of a process for generating an index table in one embodiment;
[0049] Fig. 9 A schematic diagram of an update process of an index table in one embodiment;
[0050] Fig.10 is a structural block diagram of a query device in an embodiment;
[0051] Fig.11 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0053] The query method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Both the terminal and the server can be used alone to execute the query method provided in the embodiment of the present application. The terminal and the server can also be used in collaboration to execute the query method provided in the embodiment of the present application. For example, the terminal 102 obtains the query object identifier and the query object information corresponding to the query object identifier; based on the query object information, the target query condition is determined; based on the query object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition, the query result corresponding to the query object identifier is determined. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0054] In one embodiment, Figure 2 As shown, a query method is provided. This embodiment takes the method applied to a computer device as an example for description, and includes steps 202 to 206:
[0055] Step 202, the step is to obtain the queried object identifier and the query object information corresponding to the queried object identifier.
[0056] The queried object identifier refers to an identifier that represents the queried object, and the queried object refers to the queried person, and the queried object may be an employee in an enterprise. The queried object identifier may be the queried object name, or the queried object number, etc. The queried object number refers to a unique string that represents the queried object, for example, the queried object identifier is Zhang San, or the queried object identifier is the queried object's employee number or the queried object's ID number. The queried object information refers to relevant information about the queried object, and the queried object refers to the queried person. The queried object information includes but is not limited to at least one of the queried object identifier, the queried object position, the queried object's department, and the queried object's age, etc., and the number of queried object information may be one or more.
[0057] Exemplarily, the computer device obtains the query object identifier in the query instruction and the query object identifier of the input query instruction, and obtains the query object information based on the query object identifier. The query object identifier refers to an identifier representing the query object, and the query object identifier can be the query object name or the login account of the query object.
[0058] In one embodiment, the computer device obtains a query keyword in a query instruction and a query object identifier input into the query instruction, and determines a query object identifier corresponding to the query keyword. The query keyword refers to a word representing the query object, and the query keyword may be a department name or a position, etc. The query keyword corresponds to at least one query object identifier.
[0059] In one embodiment, the query object inputs the queried object identifier, the computer device obtains the queried object identifier and the query object identifier of the query object, and the organizational structure system obtains the query object information corresponding to the query object identifier. The organizational structure system obtains the query object information corresponding to the query object identifier from the database, and the database stores the candidate object identifiers and the candidate object information corresponding to the candidate object identifiers. The relationship between the candidate object identifiers can be a tree structure, which can be understood as that all enterprise employee identifiers and the enterprise employee information corresponding to the enterprise employee identifiers in the enterprise are stored in the database, and the enterprise employee identifiers can be stored using a tree-shaped organizational structure.
[0060] Step 204: determine the target query condition based on the query object information.
[0061] Among them, the target query condition refers to the query condition corresponding to the query object information in the candidate query condition, and the target query condition includes but is not limited to the query set, query authority and the queried set, that is, one target query condition consists of at least three parts, such as the query set, query authority and the queried set. The number of target query conditions can be one or more. The candidate query condition is a pre-set query condition, and the number of candidate query conditions is multiple. The candidate query conditions include but are not limited to the query set, query authority and the queried set, etc. The query set refers to a set composed of query object characteristics, and the query object characteristics can be composed of at least one of the identifier of the query object, the department of the query object, the role of the query object and the position of the query object; the query authority refers to the query authority, that is, the query personnel who meet at least one query object characteristic in the query set, and the query authority for the query personnel who meet at least one query object characteristic in the queried set, and the query authority can be one of queryable and non-queryable; the query set refers to a set composed of query object characteristics, and the query object characteristics can be composed of at least one of the identifier of the query object, the department of the query object, the role of the query object and the position of the query object.
[0062] For example, the candidate query condition table is as follows Figure 3 As shown, there are three candidate query conditions, namely candidate query condition 1, candidate query condition 2 and candidate query condition 3. The candidate query condition identifier of candidate query condition 1 is rule_1, the candidate query condition identifier of candidate query condition 2 is rule_2, and the candidate query condition identifier of candidate query condition 3 is rule_3. The query set of candidate query condition 1 is Zhang San, the query authority is not queryable, and the queried set is Li Si and department 3. Candidate query condition 1 represents that Zhang San cannot query the information of all personnel of Li Si and department 3; the query set of candidate query condition 2 is Li Si, the query authority is not queryable, and the queried set is Zhang San and department 3; the query set of candidate query condition 3 is Zhang San and department 4, the query authority is not queryable, and the queried set is Wang Wu and department 2. Candidate query condition 3 represents that Zhang San and all personnel of department 4 cannot query the information of Wang Wu and all personnel of department 2.
[0063] Exemplarily, the computer device determines a candidate query condition including at least one query object information in the query set as a target query condition.
[0064] In one embodiment, after the organizational structure system obtains the query object information corresponding to the query object identifier, it determines the candidate query condition including at least one query object information in the query set as the target query condition.
[0065] Step 206: Determine the query result corresponding to the queried object identifier based on the queried object identifier, the query authority in the target query condition, and the target query condition identifier of the target query condition.
[0066] The target query condition identifier refers to an identifier that represents the target query condition. The query result refers to the result of the query, which may be empty or the queried object information of the queried object identifier. The queried object information refers to information related to the queried object, and the queried object information may include but is not limited to at least one of the queried object identifier, the queried object position, the queried object department, and the queried object age.
[0067] Exemplarily, the computer device determines the target query permission corresponding to the queried object identifier based on the queried object identifier, the query permission in the target query condition and the target query condition identifier of the target query condition, and determines the query result corresponding to the queried object identifier based on the queried object identifier and the target query permission.
[0068] In one embodiment, based on the queried object identifier and the target query authority, determining the query result corresponding to the queried object identifier includes: when the target query authority is not queryable, determining that the query result corresponding to the queried object identifier is empty, that is, the query object information corresponding to the query object identifier is not returned.
[0069] In one embodiment, after the organizational structure system determines the target query condition, it generates a filtering condition based on the queried object identifier, the query authority in the target query condition, and the target query condition identifier of the target query condition, and sends the filtering condition to the search engine; the search engine determines the target query authority corresponding to the queried object identifier based on the filtering condition, determines the response result based on the target query authority, and sends the response result to the organizational structure system; the organizational structure system determines the query result corresponding to the queried object identifier based on the response result, and feeds the query result back to the query object. A search engine is a tool that processes a large amount of Internet or local data through program automation, and is used to quickly retrieve and return information related to user queries. The search engine can be ElasticSearch, which is an open source distributed search and data analysis engine that is widely used in full-text search, log analysis, real-time data retrieval and other scenarios.
[0070] The filtering condition refers to the condition used to determine the target query authority of the queried object identifier. The filtering condition is a language description that the search engine can understand. The filtering condition is generated according to the query object identifier, the query authority in the target query condition, and the target query condition identifier of the target query condition. For example, the filtering condition table is as follows: Figure 4 As shown, four filtering conditions are included, the query object identifier is Zhang San, the target query rule identifier is {rule_1, rule_3}, which indicates that the query object information of Zhang San is included in the query sets of rule_1 and rule_3, that is, the target query rule identifiers of the target query rule determined according to the query object information corresponding to Zhang San are rule_1 and rule_3, the keyword in the filtering condition keyword AND NOTbelongRuleIds:{rule_1,rule_3} is the queried object identifier, NOT belongRuleIds:{rule_1,rule_3} indicates that the target query rule identifiers determined according to Zhang San are rule_1 and rule_3, and the query permissions in rule_1 and rule_3 are both non-queryable, that is, the queried object identifier keyword, the target query condition identifiers rule_1 and rule_3 of the target query condition, and the non-queryable query permissions in rule_1 and rule_3 are converted into the filtering condition keyword AND NOT belongRuleIds:{rule_1,rule_3}.
[0071] The response result refers to the result determined by the search engine based on the filtering conditions and sent to the organizational structure system. The response result can be empty or one of the queried object identifiers. It can be understood that if the search engine determines that the target query permission of the queried object identifier is not queryable based on the filtering conditions, the search engine will not return the queried object identifier, that is, the returned result is empty; if the search engine determines that the target query permission of the queried object identifier is queryable based on the filtering conditions, the search engine returns the queried object identifier, that is, the returned result is the queried object identifier.
[0072] In one embodiment, the query flow diagram is as follows: Figure 5 As shown, it includes: the query object inputs the queried object identifier, the organizational structure system obtains the query object information corresponding to the query object identifier, determines the candidate query conditions including at least one query object information in the query set as the target query conditions, generates filtering conditions based on the queried object identifier, the query authority in the target query conditions and the target query condition identifier of the target query conditions, and sends the filtering conditions to the search engine; the search engine determines the target query authority corresponding to the queried object identifier based on the filtering conditions, determines the response result based on the target query authority, and sends the response result to the organizational structure system; the organizational structure system determines the query result corresponding to the queried object identifier based on the response result, and feeds the query result back to the query object.
[0073] For example, the flowchart of Zhang San searching for Li Si is as follows Figure 6 As shown, the query object Zhang San inputs the queried object identifier Li Si, the organizational structure system obtains the query object information Zhang San and Zhang San's department corresponding to the query object identifier Zhang San, determines the candidate query conditions including at least one query object information in Zhang San and Zhang San's department in the query set as the target query condition, generates a filtering condition based on the queried object identifier Li Si, the query authority in the target query condition and the target query condition identifier of the target query condition, and sends the filtering condition to the search engine; the search engine determines that the target query authority corresponding to the queried object identifier is not queryable based on the filtering condition, determines that the response result is empty based on the target query authority, and sends the empty response result to the organizational structure system; the organizational structure system determines that the query result corresponding to the queried object identifier is empty based on the empty response result, that is, the queried object information of Li Si cannot be searched, and feeds the empty query result back to the query object.
[0074] In the above query method, the target query condition is determined by the query object information, and the query result corresponding to the queried object identifier is determined based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition. Compared with first determining the queried object information corresponding to the queried object identifier and then filtering the queried object information according to the query authority, the query result corresponding to the queried object identifier is determined directly using the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition, thereby avoiding obtaining the queried object information that cannot be queried with the query authority from massive data, shortening the query time, and thus improving the query efficiency.
[0075] In one embodiment, determining a target query condition based on query object information includes:
[0076] Acquire candidate query conditions; the candidate query conditions include a query set; determine the candidate query conditions corresponding to the query set including at least one query object information as the target query condition.
[0077] Exemplarily, a computer device obtains candidate query conditions, and for each candidate query condition, compares query object features included in a query set in the candidate query condition with query object information; if at least one query object feature is identical to at least one query object information, the candidate query condition is determined as a target query condition.
[0078] In this embodiment, the query set in the candidate query condition includes query object features. If the query object information is the same as the query object features included in the query set, it means that the candidate query condition is applicable to this query. The candidate query condition is then determined as the target query condition, providing accurate basic data for subsequent query determination.
[0079] In one embodiment, based on the queried object identifier, the query authority in the target query condition, and the target query condition identifier of the target query condition, determining the query result corresponding to the queried object identifier includes:
[0080] Obtain a matching query condition identifier corresponding to the queried object identifier from the index table; determine a target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier; determine a query result corresponding to the queried object identifier based on the queried object identifier and the target query permission.
[0081] The index table refers to a table that records the correspondence between the queried object identifier and the matching query condition identifier. The index table includes but is not limited to the correspondence between the queried object identifier and the matching query condition identifier. For example, Figure 7The index table shown includes the queried object number, the queried object identifier, the matching query condition identifier corresponding to the queried object identifier, and the description. The index table is generated based on the candidate object identifier, the queried set in the candidate query condition, and the candidate query condition identifier of the candidate query condition. The target query authority refers to the query authority of the query object to the queried object, that is, the authority that characterizes whether the query object can query the queried object. The query authority corresponding to the target query condition identifier refers to the query authority included in the target query condition corresponding to the target query condition identifier.
[0082] Exemplarily, a computer device obtains an index table, obtains a matching query condition identifier corresponding to the queried object identifier from the index table, determines a target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier, and determines a query result corresponding to the queried object identifier based on the queried object identifier and the target query permission.
[0083] In one embodiment, based on the queried object identifier and the target query permission, the query result corresponding to the queried object identifier is determined, including: when the target query permission is not queryable, determining that the query result corresponding to the queried object identifier is empty; when the target query permission is queryable, determining that the query result corresponding to the queried object identifier is the queried object information corresponding to the queried object identifier.
[0084] In this embodiment, the query condition identifier, the target query condition identifier and the target query permission corresponding to the query permission of the queried object identifier are matched, and then the query result corresponding to the queried object identifier is determined based on the queried object identifier and the target query permission. That is, the target query permission of the queried object identifier is first determined, and then it is determined whether it is necessary to determine the queried object information corresponding to the queried object identifier from the massive data according to the target query permission. Compared with first determining the queried object information corresponding to the queried object identifier and then screening the queried object information according to the query permission, this scheme determines the query result corresponding to the queried object identifier based on the queried object identifier and the target query permission, avoids obtaining the queried object information that cannot be queried for the query permission from the massive data, shortens the query time, and thus improves the query efficiency.
[0085] In one embodiment, determining the target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier includes:
[0086] When the query permissions corresponding to the target query condition identifiers are the same, the target query condition identifier is compared with the matching query condition identifier; when there is at least one matching query condition identifier that is the same as the target query condition identifier, the query permission corresponding to the target query condition identifier is determined as the target query permission.
[0087] The query permissions corresponding to the target query condition identifiers are all the same, which means that the query permissions in the target query conditions corresponding to the multiple target query condition identifiers are all queryable or all non-queryable.
[0088] Exemplarily, when the query permissions corresponding to the target query condition identifiers are the same, the computer device compares the target query condition identifier with the matching query condition identifier. If there is at least one matching query condition identifier that is the same as the target query condition identifier, the query permission corresponding to the target query condition identifier is determined as the target query permission; if there is no matching query condition identifier that is the same as the target query condition identifier, the query permission corresponding to the target query condition identifier is determined as unqueryable.
[0089] In this embodiment, the query permissions corresponding to the target query condition identifiers are all the same, and there is at least one matching query condition identifier that is the same as the target query condition identifier, indicating that the target query permission of the query object identifier for the queried object identifier is the same as the query permission in the target query condition. Then, the query permission corresponding to the target query condition identifier is determined as the target query permission, providing accurate basic data for subsequent determination of the query results.
[0090] In one embodiment, determining the target query permission corresponding to the queried object identifier by matching the query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier includes:
[0091] When the query permissions corresponding to the target query condition identifier are different, the target query condition identifier with the query permission of non-query is compared with the matching query condition identifier; when there is at least one matching query condition identifier that is the same as the target query condition identifier with the query permission of non-query, non-query is determined as the first query permission; the target query condition identifier with the query permission of query is compared with the matching query condition identifier; when there is at least one matching query condition identifier that is the same as the target query condition identifier with the query permission of query, query is determined as the second query permission; based on the first query permission and the second query permission, the target query permission corresponding to the queried object identifier is determined.
[0092] The first query permission refers to the query permission corresponding to the queried object identifier, which is determined based on the target query condition identifier and the matching query condition identifier for which the query permission is not queryable. The first query permission may be not queryable or empty. The second query permission refers to the query permission corresponding to the queried object identifier, which is determined based on the target query condition identifier and the matching query condition identifier for which the query permission is queryable. The second query permission may be queryable or empty.
[0093] Exemplarily, when the query permissions corresponding to the target query condition identifier are different, the computer device compares the target query condition identifier with the query permission being non-queryable with the matching query condition identifier, and when there is at least one matching query condition identifier that is the same as the target query condition identifier with the query permission being non-queryable, determines non-queryable as the first query permission; compares the target query condition identifier with the query permission being queryable with the matching query condition identifier, and when there is at least one matching query condition identifier that is the same as the target query condition identifier with the query permission being queryable, determines queryable as the second query permission; and determines the target query permission corresponding to the queried object identifier based on the first query permission and the second query permission.
[0094] In one embodiment, based on the first query permission and the second query permission, the target query permission corresponding to the queried object identifier is determined, including: based on the first query permission, the second query permission and the query permission priority, the target query permission corresponding to the queried object identifier is determined. Wherein, the query permission priority refers to the query permission with a higher degree of importance when both queryable and non-queryable appear at the same time, for example, if the query permission priority is queryable higher than non-queryable, then when the first query permission is non-queryable and the second query permission is queryable, the target query permission is queryable, or if the query permission priority is non-queryable higher than queryable, then when the first query permission is non-queryable and the second query permission is queryable, the target query permission is non-queryable.
[0095] In one embodiment, when the query permissions corresponding to the target query condition identifier are different, the target query condition identifier with query permission being non-queryable is compared with the matching query condition identifier, and when there is no matching query condition identifier that is the same as the target query condition identifier with query permission being non-queryable, the first query permission is determined to be empty; the target query condition identifier with query permission being queryable is compared with the matching query condition identifier, and when there is at least one matching query condition identifier that is the same as the target query condition identifier with query permission being queryable, the second query permission is determined to be queryable; based on the first query permission and the second query permission, the target query permission corresponding to the queried object identifier is determined to be queryable. That is, only when there is a target query condition identifier with query permission being queryable that is the same as the matching query condition identifier, it is characterized that the target query permission corresponding to the queried object identifier for the query object identifier is queryable.
[0096] In one embodiment, when the query permissions corresponding to the target query condition identifiers are different, the target query condition identifier with query permissions that are not queryable is compared with the matching query condition identifier, and when there is at least one matching query condition identifier that is the same as the target query condition identifier with query permissions that are not queryable, the first query permission is determined to be not queryable; the target query condition identifier with query permissions that are queryable is compared with the matching query condition identifier, and when there is no matching query condition identifier that is the same as the target query condition identifier with query permissions that are queryable, the second query permission is determined to be empty; based on the first query permission and the second query permission, it is determined that the target query permission corresponding to the queried object identifier is not queryable. That is, only the target query condition identifier with query permissions that are not queryable is the same as the matching query condition identifier, which indicates that the query object identifier has a target query permission that is not queryable for the queried object identifier.
[0097] In one embodiment, when the query permissions corresponding to the target query condition identifier are different, the target query condition identifier with query permission that is not queryable is compared with the matching query condition identifier, and when there is no matching query condition identifier that is the same as the target query condition identifier with query permission that is not queryable, the first query permission is determined to be empty; the target query condition identifier with query permission that is queryable is compared with the matching query condition identifier, and when there is no matching query condition identifier that is the same as the target query condition identifier with query permission that is queryable, the second query permission is determined to be empty; based on the first query permission and the second query permission, it is determined that the target query permission corresponding to the queried object identifier is not queryable. That is, there is no target query condition identifier with query permission that is not queryable that is the same as the matching query condition identifier, and there is no target query condition identifier with query permission that is the same as the matching query condition identifier, which indicates that the target query permission corresponding to the query object identifier for the queried object identifier is not queryable.
[0098] In this embodiment, when the query permissions corresponding to the target query condition identifier are different, the first query permission is determined based on the target query condition identifier whose query permission is not queryable and the matching query condition identifier, and the second query permission is determined based on the target query condition identifier whose query permission is queryable and the matching query condition identifier. Then, the target query permission corresponding to the queried object identifier is determined based on the first query permission and the second query permission, so as to provide accurate basic data for the subsequent determination of the query results.
[0099] In one embodiment, the process of generating the index table includes:
[0100] For each candidate object identifier, the candidate object information corresponding to the candidate object identifier is obtained; the candidate query condition corresponding to the queried set including at least one candidate object information is determined as the matching query condition; the candidate query condition includes the queried set; based on the matching query condition identifiers of the matching query conditions corresponding to the candidate object identifiers and the candidate object identifiers, an index table is generated.
[0101] Among them, the candidate object identifier refers to the identifier that represents the candidate object, and the candidate object refers to a member. For example, the query object is an employee of an enterprise. An enterprise includes multiple employees, and each employee is a candidate object. The index table includes all candidate object identifiers, that is, the index table includes all employee identifiers, and the database stores the candidate object information corresponding to all candidate object identifiers, that is, the database stores the employee information of all employees. Candidate object information refers to information related to the candidate object, and the candidate object information includes but is not limited to at least one of the candidate object identifier, the candidate object position, the candidate object department, and the candidate object age.
[0102] Exemplarily, the computer device obtains, for each candidate object identifier, the candidate object information corresponding to the candidate object identifier, and for each candidate query condition, compares the queried features included in the queried set in the candidate query condition with the candidate object information; if there is at least one candidate object information that is identical to the queried feature, the candidate query condition is determined as a matching query condition; after determining the matching query condition corresponding to the candidate object identifier, a corresponding relationship is established between the candidate object identifier and the matching query condition identifier of the matching query condition corresponding to the candidate object identifier; and an index table is generated based on the corresponding relationship between each candidate object identifier and the matching query condition identifier.
[0103] For example, the generation process diagram of the index table is as follows: Figure 8As shown, the administrator sets the candidate query condition to "Zhang San" and cannot query "Li Si and Department A". The organizational structure system saves the candidate query condition to the database, and obtains the candidate object information of the candidate object identifier Li Si and the candidate object information of each candidate object identifier in Department A from the database; for each candidate object identifier, the queried features included in the queried set in each candidate query condition are compared with the candidate object information, and if there is at least one candidate object information that is the same as the queried feature, the candidate query condition is determined as a matching query condition; after determining the matching query condition corresponding to the candidate object identifier, the organizational structure system saves the corresponding relationship between the candidate object identifier and the matching query condition identifier to the index table in the search engine, and the organizational structure system feedbacks the successful setting to the administrator.
[0104] In this embodiment, the matching query condition corresponding to the candidate object identifier is determined through the candidate object information corresponding to the candidate object identifier, and an index table is generated according to each candidate object identifier and the matching query condition identifier corresponding to the candidate object identifier, providing basic data for the subsequent determination of the matching query condition identifier corresponding to the queried object identifier.
[0105] In one embodiment, the update process of the index table includes:
[0106] Obtain an update object identifier and update object information corresponding to the update object identifier; determine a candidate query condition corresponding to a queried set including at least one update object information as an update query condition; update a matching query condition identifier corresponding to the update object identifier in the index table to an update query condition identifier of the update query condition, and obtain an updated index table.
[0107] The update object identifier refers to an identifier of a candidate object representing an update of object information.
[0108] Exemplarily, a computer device obtains an update object identifier and update object information corresponding to the update object identifier, and for each candidate query condition, compares the queried features included in the queried set in the candidate query condition with the update object information; if there is at least one queried feature that is the same as the update object information, the candidate query condition is determined to be the update query condition corresponding to the update object identifier; after determining the update query condition corresponding to the update object identifier, the matching query condition identifier corresponding to the update object identifier in the index table is updated to the update query condition identifier of the update query condition, thereby obtaining an updated index table.
[0109] For example, the update process diagram of the index table is as follows Fig. 9As shown, the administrator transfers department A from the superior department P1 to the superior department P2, and the organizational structure system obtains all update object identifiers included in department A and the update object information corresponding to the update object identifier from the database. For each update object identifier, the queried features included in the queried set in each candidate query condition are compared with the update object information. If there is at least one queried feature that is the same as the update object information, the candidate query condition is determined as the update query condition corresponding to the update object identifier; after determining the update query condition corresponding to the update object identifier, the matching query condition identifier corresponding to the update object identifier in the index table of the search engine is updated to the update query condition identifier of the update query condition, and an updated index table is obtained; the organizational structure system feedbacks the completion of the update to the administrator.
[0110] In this embodiment, when the candidate object information of the candidate object identifier is changed, the update query condition is determined by updating the update object information corresponding to the update object identifier, and the matching query condition identifier corresponding to the updated object identifier in the index table is updated to the updated query condition identifier of the update query condition, so as to obtain an updated index table, thereby improving the accuracy of the index table and providing accurate basic data for the subsequent determination of the matching query condition identifier corresponding to the queried object identifier.
[0111] In an exemplary embodiment, the query method includes:
[0112] The process of generating an index table. The administrator sets multiple candidate query conditions. For each candidate object identifier, the organizational structure system obtains the candidate object information of the candidate object identifier from the database; for each candidate object identifier, the queried features included in the queried set in each candidate query condition are compared with the candidate object information. If there is at least one candidate object information that is the same as the queried feature, the candidate query condition is determined as a matching query condition; after determining the matching query condition corresponding to the candidate object identifier, the organizational structure system saves the correspondence between the candidate object identifier and the matching query condition identifier into the index table in the search engine to generate an index table. The organizational structure system provides feedback to the administrator that the setting is successful.
[0113] Query process. The query object inputs the queried object identifier, the computer device obtains the queried object identifier and the query object identifier of the query object, the organizational structure system obtains the query object information corresponding to the query object identifier, and for each candidate query condition, compares the query object features included in the query set in the candidate query condition with the query object information. If there is at least one query object feature that is the same as at least one query object information, the candidate query condition is determined as the target query condition. After the organizational structure system determines the target query condition, it generates a filter condition based on the queried object identifier, the query authority in the target query condition, and the target query condition identifier of the target query condition, and sends the filter condition to the search engine.
[0114] The search engine determines the target query authority corresponding to the queried object identifier based on the filtering condition, determines the response result based on the target query authority, and sends the response result to the organizational structure system. The search engine determines the target query authority corresponding to the queried object identifier based on the filtering condition, and determines the response result based on the target query authority, including: when the query authorities corresponding to the target query condition identifiers are the same, the search engine compares the target query condition identifier with the matching query condition identifier, and if there is at least one matching query condition identifier that is the same as the target query condition identifier, the query authority corresponding to the target query condition identifier is determined as the target query authority; if there is no matching query condition identifier that is the same as the target query condition identifier, the query authority corresponding to the target query condition identifier is determined as unqueryable. Alternatively, when the query authorities corresponding to the target query condition identifiers are different, the search engine compares the target query condition identifier with the matching query condition identifier as the query authority that is unqueryable, obtains a first comparison result, and determines it as the first query authority according to the first comparison result; compares the target query condition identifier with the matching query condition identifier as the query authority that is queryable, obtains a second comparison result, and determines the second query authority according to the second comparison result; determines the target query authority corresponding to the queried object identifier based on the first query authority and the second query authority. When the target query permission is queryable, the response result is the queried object identifier. When the target query result is not queryable, the response result is empty.
[0115] Based on the response result, the organizational structure system determines the query result corresponding to the queried object identifier, that is, when the response result is empty, the query result is empty; when the response result is the queried object identifier, the query result is the queried object information corresponding to the queried object identifier, and the organizational structure system feeds back the query result to the query object.
[0116] The updating process of the index table. The administrator updates the candidate object information of the candidate object identifier, and the organizational structure system obtains the update object identifier and the update object information corresponding to the update object identifier from the database. For each update object identifier, the queried features included in the queried set in each candidate query condition are compared with the update object information. If there is at least one queried feature that is the same as the update object information, the candidate query condition is determined as the update query condition corresponding to the update object identifier; after determining the update query condition corresponding to the update object identifier, the matching query condition identifier corresponding to the update object identifier in the index table of the search engine is updated to the update query condition identifier of the update query condition, and an updated index table is obtained; the organizational structure system feedbacks the end of the update to the administrator.
[0117] In the above query method, the target query condition is determined by the query object information, and the query result corresponding to the queried object identifier is determined based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition. Compared with first determining the queried object information corresponding to the queried object identifier and then filtering the queried object information according to the query authority, the query result corresponding to the queried object identifier is determined directly using the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition, thereby avoiding obtaining the queried object information that cannot be queried with the query authority from massive data, shortening the query time, and thus improving the query efficiency.
[0118] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0119] Based on the same inventive concept, the embodiment of the present application also provides a query device for implementing the query method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more query device embodiments provided below can refer to the limitations on the query method above, and will not be repeated here.
[0120] In one embodiment, Fig.10As shown, a query device is provided, including: an acquisition module 1002, a determination module 1004 and a query module 1006, wherein:
[0121] An acquisition module 1002 is used to acquire a queried object identifier and query object information corresponding to the queried object identifier;
[0122] A determination module 1004 is used to determine a target query condition based on the query object information;
[0123] The query module 1006 is used to determine the query result corresponding to the queried object identifier based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition.
[0124] In one embodiment, the determination module 1004 is further used to: obtain candidate query conditions; the candidate query conditions include a query set; and determine the candidate query conditions corresponding to the query set including at least one query object information as the target query condition.
[0125] In one embodiment, the query module 1006 is also used to: obtain the matching query condition identifier corresponding to the queried object identifier from the index table; determine the target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier and the query permission corresponding to the target query condition identifier; determine the query result corresponding to the queried object identifier based on the queried object identifier and the target query permission.
[0126] In one embodiment, the query module 1006 is also used to: when the query permissions corresponding to the target query condition identifiers are the same, compare the target query condition identifier with the matching query condition identifier; when there is at least one matching query condition identifier that is the same as the target query condition identifier, determine the query permission corresponding to the target query condition identifier as the target query permission.
[0127] In one embodiment, the query module 1006 is also used for: when the query permissions corresponding to the target query condition identifier are different, comparing the target query condition identifier with the query permission being non-queryable with the matching query condition identifier; when there is at least one matching query condition identifier that is the same as the target query condition identifier with the query permission being non-queryable, determining non-queryable as the first query permission; comparing the target query condition identifier with the query permission being queryable with the matching query condition identifier; when there is at least one matching query condition identifier that is the same as the target query condition identifier with the query permission being queryable, determining queryable as the second query permission; based on the first query permission and the second query permission, determining the target query permission corresponding to the queried object identifier.
[0128] In one embodiment, the query device also includes a generation module, which is used to: for each candidate object identifier, obtain candidate object information corresponding to the candidate object identifier; determine the candidate query condition corresponding to the queried set including at least one candidate object information as a matching query condition; the candidate query condition includes the queried set; and generate an index table based on the matching query condition identifier of each candidate object identifier and the matching query condition corresponding to the candidate object identifier.
[0129] In one embodiment, the generation module is also used to: obtain an update object identifier and update object information corresponding to the update object identifier; determine a candidate query condition corresponding to a queried set including at least one update object information as an update query condition; update the matching query condition identifier corresponding to the update object identifier in the index table to the update query condition identifier of the update query condition, and obtain an updated index table.
[0130] Each module in the query device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0131] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.11 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a query method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0132] Those skilled in the art will understand that Fig.11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0133] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0134] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0135] In one embodiment, a program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0138] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0139] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A query method, characterized in that: The method comprises: Obtaining a queried object identifier and query object information corresponding to the queried object identifier; Determining a target query condition based on the query object information; Based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition, a query result corresponding to the queried object identifier is determined.
2. The method according to claim 1, characterized in that The determining of a target query condition based on the query object information includes: Obtaining candidate query conditions; the candidate query conditions include a query set; A candidate query condition corresponding to a query set including at least one of the query object information is determined as a target query condition.
3. The method according to claim 1, characterized in that The determining, based on the queried object identifier, the query authority in the target query condition, and the target query condition identifier of the target query condition, a query result corresponding to the queried object identifier includes: Obtaining a matching query condition identifier corresponding to the queried object identifier from the index table; Determine the target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier; Based on the queried object identifier and the target query authority, a query result corresponding to the queried object identifier is determined.
4. The method according to claim 3, characterized in that The determining the target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier, and the query permission corresponding to the target query condition identifier includes: When the query permissions corresponding to the target query condition identifiers are the same, comparing the target query condition identifier with the matching query condition identifier; In the case that there is at least one matching query condition identifier that is identical to the target query condition identifier, the query permission corresponding to the target query condition identifier is determined as the target query permission.
5. The method according to claim 3, characterized in that: The determining the target query permission corresponding to the queried object identifier based on the matching query condition identifier, the target query condition identifier and the query permission corresponding to the target query condition identifier comprises: In the case where the query permissions corresponding to the target query condition identifiers are different, comparing the target query condition identifier with a query permission of not being able to be queried with the matching query condition identifier; In the case that there is at least one matching query condition identifier that is the same as the target query condition identifier of the query permission being not queryable, determining the not queryable as the first query permission; Compare the target query condition identifier for which the query permission is queryable with the matching query condition identifier; In the case that there is at least one matching query condition identifier that is the same as the target query condition identifier of the query permission being queryable, determining the queryable as the second query permission; Based on the first query authority and the second query authority, a target query authority corresponding to the queried object identifier is determined.
6. The method according to claim 3, characterized in that The generation process of the index table includes: For each candidate object identifier, obtaining candidate object information corresponding to the candidate object identifier; Determining a candidate query condition corresponding to a queried set including at least one of the candidate object information as a matching query condition; wherein the candidate query condition includes the queried set; An index table is generated based on each of the candidate object identifiers and the matching query condition identifiers of the matching query conditions corresponding to the candidate object identifiers.
7. The method according to claim 3, characterized in that The updating process of the index table includes: Obtaining an update object identifier and update object information corresponding to the update object identifier; Determine the candidate query condition corresponding to the queried set including at least one update object information as the update query condition; The matching query condition identifier corresponding to the update object identifier in the index table is updated to the update query condition identifier of the update query condition, so as to obtain an updated index table.
8. A query device, characterized in that: The device comprises: An acquisition module, used to acquire a queried object identifier and query object information corresponding to the queried object identifier; A determination module, used to determine a target query condition based on the query object information; The query module is used to determine the query result corresponding to the queried object identifier based on the queried object identifier, the query authority in the target query condition and the target query condition identifier of the target query condition.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.