CN112541009B - Data query method, device, electronic equipment and storage medium - Google Patents

Data query method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112541009B
CN112541009B CN202011545709.1A CN202011545709A CN112541009B CN 112541009 B CN112541009 B CN 112541009B CN 202011545709 A CN202011545709 A CN 202011545709A CN 112541009 B CN112541009 B CN 112541009B
Authority
CN
China
Prior art keywords
query
determining
data
acquiring
target
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.)
Active
Application number
CN202011545709.1A
Other languages
Chinese (zh)
Other versions
CN112541009A (en
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.)
Hubei Central China Technology Development Of Electric Power Co ltd
Original Assignee
Hubei Central China Technology Development Of Electric Power 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 Hubei Central China Technology Development Of Electric Power Co ltd filed Critical Hubei Central China Technology Development Of Electric Power Co ltd
Priority to CN202011545709.1A priority Critical patent/CN112541009B/en
Publication of CN112541009A publication Critical patent/CN112541009A/en
Application granted granted Critical
Publication of CN112541009B publication Critical patent/CN112541009B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/245Query processing
    • G06F16/2455Query execution
    • 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/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • 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/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to data processing and provides a data query method, a data query device, electronic equipment and a storage medium. The method can determine a query user sending out a data query request, determine a user role of the query user, determine a query scene corresponding to the user role, determine a query interface according to the query scene, analyze the data query request by utilizing the query interface to obtain an analysis routing rule, obtain a monitoring log of the target service system by analyzing the analysis routing rule, analyze the monitoring log, determine a target database with the least occupied resources in the target service system, and query the target database by utilizing the query condition to obtain a query result. The invention not only can improve the data security, but also can improve the data query efficiency. Furthermore, the present invention relates to blockchain techniques, and the query results may be stored in a blockchain.

Description

Data query method, device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data query method, a data query device, an electronic device, and a storage medium.
Background
With the rapid development of services, under the background of multiple services, users with multiple roles such as operators, managers, supervisory personnel all have the requirement of inquiring service data in real time, and these requirements often include the bottom data of multiple service systems under each service line. At present, a query user performs data query through various query functions on the comprehensive query platform, however, query contents of users with different roles are basically consistent, an IT supervision department on the comprehensive query platform cannot perceive a query scene of the query user, and then the same data fields are exposed to the query users with different roles, so that leakage of query data is caused, and potential safety hazards are caused.
In addition, when data query is performed, each service system on the comprehensive query platform needs to be traversed one by one according to query information, so that query service redundancy is caused, and query service performance is reduced.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a data query method, apparatus, electronic device, and storage medium, which are capable of not only avoiding data leakage, thereby improving data security, but also improving data query efficiency, thereby improving query service performance.
In one aspect, the present invention provides a data query method, where the data query method includes:
when a data query request is received, determining a query user which sends the data query request, and determining a user role of the query user;
determining a query scene corresponding to the user role, and determining a query interface according to the query scene;
analyzing the data query request by utilizing the query interface to obtain an analysis routing rule, wherein the analysis routing rule comprises a target service system and query conditions;
acquiring a monitoring log of the target service system;
analyzing the monitoring log to determine a target database with the least occupied resources in the target service system;
and querying the target database by using the query condition to obtain a query result.
According to a preferred embodiment of the present invention, the determining the querying user that issued the data querying request includes:
acquiring a source address of the data query request;
determining a source terminal of the data query request according to the source address;
acquiring an operation log of the source terminal, and acquiring the receiving time of the data query request;
Extracting a target log list nearest to the receiving time from the operation log;
extracting a user identification code recorded in the target log list;
and determining the inquiring user according to the user identification code.
According to a preferred embodiment of the present invention, the determining the user role of the querying user includes:
extracting a use account number of the inquiring user from the target log list;
traversing account numbers in a configuration character table, wherein the configuration character table stores the mapping relation between each character and a plurality of account numbers;
matching the traversed account with the use account, and determining the account successfully matched with the use account as a target account;
and acquiring a role corresponding to the target account number from the configuration role table as the user role.
According to a preferred embodiment of the present invention, the analyzing the data query request by using the query interface obtains an analysis routing rule, where the analysis routing rule includes a target service system and query conditions include:
determining an parsing tool on the query interface;
analyzing the data query request by using the analysis tool to obtain data information carried by the data query request;
Acquiring a condition label from a configuration label table, wherein the condition label is used for indicating a condition;
extracting information corresponding to the condition label from the data information as the query condition;
extracting query entities in the query conditions, and acquiring all data source systems connected with the query interface;
and determining a system corresponding to the query entity from the data source system as the target service system.
According to a preferred embodiment of the present invention, the obtaining the monitoring log of the target service system includes:
acquiring a path table of the query interface and acquiring a system identifier of the target service system;
determining a log storage path of the target service system from the path table according to the system identifier;
and acquiring the monitoring log from the log storage path.
According to a preferred embodiment of the present invention, the analyzing the monitoring log, and determining the target database with the least occupied resources in the target service system includes:
acquiring an execution log list from the monitoring log, wherein a request in the execution log list is in an execution state;
acquiring an execution database identifier in the execution log list, and acquiring all databases on the target service system;
Determining the execution quantity of each database in the execution log list according to the execution database identification;
and determining the database with the least execution quantity as the target database.
According to a preferred embodiment of the present invention, the querying the target database using the query condition, to obtain a query result includes:
determining a condition number of the query conditions;
when the number of the conditions is multiple, splitting multiple query conditions to obtain sub-conditions;
acquiring idle threads from a preset thread pool according to the number of the conditions;
based on the idle thread, inquiring the target database by utilizing the sub-condition to obtain a response result of the sub-condition;
and determining the intersection of the response results to obtain the query result.
In another aspect, the present invention further provides a data query device, where the data query device includes:
the determining unit is used for determining a query user which sends out the data query request when receiving the data query request and determining the user role of the query user;
the determining unit is further used for determining a query scene corresponding to the user role and determining a query interface according to the query scene;
The analysis unit is used for analyzing the data query request by utilizing the query interface to obtain analysis routing rules, wherein the analysis routing rules comprise a target service system and query conditions;
the acquisition unit is used for acquiring the monitoring log of the target service system;
the determining unit is further used for analyzing the monitoring log and determining a target database with the least occupied resources in the target service system;
and the query unit is used for querying the target database by utilizing the query condition to obtain a query result.
In another aspect, the present invention also proposes an electronic device, including:
a memory storing computer readable instructions; a kind of electronic device with high-pressure air-conditioning system
And a processor executing computer readable instructions stored in the memory to implement the data query method.
In another aspect, the present invention also proposes a computer readable storage medium having stored therein computer readable instructions that are executed by a processor in an electronic device to implement the data query method.
According to the technical scheme, when a data query request is received, a query user sending the data query request is determined, and the user role of the query user is determined, and because the query user has a plurality of roles, each role corresponds to different query scenes, therefore, the determination of the query scenes of the data query request is facilitated by determining the user role, the query scenes corresponding to the user roles are determined, a query interface is determined according to the query scenes, the data query request is analyzed by utilizing the query interface, an analysis routing rule is obtained, the analysis routing rule comprises a target service system and query conditions, and because different roles have different query authorities, the query interface can be determined by the user role, and further, the target service system and the query conditions can be accurately determined by utilizing the query interface, the monitoring log of the target service system is obtained, the minimum occupied target database of resources in the target service system is determined by analyzing the monitoring log, the target database is queried by utilizing the query conditions, the minimum occupied by the monitoring log is obtained, and the target database is determined by utilizing the minimum occupied by the monitoring log, and the query results are improved, and the energy consumption of the target database is further improved. According to the invention, the query scene corresponding to the user role is determined, and then the query interface corresponding to the query scene is utilized to analyze the data query request, so that the data query request can be ensured to query from the service system corresponding to the query interface, the data query request is prevented from data query from other interfaces which do not correspond to the user role, thereby preventing data leakage, improving data security.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the data query method of the present invention.
FIG. 2 is a flow chart of one embodiment of the present invention for determining a querying user issuing a data query request.
FIG. 3 is a flow chart of one embodiment of the present invention for determining a target database.
FIG. 4 is a functional block diagram of a preferred embodiment of the data query device of the present invention.
Fig. 5 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing a data query method.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a preferred embodiment of the data query method of the present invention. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs.
The data query method is applied to one or more electronic devices, wherein the electronic devices are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored computer readable instructions, and the hardware of the electronic devices comprises, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSPs), embedded devices and the like.
The electronic device may be any electronic product that can interact with a user in a human-computer manner, such as a personal computer, tablet computer, smart phone, personal digital assistant (Personal Digital Assistant, PDA), game console, interactive internet protocol television (Internet Protocol Television, IPTV), smart wearable device, etc.
The electronic device may comprise a network device and/or a user device. Wherein the network device includes, but is not limited to, a single network electronic device, a group of electronic devices made up of multiple network electronic devices, or a Cloud based Cloud Computing (Cloud Computing) made up of a large number of hosts or network electronic devices.
The network on which the electronic device is located includes, but is not limited to: the internet, wide area networks, metropolitan area networks, local area networks, virtual private networks (Virtual Private Network, VPN), etc.
S10, when a data query request is received, determining a query user which sends the data query request, and determining a user role of the query user.
In at least one embodiment of the present invention, the data query request includes a request number, a query condition, a source address, and the like.
The inquiring user refers to a user triggering the generation of the data inquiring request.
The user roles may include a worker, a manager, and a supervisor, each role corresponding to a different query authority.
Referring to FIG. 2, FIG. 2 is a flow chart of one embodiment of the present invention for determining a querying user issuing a data query request. In at least one embodiment of the present invention, the determining, by the electronic device, the querying user that issued the data querying request includes:
s100, acquiring the source address of the data query request.
Specifically, the electronic device obtains an address tag, where the address tag is used to indicate a sending address of a request, and further, the electronic device obtains an address corresponding to the address tag from the data query request as the source address.
The source address can be accurately determined through the mapping relation between the address label and the request sending address.
S101, determining the source terminal of the data query request according to the source address.
Because the address and the terminal have a unique mapping relation, the source terminal can be accurately determined through the source address.
S102, acquiring an operation log of the source terminal, and acquiring the receiving time of the data query request.
And recording all the operations of the source terminal on the operation log.
S103, extracting a target log list closest to the receiving time from the operation log.
The target log list records the data query request, an account number triggering the data query request to generate and an identification code triggering the data query request to generate.
S104, extracting the user identification code recorded in the target log list.
The user identification code corresponds to a plurality of accounts. For example: the user identification code xiaoming includes 12345, 15623, etc. corresponding to the user identification code xiaoming.
S105, determining the inquiring user according to the user identification code.
The source terminal can be accurately determined through the mapping relation between the address and the terminal, the target log list corresponding to the data query request can be rapidly determined through the receiving time, and the query user triggering the data query request to be generated can be accurately determined through the target log list.
In at least one embodiment of the present invention, the determining, by the electronic device, the user role of the querying user includes:
Extracting a use account number of the inquiring user from the target log list;
traversing account numbers in a configuration character table, wherein the configuration character table stores the mapping relation between each character and a plurality of account numbers;
matching the traversed account with the use account, and determining the account successfully matched with the use account as a target account;
and acquiring a role corresponding to the target account number from the configuration role table as the user role.
According to the above embodiment, since the account number triggering the data query request is recorded in the target log list, the user role uniquely corresponding to the use account number can be accurately determined by matching the account number in the configuration role table with the use account number extracted from the target log list.
S11, determining a query scene corresponding to the user role, and determining a query interface according to the query scene.
In at least one embodiment of the present invention, the query scenario refers to query service lines, where each service line corresponds to multiple service systems or multiple data source systems.
The query interfaces refer to interfaces corresponding to the query scenes, and each query scene corresponds to one query interface.
In at least one embodiment of the present invention, the determining, by the electronic device, a query scenario corresponding to the user role includes:
acquiring the query authority corresponding to the query user and the user role at the same time;
and determining the application scene corresponding to the query authority as the query scene.
Because the rights associated with the querying user and the user role are unique at the same time, the querying rights determined by the embodiment are unique, and further the query scene specified by the data query request can be accurately determined by the uniquely determined querying rights.
In at least one embodiment of the present invention, the electronic device determines an interface corresponding to a scene tag of the query scene as the query interface.
S12, analyzing the data query request by utilizing the query interface to obtain an analysis routing rule, wherein the analysis routing rule comprises a target service system and query conditions.
In at least one embodiment of the present invention, the electronic device parses the data query request using the query interface to obtain a parsed routing rule, where the parsed routing rule includes a target service system and query conditions including:
Determining an parsing tool on the query interface;
analyzing the data query request by using the analysis tool to obtain data information carried by the data query request;
acquiring a condition label from a configuration label table, wherein the condition label is used for indicating a condition;
extracting information corresponding to the condition label from the data information as the query condition;
extracting query entities in the query conditions, and acquiring all data source systems connected with the query interface;
and determining a system corresponding to the query entity from the data source system as the target service system.
Wherein, a plurality of predefined labels are stored in the configuration label table.
The parsing tool can be used for parsing a request.
The query condition can be accurately determined through the mapping relation between the condition label and the condition, and then the target service system can be accurately determined through the query entity and all data source systems connected with the query interface.
S13, obtaining the monitoring log of the target service system.
In at least one embodiment of the invention, the monitoring log records the operation of the target business system.
In at least one embodiment of the present invention, the electronic device obtaining the monitoring log of the target service system includes:
acquiring a path table of the query interface and acquiring a system identifier of the target service system;
determining a log storage path of the target service system from the path table according to the system identifier;
and acquiring the monitoring log from the log storage path.
By the embodiment, the storage file does not need to be traversed randomly in the target service system, so that the acquisition efficiency of the monitoring log can be improved.
S14, analyzing the monitoring log to determine a target database with the least occupied resources in the target service system.
In at least one embodiment of the present invention, all databases in the target business system store the same data information.
Referring to fig. 3, fig. 3 is a flow chart of one embodiment of the present invention for determining a target database. In at least one embodiment of the present invention, the electronic device analyzing the monitoring log, and determining the target database with the least occupied resources in the target service system includes:
s140, acquiring an execution log list from the monitoring log, wherein the request in the execution log list is in an execution state.
S141, acquiring an execution database identifier in the execution log list, and acquiring all databases on the target service system.
The execution database identifier refers to an identifier of a database requested by a request in the execution log list.
S142, determining the execution quantity of each database in the execution log list according to the execution database identification.
And S143, determining the database with the least execution quantity as the target database.
For example: and acquiring an execution log list 1, an execution log list 2, an execution log list 3 and an execution log list 4 from the monitoring log, acquiring an execution database identifier kua of the execution log list 1, acquiring an execution database identifier kub of the execution log list 2, acquiring an execution database identifier kua of the execution log list 3, acquiring an execution database identifier kua of the execution log list 4, acquiring all databases including databases kua and kub on the target service system, and further determining that the execution number of the databases kua is 3, and the execution number of the databases kub is 1, thereby determining that the database kub is the target database.
By the implementation mode, the database with the least occupied resources can be determined, and further the data query of the data query request is facilitated.
S15, inquiring the target database by utilizing the inquiring conditions to obtain an inquiring result.
It should be emphasized that, to further ensure the privacy and security of the query results, the query results may also be stored in a node of a blockchain.
In at least one embodiment of the present invention, the electronic device querying the target database using the query condition, and obtaining a query result includes:
determining a condition number of the query conditions;
when the number of the conditions is multiple, splitting multiple query conditions to obtain sub-conditions;
acquiring idle threads from a preset thread pool according to the number of the conditions;
based on the idle thread, inquiring the target database by utilizing the sub-condition to obtain a response result of the sub-condition;
and determining the intersection of the response results to obtain the query result.
According to the embodiment, when the number of the query conditions is multiple, the split sub-conditions are queried by using the idle threads with the number of threads being the number of the conditions, and the query is performed after the query conditions are split, and the query is performed by using the threads in the idle state, and meanwhile, the target database is the database with the least occupied resources, so that the determination efficiency of the query result can be improved.
In at least one embodiment of the present invention, after obtaining the query result, the method further includes:
acquiring a request number of the data query request;
generating prompt information according to the request number and the query result;
encrypting the prompt information by adopting a symmetric encryption algorithm to obtain a ciphertext;
determining the request level of the data query request according to the request number;
determining a sending mode of the ciphertext according to the request level;
and sending the ciphertext in the sending mode.
By the embodiment, the request level of the data query request can be determined, so that the query result can be sent in a proper mode, and in addition, the prompt information is encrypted, so that the safety of the query result is improved.
According to the technical scheme, when a data query request is received, a query user sending the data query request is determined, and the user role of the query user is determined, and because the query user has a plurality of roles, each role corresponds to different query scenes, therefore, the determination of the query scenes of the data query request is facilitated by determining the user role, the query scenes corresponding to the user roles are determined, a query interface is determined according to the query scenes, the data query request is analyzed by utilizing the query interface, an analysis routing rule is obtained, the analysis routing rule comprises a target service system and query conditions, and because different roles have different query authorities, the query interface can be determined by the user role, and further, the target service system and the query conditions can be accurately determined by utilizing the query interface, the monitoring log of the target service system is obtained, the minimum occupied target database of resources in the target service system is determined by analyzing the monitoring log, the target database is queried by utilizing the query conditions, the minimum occupied by the monitoring log is obtained, and the target database is determined by utilizing the minimum occupied by the monitoring log, and the query results are improved, and the energy consumption of the target database is further improved. According to the invention, the query scene corresponding to the user role is determined, and then the query interface corresponding to the query scene is utilized to analyze the data query request, so that the data query request can be ensured to query from the service system corresponding to the query interface, the data query request is prevented from data query from other interfaces which do not correspond to the user role, thereby preventing data leakage, improving data security.
FIG. 4 is a functional block diagram of a preferred embodiment of the data query device of the present invention. The data query device 11 includes a determining unit 110, an analyzing unit 111, an acquiring unit 112, a query unit 113, a generating unit 114, an encrypting unit 115, and a transmitting unit 116. The module/unit referred to herein is a series of computer readable instructions capable of being retrieved by the processor 13 and performing a fixed function and stored in the memory 12. In the present embodiment, the functions of the respective modules/units will be described in detail in the following embodiments.
When receiving a data query request, the determining unit 110 determines a query user who issued the data query request, and determines a user role of the query user.
In at least one embodiment of the present invention, the data query request includes a request number, a query condition, a source address, and the like.
The inquiring user refers to a user triggering the generation of the data inquiring request.
The user roles may include a worker, a manager, and a supervisor, each role corresponding to a different query authority.
In at least one embodiment of the present invention, the determining unit 110 determines that the querying user that issued the data querying request includes:
And acquiring the source address of the data query request.
Specifically, the determining unit 110 obtains an address tag, where the address tag is used to indicate a transmission address of a request, and further, the determining unit 110 obtains, from the data query request, an address corresponding to the address tag as the source address.
The source address can be accurately determined through the mapping relation between the address label and the request sending address.
And determining the source terminal of the data query request according to the source address.
Because the address and the terminal have a unique mapping relation, the source terminal can be accurately determined through the source address.
And acquiring an operation log of the source terminal, and acquiring the receiving time of the data query request.
And recording all the operations of the source terminal on the operation log.
And extracting a target log list nearest to the receiving time from the operation log.
The target log list records the data query request, an account number triggering the data query request to generate and an identification code triggering the data query request to generate.
And extracting the user identification code recorded in the target log list.
The user identification code corresponds to a plurality of accounts. For example: the user identification code xiaoming includes 12345, 15623, etc. corresponding to the user identification code xiaoming.
And determining the inquiring user according to the user identification code.
The source terminal can be accurately determined through the mapping relation between the address and the terminal, the target log list corresponding to the data query request can be rapidly determined through the receiving time, and the query user triggering the data query request to be generated can be accurately determined through the target log list.
In at least one embodiment of the present invention, the determining unit 110 determines the user role of the querying user includes:
extracting a use account number of the inquiring user from the target log list;
traversing account numbers in a configuration character table, wherein the configuration character table stores the mapping relation between each character and a plurality of account numbers;
matching the traversed account with the use account, and determining the account successfully matched with the use account as a target account;
and acquiring a role corresponding to the target account number from the configuration role table as the user role.
According to the above embodiment, since the account number triggering the data query request is recorded in the target log list, the user role uniquely corresponding to the use account number can be accurately determined by matching the account number in the configuration role table with the use account number extracted from the target log list.
The determining unit 110 determines a query scene corresponding to the user character and determines a query interface according to the query scene.
In at least one embodiment of the present invention, the query scenario refers to query service lines, where each service line corresponds to multiple service systems or multiple data source systems.
The query interfaces refer to interfaces corresponding to the query scenes, and each query scene corresponds to one query interface.
In at least one embodiment of the present invention, the determining unit 110 determines a query scene corresponding to the user role includes:
acquiring the query authority corresponding to the query user and the user role at the same time;
and determining the application scene corresponding to the query authority as the query scene.
Because the rights associated with the querying user and the user role are unique at the same time, the querying rights determined by the embodiment are unique, and further the query scene specified by the data query request can be accurately determined by the uniquely determined querying rights.
In at least one embodiment of the present invention, the determining unit 110 determines an interface corresponding to a scene tag of the query scene as the query interface.
The parsing unit 111 parses the data query request by using the query interface, to obtain a parsed routing rule, where the parsed routing rule includes a target service system and query conditions.
In at least one embodiment of the present invention, the parsing unit 111 parses the data query request using the query interface to obtain a parsed routing rule, where the parsed routing rule includes a target service system and query conditions including:
determining an parsing tool on the query interface;
analyzing the data query request by using the analysis tool to obtain data information carried by the data query request;
acquiring a condition label from a configuration label table, wherein the condition label is used for indicating a condition;
extracting information corresponding to the condition label from the data information as the query condition;
extracting query entities in the query conditions, and acquiring all data source systems connected with the query interface;
and determining a system corresponding to the query entity from the data source system as the target service system.
Wherein, a plurality of predefined labels are stored in the configuration label table.
The parsing tool can be used for parsing a request.
The query condition can be accurately determined through the mapping relation between the condition label and the condition, and then the target service system can be accurately determined through the query entity and all data source systems connected with the query interface.
The acquisition unit 112 acquires a monitoring log of the target service system.
In at least one embodiment of the invention, the monitoring log records the operation of the target business system.
In at least one embodiment of the present invention, the obtaining unit 112 obtains a monitoring log of the target service system includes:
acquiring a path table of the query interface and acquiring a system identifier of the target service system;
determining a log storage path of the target service system from the path table according to the system identifier;
and acquiring the monitoring log from the log storage path.
By the embodiment, the storage file does not need to be traversed randomly in the target service system, so that the acquisition efficiency of the monitoring log can be improved.
The determining unit 110 analyzes the monitoring log, and determines a target database with the least occupied resources in the target service system.
In at least one embodiment of the present invention, all databases in the target business system store the same data information.
In at least one embodiment of the present invention, the determining unit 110 analyzes the monitoring log, and determining the target database with the least occupied resources in the target service system includes:
and acquiring an execution log list from the monitoring log, wherein the request in the execution log list is in an execution state.
And acquiring an execution database identifier in the execution log list, and acquiring all databases on the target service system.
The execution database identifier refers to an identifier of a database requested by a request in the execution log list.
And determining the execution quantity of each database in the execution log list according to the execution database identification.
And determining the database with the least execution quantity as the target database.
For example: and acquiring an execution log list 1, an execution log list 2, an execution log list 3 and an execution log list 4 from the monitoring log, acquiring an execution database identifier kua of the execution log list 1, acquiring an execution database identifier kub of the execution log list 2, acquiring an execution database identifier kua of the execution log list 3, acquiring an execution database identifier kua of the execution log list 4, acquiring all databases including databases kua and kub on the target service system, and further determining that the execution number of the databases kua is 3, and the execution number of the databases kub is 1, thereby determining that the database kub is the target database.
By the implementation mode, the database with the least occupied resources can be determined, and further the data query of the data query request is facilitated.
The query unit 113 queries the target database by using the query conditions, and obtains a query result.
It should be emphasized that, to further ensure the privacy and security of the query results, the query results may also be stored in a node of a blockchain.
In at least one embodiment of the present invention, the querying unit 113 queries the target database using the query condition, and obtains a query result including:
determining a condition number of the query conditions;
when the number of the conditions is multiple, splitting multiple query conditions to obtain sub-conditions;
acquiring idle threads from a preset thread pool according to the number of the conditions;
based on the idle thread, inquiring the target database by utilizing the sub-condition to obtain a response result of the sub-condition;
and determining the intersection of the response results to obtain the query result.
According to the embodiment, when the number of the query conditions is multiple, the split sub-conditions are queried by using the idle threads with the number of threads being the number of the conditions, and the query is performed after the query conditions are split, and the query is performed by using the threads in the idle state, and meanwhile, the target database is the database with the least occupied resources, so that the determination efficiency of the query result can be improved.
In at least one embodiment of the present invention, after obtaining the query result, the obtaining unit 112 obtains the request number of the data query request;
generating unit 114 generates prompt information according to the request number and the query result;
the encryption unit 115 encrypts the prompt information by adopting a symmetric encryption algorithm to obtain a ciphertext;
the determining unit 110 determines a request level of the data query request according to the request number;
the determining unit 110 determines a transmission mode of the ciphertext according to the request level;
the transmission unit 116 transmits the ciphertext in the transmission manner.
By the embodiment, the request level of the data query request can be determined, so that the query result can be sent in a proper mode, and in addition, the prompt information is encrypted, so that the safety of the query result is improved.
According to the technical scheme, when a data query request is received, a query user sending the data query request is determined, and the user role of the query user is determined, and because the query user has a plurality of roles, each role corresponds to different query scenes, therefore, the determination of the query scenes of the data query request is facilitated by determining the user role, the query scenes corresponding to the user roles are determined, a query interface is determined according to the query scenes, the data query request is analyzed by utilizing the query interface, an analysis routing rule is obtained, the analysis routing rule comprises a target service system and query conditions, and because different roles have different query authorities, the query interface can be determined by the user role, and further, the target service system and the query conditions can be accurately determined by utilizing the query interface, the monitoring log of the target service system is obtained, the minimum occupied target database of resources in the target service system is determined by analyzing the monitoring log, the target database is queried by utilizing the query conditions, the minimum occupied by the monitoring log is obtained, and the target database is determined by utilizing the minimum occupied by the monitoring log, and the query results are improved, and the energy consumption of the target database is further improved. According to the invention, the query scene corresponding to the user role is determined, and then the query interface corresponding to the query scene is utilized to analyze the data query request, so that the data query request can be ensured to query from the service system corresponding to the query interface, the data query request is prevented from data query from other interfaces which do not correspond to the user role, thereby preventing data leakage, improving data security.
Fig. 5 is a schematic structural diagram of an electronic device according to a preferred embodiment of the present invention for implementing the data query method.
In one embodiment of the invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer readable instructions, such as a data query program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and may include more or less components than illustrated, or may combine certain components, or different components, e.g. the electronic device 1 may further include input-output devices, network access devices, buses, etc.
The processor 13 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor, etc., and the processor 13 is an operation core and a control center of the electronic device 1, connects various parts of the entire electronic device 1 using various interfaces and lines, and executes an operating system of the electronic device 1 and various installed applications, program codes, etc.
Illustratively, the computer readable instructions may be partitioned into one or more modules/units that are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules/units may be a series of computer readable instructions capable of performing a specific function, the computer readable instructions describing a process of executing the computer readable instructions in the electronic device 1. For example, the computer-readable instructions may be divided into a determining unit 110, an analyzing unit 111, an acquiring unit 112, a querying unit 113, a generating unit 114, an encrypting unit 115, and a transmitting unit 116.
The memory 12 may be used to store the computer readable instructions and/or modules, and the processor 13 may implement various functions of the electronic device 1 by executing or executing the computer readable instructions and/or modules stored in the memory 12 and invoking data stored in the memory 12. The memory 12 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device, etc. Memory 12 may include non-volatile and volatile memory, such as: a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a physical memory, such as a memory bank, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the present invention may also be implemented by implementing all or part of the processes in the methods of the embodiments described above, by instructing the associated hardware by means of computer readable instructions, which may be stored in a computer readable storage medium, the computer readable instructions, when executed by a processor, implementing the steps of the respective method embodiments described above.
Wherein the computer readable instructions comprise computer readable instruction code which may be in the form of source code, object code, executable files, or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer readable instruction code, a recording medium, a USB flash disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory).
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
In connection with fig. 1, the memory 12 in the electronic device 1 stores computer readable instructions implementing a data query method, the processor 13 being executable to implement:
when a data query request is received, determining a query user which sends the data query request, and determining a user role of the query user;
determining a query scene corresponding to the user role, and determining a query interface according to the query scene;
analyzing the data query request by utilizing the query interface to obtain an analysis routing rule, wherein the analysis routing rule comprises a target service system and query conditions;
Acquiring a monitoring log of the target service system;
analyzing the monitoring log to determine a target database with the least occupied resources in the target service system;
and querying the target database by using the query condition to obtain a query result.
In particular, the specific implementation method of the processor 13 on the computer readable instructions may refer to the description of the relevant steps in the corresponding embodiment of fig. 1, which is not repeated herein.
In the several embodiments provided in the present invention, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The computer readable storage medium has stored thereon computer readable instructions, wherein the computer readable instructions when executed by the processor 13 are configured to implement the steps of:
when a data query request is received, determining a query user which sends the data query request, and determining a user role of the query user;
determining a query scene corresponding to the user role, and determining a query interface according to the query scene;
Analyzing the data query request by utilizing the query interface to obtain an analysis routing rule, wherein the analysis routing rule comprises a target service system and query conditions;
acquiring a monitoring log of the target service system;
analyzing the monitoring log to determine a target database with the least occupied resources in the target service system;
and querying the target database by using the query condition to obtain a query result.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. The units or means may also be implemented by one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention.

Claims (8)

1. A data query method, the data query method comprising:
When a data query request is received, determining a query user who issues the data query request, including: acquiring a source address of the data query request; determining a source terminal of the data query request according to the source address; acquiring an operation log of the source terminal, and acquiring the receiving time of the data query request; extracting a target log list nearest to the receiving time from the operation log; extracting a user identification code recorded in the target log list; determining the inquiring user according to the user identification code, and determining the user role of the inquiring user;
determining a query scene corresponding to the user role, and determining a query interface according to the query scene;
analyzing the data query request by utilizing the query interface to obtain an analysis routing rule, wherein the analysis routing rule comprises a target service system and query conditions;
acquiring a monitoring log of the target service system;
analyzing the monitoring log to determine a target database with the least occupied resources in the target service system, including: acquiring an execution log list from the monitoring log, wherein a request in the execution log list is in an execution state; acquiring an execution database identifier in the execution log list, and acquiring all databases on the target service system; determining the execution quantity of each database in the execution log list according to the execution database identification; determining the database with the least execution quantity as the target database;
And querying the target database by using the query condition to obtain a query result.
2. The data query method of claim 1, wherein said determining a user role of the querying user comprises:
extracting a use account number of the inquiring user from the target log list;
traversing account numbers in a configuration character table, wherein the configuration character table stores the mapping relation between each character and a plurality of account numbers;
matching the traversed account with the use account, and determining the account successfully matched with the use account as a target account;
and acquiring a role corresponding to the target account number from the configuration role table as the user role.
3. The data query method of claim 1, wherein said parsing the data query request using the query interface to obtain parsed routing rules, the parsed routing rules including target business systems and query conditions comprises:
determining an parsing tool on the query interface;
analyzing the data query request by using the analysis tool to obtain data information carried by the data query request;
acquiring a condition label from a configuration label table, wherein the condition label is used for indicating a condition;
Extracting information corresponding to the condition label from the data information as the query condition;
extracting query entities in the query conditions, and acquiring all data source systems connected with the query interface;
and determining a system corresponding to the query entity from the data source system as the target service system.
4. The data query method of claim 1, wherein the obtaining the monitoring log of the target business system comprises:
acquiring a path table of the query interface and acquiring a system identifier of the target service system;
determining a log storage path of the target service system from the path table according to the system identifier;
and acquiring the monitoring log from the log storage path.
5. The data query method as claimed in claim 1, wherein said querying said target database using said query conditions to obtain query results comprises:
determining a condition number of the query conditions;
when the number of the conditions is multiple, splitting multiple query conditions to obtain sub-conditions;
acquiring idle threads from a preset thread pool according to the number of the conditions;
Based on the idle thread, inquiring the target database by utilizing the sub-condition to obtain a response result of the sub-condition;
and determining the intersection of the response results to obtain the query result.
6. A data query device, the data query device comprising:
a determining unit, configured to determine, when receiving a data query request, a query user that issues the data query request, where the determining unit includes: acquiring a source address of the data query request; determining a source terminal of the data query request according to the source address; acquiring an operation log of the source terminal, and acquiring the receiving time of the data query request; extracting a target log list nearest to the receiving time from the operation log; extracting a user identification code recorded in the target log list; determining the inquiring user according to the user identification code, and determining the user role of the inquiring user;
the determining unit is further used for determining a query scene corresponding to the user role and determining a query interface according to the query scene;
the analysis unit is used for analyzing the data query request by utilizing the query interface to obtain analysis routing rules, wherein the analysis routing rules comprise a target service system and query conditions;
The acquisition unit is used for acquiring the monitoring log of the target service system;
the determining unit is further configured to analyze the monitoring log, determine a target database with a minimum resource occupation in the target service system, and include: acquiring an execution log list from the monitoring log, wherein a request in the execution log list is in an execution state; acquiring an execution database identifier in the execution log list, and acquiring all databases on the target service system; determining the execution quantity of each database in the execution log list according to the execution database identification; determining the database with the least execution quantity as the target database;
and the query unit is used for querying the target database by utilizing the query condition to obtain a query result.
7. An electronic device, the electronic device comprising:
a memory storing computer readable instructions; a kind of electronic device with high-pressure air-conditioning system
A processor executing computer readable instructions stored in the memory to implement the data query method of any one of claims 1 to 5.
8. A computer-readable storage medium, characterized by: the computer readable storage medium has stored therein computer readable instructions that are executed by a processor in an electronic device to implement the data query method of any of claims 1 to 5.
CN202011545709.1A 2020-12-23 2020-12-23 Data query method, device, electronic equipment and storage medium Active CN112541009B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011545709.1A CN112541009B (en) 2020-12-23 2020-12-23 Data query method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011545709.1A CN112541009B (en) 2020-12-23 2020-12-23 Data query method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112541009A CN112541009A (en) 2021-03-23
CN112541009B true CN112541009B (en) 2023-10-13

Family

ID=75017776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011545709.1A Active CN112541009B (en) 2020-12-23 2020-12-23 Data query method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112541009B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177070B (en) * 2021-05-17 2022-08-12 中移智行网络科技有限公司 Information query method, device and related equipment
CN115033211A (en) * 2022-05-24 2022-09-09 青岛海尔科技有限公司 Method, device and equipment for querying article based on strategy mode and storage medium
CN116431677B (en) * 2023-06-15 2023-11-21 南方电网数字电网研究院有限公司 Data routing method, system and readable storage medium based on memory database

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415925A (en) * 2018-01-10 2018-08-17 平安科技(深圳)有限公司 Electronic device, data call daily record generation and querying method and storage medium
CN110619000A (en) * 2019-09-25 2019-12-27 网易(杭州)网络有限公司 Time sequence data query method and device, storage medium and electronic equipment
CN111522922A (en) * 2020-03-26 2020-08-11 浙江口碑网络技术有限公司 Log information query method and device, storage medium and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10346376B2 (en) * 2016-11-02 2019-07-09 Mastercard International Incorporated Systems and methods for database management

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108415925A (en) * 2018-01-10 2018-08-17 平安科技(深圳)有限公司 Electronic device, data call daily record generation and querying method and storage medium
CN110619000A (en) * 2019-09-25 2019-12-27 网易(杭州)网络有限公司 Time sequence data query method and device, storage medium and electronic equipment
CN111522922A (en) * 2020-03-26 2020-08-11 浙江口碑网络技术有限公司 Log information query method and device, storage medium and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张小芳 ; 古清月 ; .基于数据仓库的JMS中数据管理方法的研究.计算机工程与设计.2007,(第05期),全文. *

Also Published As

Publication number Publication date
CN112541009A (en) 2021-03-23

Similar Documents

Publication Publication Date Title
CN112541009B (en) Data query method, device, electronic equipment and storage medium
JP6754495B2 (en) Methods and systems for the protection and verification of identities and certificates via the blockchain
CN111901327A (en) Cloud network vulnerability mining method and device, electronic equipment and medium
WO2022134466A1 (en) Data processing method and related device
CN113050900B (en) Screen sharing method, device, equipment and storage medium
WO2022041889A1 (en) Fund routing method and apparatus, electronic device, and storage medium
CN111984601A (en) Log file deleting method and device, electronic equipment and storage medium
CN112329043A (en) Information encryption processing method, device, computer equipment and medium
CN112307052A (en) Data management method, service system, terminal and storage medium
CN111796936A (en) Request processing method and device, electronic equipment and medium
CN112784566A (en) Document generation method, device, equipment and storage medium
CN112199483A (en) Information input assisting method and device, electronic equipment and storage medium
CN112711696A (en) Request access method, device, electronic equipment and storage medium
CN112434062A (en) Quasi-real-time data processing method, device, server and storage medium
CN109828832B (en) Block chain-based data circulation method, device, equipment and medium
CN116360769A (en) Code generation method, device, equipment and storage medium
CN113283677B (en) Index data processing method, device, equipment and storage medium
CN112181485B (en) Script execution method and device, electronic equipment and storage medium
CN112817742B (en) Data migration method, device, equipment and storage medium
CN111933241B (en) Medical data analysis method, device, electronic equipment and storage medium
CN112738175B (en) Request processing method and related equipment
CN114925033A (en) Information uplink method, device, system and storage medium
CN112685365A (en) Data report exporting method, device, equipment and storage medium
CN112015759B (en) Policy detection method, device, electronic equipment and medium
CN114726541B (en) Electronic license reading method, device, equipment and storage medium

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
TA01 Transfer of patent application right

Effective date of registration: 20230907

Address after: No. 546, Luoyu Road, Hongshan District, Wuhan, Hubei Province, 430000

Applicant after: HUBEI CENTRAL CHINA TECHNOLOGY DEVELOPMENT OF ELECTRIC POWER Co.,Ltd.

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant