CN111125169A - Data query method, control device, medium and computer equipment - Google Patents

Data query method, control device, medium and computer equipment Download PDF

Info

Publication number
CN111125169A
CN111125169A CN201911190565.XA CN201911190565A CN111125169A CN 111125169 A CN111125169 A CN 111125169A CN 201911190565 A CN201911190565 A CN 201911190565A CN 111125169 A CN111125169 A CN 111125169A
Authority
CN
China
Prior art keywords
data query
redis database
key field
identification information
party server
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.)
Granted
Application number
CN201911190565.XA
Other languages
Chinese (zh)
Other versions
CN111125169B (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.)
Jiangsu Suning Logistics Co ltd
Original Assignee
Jiangsu Suning Logistics 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 Jiangsu Suning Logistics Co ltd filed Critical Jiangsu Suning Logistics Co ltd
Priority to CN201911190565.XA priority Critical patent/CN111125169B/en
Publication of CN111125169A publication Critical patent/CN111125169A/en
Application granted granted Critical
Publication of CN111125169B publication Critical patent/CN111125169B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06F16/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to a data query control method. The method comprises the following steps: acquiring a data query request submitted by a terminal; when the data query request comprises identification information of a third-party server, determining a redis database to be queried according to the identification information and a preset configuration file; and extracting key fields in the data query request, acquiring field values corresponding to the key fields from the to-be-queried redis database as query results, and feeding the query results back to the terminal. According to the method and the device, the Redis database to be queried is determined from the Redis databases on the servers through the preset configuration file and the data query request, the query result is obtained from the database to be queried, the data in the Redis databases on the servers are queried, the data query range is expanded, and the applicability of the scheme is improved.

Description

Data query method, control device, medium and computer equipment
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data query method, a control device, a control medium, and a computer device.
Background
Redis (Remote directory Server) is a memory cache database, the software is written in C language, the data model is key-value, and Redis can support rich data types, such as String, List, Hash, Set, Sorted Set, etc., and therefore is widely used.
At present, when data caching is carried out by utilizing Redis, query of cached data is often needed. For example, many functions of the logistics policy system involve data storage of a cache, so that a test node needs to pay attention to correctness of data in a Redis cache, and therefore needs to query data in the Redis cache and manually judge accuracy of the searched data. At present, when querying the redis cache data, the data in the local redis cache of the server is generally queried, and such query range is relatively narrow and the applicability is relatively low.
Disclosure of Invention
Based on this, it is necessary to provide a method for determining a to-be-queried Redis database from the Redis databases on the multiple servers through a preset configuration file and a data query request, and obtaining a query result from the to-be-queried database, so as to query data in the Redis databases on the multiple servers, expand a data query range, and improve the applicability of a scheme.
A data query control method comprises the following steps:
acquiring a data query request submitted by a terminal;
when the data query request comprises identification information of a third-party server, determining a redis database to be queried according to the identification information and a preset configuration file;
and extracting key fields in the data query request, acquiring field values corresponding to the key fields from the redis database to be queried as query results, and feeding the query results back to the terminal.
In one embodiment, the configuration file includes a mapping relationship between identification information of a third-party server and address information of the third-party server, and the determining of the redis database to be queried according to the identification information and a preset configuration file includes:
determining address information corresponding to the identification information according to the mapping relation between the identification information of the third-party server and the address information of the third-party server;
determining a third-party server to which the address information points;
taking the first redis database on the third-party server as a redis database to be queried;
the method further comprises the following steps:
and when the identification information of the third-party server is not included in the data query request, taking the local second redis database as the redis database to be queried.
In one embodiment, the method further comprises:
receiving a page display request of a data query page;
acquiring a preset page layout file corresponding to the data query request;
acquiring first key fields in a first redis database pointed by each address information in a configuration file and identification information of a third-party server to which each first key field belongs;
acquiring a second key field in a second redis database;
constructing a key field information list according to each first key field, the identification information of the third-party server to which each first key field belongs and each second key field;
and feeding back the key field information list and the preset page layout file to the terminal so that the terminal can display the key field list on a user interface according to the preset page layout file.
In one embodiment, the method further comprises:
respectively acquiring the detail information of a first key field in each first redis database and the detail information of each second key field in a second redis database;
and adding each piece of detail information into a key field information list.
In one embodiment, the method further comprises:
receiving a new request for a new mapping relation in the configuration file;
and adding the new mapping relation into the configuration file.
A method of data query, the method comprising:
receiving a triggering instruction of data query, and submitting a data query request to a server;
after the receiving server determines a redis database to be queried according to the identification information of the third-party server in the data query request and a preset configuration file, the receiving server feeds back a query result according to the redis database to be queried;
and displaying the query result on a user interface.
In one embodiment, the configuration file includes a mapping relationship between identification information of the third-party server and address information of the third-party server, when the data query request includes the identification information of the third-party server, the to-be-queried redis database is a first redis database on the third-party server corresponding to the identification information in the configuration file, and when the data query request does not include the identification information of the third-party server, the to-be-queried redis database is a local second redis database, and the method further includes:
receiving a trigger instruction for accessing a target network address, and submitting an access request of the target network address to a server, wherein the target network address points to a data query page corresponding to the data query request;
receiving a preset page layout file and a key field information list corresponding to a data query page fed back by a server, wherein the key field information list comprises a first key field in a first redis database pointed by address information in a configuration file, identification information of a third party server to which each first key field belongs and each second key field in a second redis database, and preferably, the key field information list also comprises detail information of the first key field in each first redis database and detail information of each second key field in the second redis database;
and rendering and displaying the key field information list according to the preset page layout file so as to display the key field information list on a user interface.
A data query control device based on redis, the device comprising:
the acquisition module is used for acquiring a data query request submitted by a terminal;
the determining module is used for determining a redis database to be queried according to the identification information and a preset configuration file when the data query request comprises the identification information of the third-party server;
and the feedback module is used for acquiring field values corresponding to the key fields in the data query request from the redis database to be queried as query results and feeding the query results back to the terminal.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of any of the above-described embodiments of the method are performed by the processor when the computer program is executed by the processor.
A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program realizes the steps of the method of any of the above embodiments when executed by a processor.
According to the data query control method, the data query control device and the computer equipment, the data query request submitted by the terminal is acquired; when the data query request comprises identification information of a third-party server, determining a redis database to be queried according to the identification information and a preset configuration file; and extracting key fields in the data query request, acquiring field values corresponding to the key fields from the redis database to be queried as query results, and feeding the query results back to the terminal. According to the method and the device, the Redis database to be queried is determined from the Redis databases on the servers through the preset configuration file and the data query request, the query result is obtained from the database to be queried, the data in the Redis databases on the servers are queried, the data query range is expanded, and the applicability of the scheme is improved.
Drawings
FIG. 1 is a diagram of an application environment of a data query control method in an exemplary embodiment of the present application;
FIG. 2 is a schematic flow chart diagram of a data query control method provided in an exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of a data query page provided in an exemplary embodiment of the present application;
FIG. 4 is a schematic illustration of a presentation page of query results provided in an exemplary embodiment of the present application;
FIG. 5 is a timing diagram illustrating a data loading process in a second redis database provided in an exemplary embodiment of the present application;
FIG. 6 is a flow chart illustrating a data query method provided in an exemplary embodiment of the present application;
fig. 7 is a block diagram of a data query control apparatus provided in an exemplary embodiment of the present application;
fig. 8 is a block diagram of a data query control apparatus provided in an exemplary embodiment of the present application;
FIG. 9 is a block diagram of a data query device provided in an exemplary embodiment of the present application;
FIG. 10 is a block diagram of a data query device provided in an exemplary embodiment of the present application;
FIG. 11 is an internal block diagram of a computer device provided in an exemplary embodiment of the present application;
fig. 12 is an internal structural diagram of a computer device provided in an exemplary embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, fig. 1 is a schematic application environment diagram of a data query control method according to an exemplary embodiment of the present application. As shown in fig. 1, the data query control system includes a server 100 and a second terminal 101. The server 100 and the second terminal 101 communicate via a network 102.
The server 100 is configured to obtain a data query request submitted by the terminal 101, determine a redis database to be queried according to the identification information and a preset configuration file when it is determined that the data query request includes identification information of a third-party server, obtain a field value corresponding to a key field in the data query request from the redis database to be queried as a query result, and feed back the query result to the terminal 101, so as to implement the data query control method of the present application. The server 100 may be implemented as a stand-alone server or as a server cluster of two servers.
The terminal 101 is configured to submit a data query request to the server 100 and receive a query result fed back by the server 100. The terminal 101 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, desktop computers, and the like.
The network 102 is used to implement network connection between the server 100 and a terminal 101. In particular, the network 102 may include various types of wired or wireless networks.
In one embodiment, as shown in fig. 2, a data query control method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
and S11, acquiring the data query request submitted by the terminal.
In the application, a data query page is displayed on a terminal in advance, a virtual key for triggering a data query request is provided on the data query page, and a user clicks the virtual key to trigger a data query instruction, so that the terminal submits the data query request to a server, and a corresponding query result is obtained from a redis database to be queried.
And S12, when the data query request comprises the identification information of the third-party server, determining a redis database to be queried according to the identification information and a preset configuration file.
In the application, after the server acquires the data query request, whether the data query request contains the identification information of the third-party server is determined. And when the data query request is determined to include the identification information of the third-party server, determining the redis database to be queried according to the identification information and a preset configuration file.
And S13, extracting key fields in the data query request, acquiring field values corresponding to the key fields from the redis database to be queried as query results, and feeding the query results back to the terminal.
In the present application, the key field specifically includes a field name of the key field and identification information of the field, such as a field id. The to-be-queried redis database comprises a mapping relation between key fields and field values. Specifically, the mapping relationship between the key field and the field value may specifically include a mapping relationship between the key field and a field value and/or a mapping relationship between the key field and a field value set.
In one embodiment, the determining the redis database to be queried according to the identifier information and the preset configuration file may include:
determining address information corresponding to the identification information according to the mapping relation between the identification information of the third-party server and the address information of the third-party server; determining a third-party server to which the address information points; and taking the first redis database on the third-party server as a redis database to be queried.
Further, the method may further include:
and when the identification information of the third-party server is not included in the data query request, taking the local second redis database as the redis database to be queried.
In the application, the server pre-constructs a configuration file, wherein the configuration file comprises a mapping relation between the identification information of the third-party server and the address information of the third-party server. The identification information of the third-party server may be an id number set by the server for each third-party server, or an equipment identification code of each third-party server. The address information of the third party server may include an IP (Internet Protocol) address and a port number of the third party server.
Further, a first redis database is respectively constructed on each third-party server. The first redis database comprises a mapping relation between a first key field and a field value. When the data query request comprises identification information of a third-party server, the server queries a mapping relation between the identification information of the third-party server in the configuration file and address information of the third-party server according to the identification information in the data query request, acquires the address information corresponding to the identification information in the data query request, determines the corresponding third-party server according to the address information, and further takes a first redis database on the third-party server as a to-be-queried redis database.
The address information of the third-party server to be inquired is configured into the configuration file through the configuration file, so that the redis databases on a plurality of servers can be inquired, the data inquiry range is expanded, the expansion function of the scheme is realized, the content in the configuration file supports correction, and the inquiry range can be flexibly corrected.
Referring to fig. 3, fig. 3 is a schematic diagram of a data query page according to an embodiment. In one embodiment, the method may further include:
receiving a page display request of a data query page; acquiring a preset page layout file corresponding to the data query request; acquiring first key fields in a first redis database pointed by each address information in a configuration file and identification information of a third-party server to which each first key field belongs; acquiring a second key field in a second redis database; constructing a key field information list according to each first key field, the identification information of the third-party server to which each first key field belongs and each second key field; and feeding back the key field information list and the preset page layout file to the terminal so that the terminal can display the key field list on a user interface according to the preset page layout file.
As shown in fig. 3, a preset page layout file corresponding to the data query page is preset on the server, and a plurality of controls, attribute information of each control, and data to be displayed associated with the controls are defined in the preset page layout file. In the present application, the preset page layout file includes, but is not limited to, the following control information: a query input box 31 corresponding to the data query request, a trigger button 32 corresponding to the data query request, a display box 33 of the query result and a preview box 34 of the key field list, wherein the preview box 34 of the key field list is displayed with a key field list 35. The data to be displayed in the preview box 34 is specifically defined in the preset page layout file as a key field list 35. Specifically, the content in the preset page layout file is modifiable. For example, a developer may design a new control by himself and update the new control layout into a preset page layout file.
In the method and the device, after the preset page layout file and the key field list are sent to the terminal, the terminal conducts rendering display according to the preset page layout file and the key field list, and specifically, the terminal displays the key field list in the preview frame according to-be-displayed data of the preview frame of the key field list in the preset page layout file.
In the present application, the key field information list includes data records of a plurality of query conditions, each data record includes a key field and other parameters, and the key field specifically includes a field name of the key field and identification information of the key field, such as a key field id. As shown in fig. 3, a column of data on the right side of the preview box 34 is a data record of the query condition. The first data record includes the key field "tes _ pps", the key field id, and other parameters, such as "tes: table ".
According to the method and the device, the key field information list is displayed on the user interface, so that a user can preview all data records containing the key fields on the query page, and further, the user can copy the data records in the key field information list to the query input box and click the 'submit' button to trigger a data query instruction. In another embodiment, the user may also manually enter the data record in the key field information list into the query input box and click the "submit" button.
In another embodiment, the data query page may further provide a check button for each data record in the key field information list, and the user may check one of the data records and then click the "submit" button to query the data. According to the method and the device, the key field information list is displayed on the user interface, the problem that in the prior art, a tester needs to learn and memorize a common redis query command to query data is solved, the time cost of the tester is saved, and the convenient and fast query of the data in the redis database is realized.
Referring to fig. 3, fig. 3 is a schematic diagram of a data query page according to an embodiment. In one embodiment, the method may further include:
respectively acquiring the detail information of a first key field in each first redis database and the detail information of each second key field in a second redis database; and adding each piece of detail information into a key field information list.
As shown in fig. 3, the key field information list includes data records of a plurality of query conditions, each data record includes a first key field or a second key field, and the key field information list further includes detail information corresponding to each key field. The present application presents the various data records and the corresponding detail information in a preview box 34 of the key field information list. In fig. 3, the left column of data in the preview frame 34 is the detail information, and the right column of data is the data record corresponding to each detail information. In the present application, the detail information is used to describe the meaning of the corresponding key field. In fig. 3, the detail information corresponding to the key field "tes _ pps" is "aging data". The detail information corresponding to the key field "tes _ bus _ node" is "regular bus node data" and the like. By displaying the detail information of the key field in the preview box of the key field, the user can quickly find out the data record corresponding to the key field which the user wants to query, and further input the data record into the query input box 31.
In one embodiment, the method may further include:
receiving a new request for a new mapping relation in the configuration file; and adding the new mapping relation into the configuration file.
When a redis database needs to be added, the address information of the third-party server corresponding to the redis database can be added into the configuration file, and the mapping relationship between the address information and the identification information of the third-party server is added into the configuration file correspondingly.
Correspondingly, the address information of the third-party server needing to be deleted can be deleted from the configuration file so as to modify the configuration file.
For example, when a developer needs to modify a configuration file, if configuration information of a system needs to be added, the developer may submit a new request of the configuration file to a server through a terminal, where the new request carries an IP address, a port number, and identification information of a third-party server corresponding to the newly added system, and after receiving the new request, the server extracts the IP address, the port number, and the identification information of the third-party server in the new request, constructs a new mapping relationship, and correspondingly adds the new mapping relationship to the configuration file.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating a display page of a query result according to an embodiment. As shown in fig. 4, the display page of the query result includes a query input box 41 corresponding to the data query request, a display box 42 of the query result, and a preview box 43 of the key field list. A key field list 431 is shown in the preview box 43 of the key field list. The query result display box 42 displays the query result 421 corresponding to the following query conditions:
“tes:table:tes_bus:id:9d05ad02f1f44e6ab842bdbb1d050dc4”
in one embodiment, the method further includes:
and acquiring original data in a preset database on the server, preprocessing the original data to obtain target data, and adding the target data into a second redis database.
Further, the method further comprises:
and when detecting that the preset database has data update, acquiring new data, preprocessing the new data, and adding the converted data into a corresponding group in a second redis database.
Referring to fig. 5, fig. 5 is a timing diagram illustrating a data loading process in the second redis database according to an embodiment. As shown in fig. 5, in the present application, data loading in the second redis database is performed in advance, and when data loading is performed, original data in a preset database is obtained, and the original data is preprocessed, where the preprocessing includes data format conversion, data grouping, and the like, and the preprocessed data is loaded into the second redis database, so that data loading of the second redis database is completed. Further, the terminal submits a data query request to the server, the server responds to the data query request, after a second redis database of the redis database to be queried is determined, cache data in the second redis database is queried to obtain a query result, and the query result is fed back to the terminal for display.
In one embodiment, as shown in fig. 6, a data query method is provided, which is described by taking the method as an example applied to the terminal in fig. 1, and includes the following steps:
and S21, receiving a triggering instruction of data query, and submitting a data query request to the server.
In the application, a data inquiry page is displayed on the terminal in advance, a virtual key for triggering a data inquiry instruction is displayed on the data inquiry page, and a user triggers the data inquiry instruction by clicking the virtual key.
And S22, after the receiving server determines the redis database to be queried according to the identification information of the third-party server in the data query request and the preset configuration file, the receiving server feeds back a query result according to the redis database to be queried.
In the application, after the terminal submits the data query request to the server, the server determines the redis database to be queried according to the data query request. Specifically, the server determines whether the data query request includes identification information of a third-party server, and determines the redis database to be queried according to the identification information and a preset configuration file when the data query request includes the identification information of the third-party server. And when the data query request does not comprise the identification information of the third-party server, taking the local second redis database as the redis database to be queried.
Specifically, the configuration file includes a mapping relationship between identification information of the third-party server and address information of the third-party server, and the server determines the redis database to be queried according to the identification information and a preset configuration file, which specifically includes the following steps:
and determining address information corresponding to the identification information according to the mapping relation between the identification information of the third-party server and the address information of the third-party server, determining the third-party server to which the address information points, and taking a first redis database on the third-party server as a to-be-queried redis database.
And S23, displaying the query result on a user interface.
In one embodiment, the configuration file includes a mapping relationship between identification information of the third-party server and address information of the third-party server, when the data query request includes the identification information of the third-party server, the redis database to be queried is a first redis database on the third-party server corresponding to the identification information in the configuration file, and when the data query request does not include the identification information of the third-party server, the redis database to be queried is a local second redis database. The method further comprises the following steps:
receiving a trigger instruction for accessing a target network address, and submitting an access request of the target network address to a server, wherein the target network address points to a data query page corresponding to the data query request;
receiving a preset page layout file and a key field information list corresponding to a data query page fed back by a server, wherein the key field information list comprises a first key field in a first redis database pointed by address information in a configuration file, identification information of a third party server to which each first key field belongs and each second key field in a second redis database, and preferably, the key field information list also comprises detail information of the first key field in each first redis database and detail information of each second key field in the second redis database;
and rendering and displaying the key field information list according to the preset page layout file so as to display the key field information list on a user interface.
In the application, the server sends the preset page layout file and the key field information list to the terminal. And the terminal renders and displays the preset page layout file and the key field information list, and correspondingly displays the key field information list in the specified control in the preset page layout file.
In the application, a user can enter a data query interface by inputting a specified target network address in a browser, a virtual key for triggering a data query instruction is provided on a data query page, the user can trigger the data query instruction by clicking the virtual key, the query of the redis data can be realized without installing a professional redis tool by the user, and the problems that in the prior art, the user needs to download the professional redis tool, execute the installation steps and configure corresponding environments, and bring complicated steps are solved.
According to the method and the device, after the key field information list is displayed on the user interface, a user can conveniently select the query condition corresponding to the key field to be queried from the key field information list, the data record corresponding to the query condition is further input into the query input box, the data is rapidly queried, the user does not need to learn the query command, and the problems that in the prior art, the user needs to learn the commonly used redis query command, and a large amount of time cost and learning cost of the user are consumed are solved.
In one embodiment, as shown in fig. 7, there is provided a data query control apparatus including:
the acquisition module 11 is configured to acquire a data query request submitted by a terminal;
the determining module 12 is configured to determine a redis database to be queried according to the identification information and a preset configuration file when the data query request includes the identification information of the third-party server;
and the feedback module 13 is configured to extract a key field in the data query request, obtain a field value corresponding to the key field from the redis database to be queried as a query result, and feed the query result back to the terminal.
In one embodiment, the configuration file includes a mapping relationship between identification information of a third-party server and address information of the third-party server, and the determining module 12 includes:
the first determining unit is used for determining address information corresponding to the identification information according to the mapping relation between the identification information of the third-party server and the address information of the third-party server;
determining a third-party server to which the address information points;
taking the first redis database on the third-party server as a redis database to be queried;
the determining module 12 further includes:
and the second determining unit is used for taking the local second redis database as the redis database to be queried when the data query request does not include the identification information of the third-party server.
Referring to fig. 8, in one embodiment, the apparatus further includes:
the starting module 14 is configured to receive a page display request of a data query page;
acquiring a preset page layout file corresponding to the data query request;
acquiring first key fields in a first redis database pointed by each address information in a configuration file and identification information of a third-party server to which each first key field belongs;
acquiring a second key field in a second redis database;
constructing a key field information list according to each first key field, the identification information of the third-party server to which each first key field belongs and each second key field;
and feeding back the key field information list and the preset page layout file to the terminal so that the terminal can display the key field list on a user interface according to the preset page layout file.
In one embodiment, the opening module 14 further includes:
the adding unit is used for respectively acquiring the detail information of the first key field in each first redis database and the detail information of each second key field in the second red is database;
and adding each piece of detail information into a key field information list.
Referring to fig. 8, in an embodiment, the apparatus further includes:
a configuration module 15, configured to receive a new request for a new mapping relationship in the configuration file;
and adding the new mapping relation into the configuration file.
In one embodiment, as shown in fig. 9, there is provided a data query apparatus including:
the first receiving module 21 is configured to receive a trigger instruction for data query, and submit a data query request to the server;
the second receiving module 22 is configured to receive a query result fed back by the server according to the redis database to be queried after the server determines the redis database to be queried according to the identification information of the third-party server in the data query request and a preset configuration file;
and the first display module 23 is configured to display the query result on the user interface.
Referring to fig. 10, in an embodiment, the configuration file includes mapping relationships between identification information of a plurality of third-party servers and address information of the third-party servers, when the data query request includes the identification information of the third-party servers, the redis database to be queried is a first redis database on the third-party server corresponding to the identification information in the configuration file, and when the data query request does not include the identification information of the third-party servers, the redis database to be queried is a local second redis database, and the apparatus further includes:
the second presentation module 24 is configured to receive a trigger instruction for accessing a target network address, and submit an access request of the target network address to the server, where the target network address points to a data query page corresponding to the data query request;
receiving a preset page layout file and a key field information list corresponding to a data query page fed back by a server, wherein the key field information list comprises a first key field in a first redis database pointed by address information in a configuration file, identification information of a third party server to which each first key field belongs and each second key field in a second redis database, and preferably, the key field information list also comprises detail information of the first key field in each first redis database and detail information of each second key field in the second redis database;
and rendering and displaying the key field information list according to the preset page layout file so as to display the key field information list on a user interface.
In one embodiment, a computer device is provided, which may be a service processing server, and its internal structure diagram may be as shown in fig. 11. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide the determining and controlling capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external first terminal through a network connection. The computer program is executed by a processor to implement a data query control method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: the method comprises the steps of obtaining a data query request submitted by a terminal, when the data query request comprises identification information of a third-party server, determining a redis database to be queried according to the identification information and a preset configuration file, extracting key fields in the data query request, obtaining field values corresponding to the key fields from the redis database to be queried as query results, and feeding the query results back to the terminal.
In an embodiment, the configuration file includes a mapping relationship between identification information of the third-party server and address information of the third-party server, and the processor executes the computer program to implement the step of determining the redis database to be queried according to the identification information and the preset configuration file, and specifically implements the following steps:
determining address information corresponding to the identification information according to the mapping relation between the identification information of the third-party server and the address information of the third-party server;
determining a third-party server to which the address information points;
taking the first redis database on the third-party server as a redis database to be queried;
the processor executing the computer program further specifically implements the steps of:
and when the identification information of the third-party server is not included in the data query request, taking the local second redis database as the redis database to be queried.
In one embodiment, the processor, when executing the computer program, further specifically implements the following steps:
receiving a page display request of a data query page;
acquiring a preset page layout file corresponding to the data query request;
acquiring first key fields in a first redis database pointed by each address information in a configuration file and identification information of a third-party server to which each first key field belongs;
acquiring a second key field in a second redis database;
constructing a key field information list according to each first key field, the identification information of the third-party server to which each first key field belongs and each second key field;
and feeding back the key field information list and the preset page layout file to the terminal so that the terminal can display the key field list on a user interface according to the preset page layout file.
In one embodiment, the processor, when executing the computer program, further specifically implements the following steps:
respectively acquiring the detail information of a first key field in each first redis database and the detail information of each second key field in a second redis database;
and adding each piece of detail information into a key field information list.
In one embodiment, the processor, when executing the computer program, further specifically implements the following steps:
receiving a new request for a new mapping relation in the configuration file;
and adding the new mapping relation into the configuration file.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: the method comprises the steps of obtaining a data query request submitted by a terminal, when the data query request comprises identification information of a third-party server, determining a redis database to be queried according to the identification information and a preset configuration file, extracting key fields in the data query request, obtaining field values corresponding to the key fields from the redis database to be queried as query results, and feeding the query results back to the terminal.
In an embodiment, the configuration file includes a mapping relationship between identification information of the third-party server and address information of the third-party server, and when the computer program is executed by the processor to implement the step of determining the redis database to be queried according to the identification information and the preset configuration file, the following steps are specifically implemented:
determining address information corresponding to the identification information according to the mapping relation between the identification information of the third-party server and the address information of the third-party server;
determining a third-party server to which the address information points;
taking the first redis database on the third-party server as a redis database to be queried;
the computer program when executed by the processor further realizes the steps of:
and when the identification information of the third-party server is not included in the data query request, taking the local second redis database as the redis database to be queried.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a page display request of a data query page;
acquiring a preset page layout file corresponding to the data query request;
acquiring first key fields in a first redis database pointed by each address information in a configuration file and identification information of a third-party server to which each first key field belongs;
acquiring a second key field in a second redis database;
constructing a key field information list according to each first key field, the identification information of the third-party server to which each first key field belongs and each second key field;
and feeding back the key field information list and the preset page layout file to the terminal so that the terminal can display the key field list on a user interface according to the preset page layout file.
In one embodiment, the computer program when executed by the processor further performs the steps of:
respectively acquiring the detail information of a first key field in each first redis database and the detail information of each second key field in a second redis database;
and adding each piece of detail information into a key field information list.
In one embodiment, the computer program when executed by the processor further performs the steps of:
receiving a new request for a new mapping relation in the configuration file;
and adding the new mapping relation into the configuration file.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 12. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a data query method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: the method comprises the steps of receiving a triggering instruction of data query, submitting a data query request to a server, receiving a query result fed back by the server according to a third-party server identification information in the data query request and a preset configuration file, and displaying the query result on a user interface according to the query result fed back by the redis database to be queried.
In one embodiment, the configuration file includes a mapping relationship between identification information of a plurality of third-party servers and address information of the third-party servers, when the data query request includes the identification information of the third-party servers, the redis database to be queried is a first redis database on the third-party server corresponding to the identification information in the configuration file, and when the data query request does not include the identification information of the third-party servers, the redis database to be queried is a local second redis database, and when the processor executes the computer program, the following steps are further specifically implemented:
receiving a trigger instruction for accessing a target network address, and submitting an access request of the target network address to a server, wherein the target network address points to a data query page corresponding to the data query request;
receiving a preset page layout file and a key field information list corresponding to a data query page fed back by a server, wherein the key field information list comprises a first key field in a first redis database pointed by address information in a configuration file, identification information of a third party server to which each first key field belongs and each second key field in a second redis database, and preferably, the key field information list also comprises detail information of the first key field in each first redis database and detail information of each second key field in the second redis database;
and rendering and displaying the key field information list according to the preset page layout file so as to display the key field information list on a user interface.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: the method comprises the steps of receiving a triggering instruction of data query, submitting a data query request to a server, receiving a query result fed back by the server according to a third-party server identification information in the data query request and a preset configuration file, and displaying the query result on a user interface according to the query result fed back by the redis database to be queried.
In one embodiment, the configuration file includes a mapping relationship between identification information of a plurality of third-party servers and address information of the third-party servers, when the data query request includes identification information of the third-party servers, the redis database to be queried is a first redis database on the third-party server corresponding to the identification information in the configuration file, and when the data query request does not include identification information of the third-party servers, the redis database to be queried is a local second redis database, and when the computer program is executed by the processor, the following steps are further implemented:
receiving a trigger instruction for accessing a target network address, and submitting an access request of the target network address to a server, wherein the target network address points to a data query page corresponding to the data query request;
receiving a preset page layout file and a key field information list corresponding to a data query page fed back by a server, wherein the key field information list comprises a first key field in a first redis database pointed by address information in a configuration file, identification information of a third party server to which each first key field belongs and each second key field in a second redis database, and preferably, the key field information list also comprises detail information of the first key field in each first redis database and detail information of each second key field in the second redis database;
and rendering and displaying the key field information list according to the preset page layout file so as to display the key field information list on a user interface.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above examples only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A data query control method, the method comprising:
acquiring a data query request submitted by a terminal;
when the data query request comprises identification information of a third-party server, determining a redis database to be queried according to the identification information and a preset configuration file;
and extracting key fields in the data query request, acquiring field values corresponding to the key fields from the to-be-queried redis database as query results, and feeding the query results back to the terminal.
2. The method according to claim 1, wherein the configuration file includes a mapping relationship between identification information of a third-party server and address information of the third-party server, and the determining a redis database to be queried according to the identification information and a preset configuration file includes:
determining address information corresponding to the identification information according to the mapping relation between the identification information of the third-party server and the address information of the third-party server;
determining a third-party server to which the address information points;
taking the first redis database on the third-party server as the to-be-queried redis database;
the method further comprises the following steps:
and when the data query request does not comprise the identification information of the third-party server, taking a local second redis database as the to-be-queried redis database.
3. The method of claim 2, further comprising:
receiving a page display request of a data query page;
acquiring a preset page layout file corresponding to the data query request;
acquiring first key fields in a first redis database pointed by each address information in the configuration file and identification information of a third party server to which each first key field belongs;
acquiring a second key field in the second redis database;
constructing a key field information list according to each first key field, the identification information of the third-party server to which each first key field belongs and each second key field;
and feeding back the key field information list and the preset page layout file to the terminal so that the terminal can display the key field list on a user interface according to the preset page layout file.
4. The method of claim 3, further comprising:
respectively acquiring the detail information of a first key field in each first redis database and the detail information of each second key field in a second redis database;
and adding each piece of detail information into the key field information list.
5. The method of claim 2, further comprising:
receiving a new request for a new mapping relation in the configuration file;
and adding the new mapping relation into the configuration file.
6. A method for data query, the method comprising:
receiving a triggering instruction of data query, and submitting a data query request to a server;
after the server determines a redis database to be queried according to the identification information of the third-party server in the data query request and a preset configuration file, a query result fed back according to the redis database to be queried is received;
and displaying the query result on a user interface.
7. The method according to claim 6, wherein the configuration file includes a mapping relationship between identification information of the third-party server and address information of the third-party server, when the data query request includes the identification information of the third-party server, the to-be-queried redis database is a first redis database on the third-party server corresponding to the identification information in the configuration file, and when the data query request does not include the identification information of the third-party server, the to-be-queried redis database is a local second redis database, the method further comprising:
receiving a trigger instruction for accessing a target network address, and submitting an access request of the target network address to a server, wherein the target network address points to a data query page corresponding to the data query request;
receiving a preset page layout file and a key field information list corresponding to the data query page fed back by the server, wherein the key field information list comprises first key fields in a first redis database pointed by address information in the configuration file, identification information of a third party server to which the first key fields belong and second key fields in a second redis database, and preferably, the key field information list further comprises detail information of the first key fields in the first redis databases and detail information of the second key fields in the second redis database;
and rendering and displaying the key field information list according to the preset page layout file so as to display the key field information list on a user interface.
8. A redis-based data query control apparatus, the apparatus comprising:
the acquisition module is used for acquiring a data query request submitted by a terminal;
the determining module is used for determining a to-be-queried redis database according to the identification information and a preset configuration file when the data query request comprises the identification information of the third-party server;
and the feedback module is used for acquiring field values corresponding to the key fields in the data query request from the to-be-queried redis database as query results and feeding the query results back to the terminal.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN201911190565.XA 2019-11-28 2019-11-28 Data query method, control device, control medium and computer equipment Active CN111125169B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911190565.XA CN111125169B (en) 2019-11-28 2019-11-28 Data query method, control device, control medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911190565.XA CN111125169B (en) 2019-11-28 2019-11-28 Data query method, control device, control medium and computer equipment

Publications (2)

Publication Number Publication Date
CN111125169A true CN111125169A (en) 2020-05-08
CN111125169B CN111125169B (en) 2022-08-19

Family

ID=70496960

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911190565.XA Active CN111125169B (en) 2019-11-28 2019-11-28 Data query method, control device, control medium and computer equipment

Country Status (1)

Country Link
CN (1) CN111125169B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666265A (en) * 2020-06-04 2020-09-15 南京领行科技股份有限公司 Data management method, device, server and storage medium
CN111708848A (en) * 2020-06-12 2020-09-25 北京思特奇信息技术股份有限公司 Data query method and system and electronic equipment
CN111901159A (en) * 2020-07-15 2020-11-06 中盈优创资讯科技有限公司 Method and device for replacing equipment configuration ports in batches
CN112541143A (en) * 2020-12-17 2021-03-23 青岛以萨数据技术有限公司 Asynchronous picture acquisition method and system
CN112749215A (en) * 2020-12-31 2021-05-04 成都泛微网络科技有限公司 Data display method and related equipment
CN113190870A (en) * 2021-05-27 2021-07-30 新华三技术有限公司 Redis database access authority control method and device
CN113190605A (en) * 2021-04-30 2021-07-30 携程商旅信息服务(上海)有限公司 Ticket price display method and system, electronic equipment and storage medium
CN113220713A (en) * 2021-04-30 2021-08-06 北京达佳互联信息技术有限公司 Data query method and device, electronic equipment and storage medium
CN114077619A (en) * 2020-08-20 2022-02-22 北京字节跳动网络技术有限公司 Data query method and device, electronic equipment and storage medium
CN116995816A (en) * 2023-09-25 2023-11-03 国网山东省电力公司淄博供电公司 Power supply data processing platform and method based on artificial intelligence

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804548A (en) * 2018-05-21 2018-11-13 上海陆家嘴国际金融资产交易市场股份有限公司 Test data querying method, device, computer equipment and storage medium
CN109710655A (en) * 2018-11-09 2019-05-03 中国平安人寿保险股份有限公司 Data base query method, device, terminal device and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804548A (en) * 2018-05-21 2018-11-13 上海陆家嘴国际金融资产交易市场股份有限公司 Test data querying method, device, computer equipment and storage medium
CN109710655A (en) * 2018-11-09 2019-05-03 中国平安人寿保险股份有限公司 Data base query method, device, terminal device and storage medium

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666265A (en) * 2020-06-04 2020-09-15 南京领行科技股份有限公司 Data management method, device, server and storage medium
CN111666265B (en) * 2020-06-04 2022-06-24 南京领行科技股份有限公司 Data management method, device, server and storage medium
CN111708848A (en) * 2020-06-12 2020-09-25 北京思特奇信息技术股份有限公司 Data query method and system and electronic equipment
CN111708848B (en) * 2020-06-12 2024-02-23 北京思特奇信息技术股份有限公司 Data query method, system and electronic equipment
CN111901159A (en) * 2020-07-15 2020-11-06 中盈优创资讯科技有限公司 Method and device for replacing equipment configuration ports in batches
CN111901159B (en) * 2020-07-15 2023-04-07 中盈优创资讯科技有限公司 Method and device for replacing equipment configuration ports in batches
CN114077619A (en) * 2020-08-20 2022-02-22 北京字节跳动网络技术有限公司 Data query method and device, electronic equipment and storage medium
CN112541143B (en) * 2020-12-17 2022-08-19 青岛以萨数据技术有限公司 Asynchronous picture acquisition method and system
CN112541143A (en) * 2020-12-17 2021-03-23 青岛以萨数据技术有限公司 Asynchronous picture acquisition method and system
CN112749215B (en) * 2020-12-31 2023-03-17 成都泛微网络科技有限公司 Data display method and related equipment
CN112749215A (en) * 2020-12-31 2021-05-04 成都泛微网络科技有限公司 Data display method and related equipment
CN113220713A (en) * 2021-04-30 2021-08-06 北京达佳互联信息技术有限公司 Data query method and device, electronic equipment and storage medium
CN113190605A (en) * 2021-04-30 2021-07-30 携程商旅信息服务(上海)有限公司 Ticket price display method and system, electronic equipment and storage medium
CN113220713B (en) * 2021-04-30 2024-01-09 北京达佳互联信息技术有限公司 Data query method and device, electronic equipment and storage medium
CN113190870A (en) * 2021-05-27 2021-07-30 新华三技术有限公司 Redis database access authority control method and device
CN116995816A (en) * 2023-09-25 2023-11-03 国网山东省电力公司淄博供电公司 Power supply data processing platform and method based on artificial intelligence
CN116995816B (en) * 2023-09-25 2024-02-23 国网山东省电力公司淄博供电公司 Power supply data processing platform and method based on artificial intelligence

Also Published As

Publication number Publication date
CN111125169B (en) 2022-08-19

Similar Documents

Publication Publication Date Title
CN111125169B (en) Data query method, control device, control medium and computer equipment
CN109582303B (en) General component calling method, device, computer equipment and storage medium
CN108304498B (en) Webpage data acquisition method and device, computer equipment and storage medium
CN109814854B (en) Project framework generation method, device, computer equipment and storage medium
WO2020151333A1 (en) Page loading method, apparatus, computer device and storage medium
CN111596965B (en) Project engineering initialization method, device, computer equipment and storage medium
EP3547145A2 (en) Systems and methods for reducing storage required for code coverage results
WO2020006864A1 (en) Browser input box display method and apparatus, computer device, and storage medium
CN108959384B (en) Webpage data acquisition method and device, computer equipment and storage medium
CN112000903B (en) Data query method and device, computer equipment and storage medium
WO2021159783A1 (en) Web page interface query method and apparatus, electronic device, and storage medium
CN108415998B (en) Application dependency relationship updating method, terminal, device and storage medium
CN109787974A (en) Message data stream generating method, device, computer equipment and storage medium
CN112306620B (en) Multi-language loading method and device for user-defined form control
CN111431767B (en) Multi-browser resource synchronization method and device, computer equipment and storage medium
CN111767297B (en) Big data processing method, device, equipment and medium
CN110750443A (en) Webpage testing method and device, computer equipment and storage medium
CN114611481A (en) Template configuration method and device, computer equipment and storage medium
WO2019071898A1 (en) Electronic device, database query script generation method and storage medium
CN112231379A (en) API (application program interface) auditing method, device, equipment and storage medium based on micro-service architecture
US20190124082A1 (en) Cross Device User Identification
CN109542962B (en) Data processing method, data processing device, computer equipment and storage medium
CN114003432A (en) Parameter checking method and device, computer equipment and storage medium
CN115145674A (en) Page jump method, device, equipment and medium based on dynamic anchor point
CN109871214B (en) Program code generation method, program code generation device, computer device, 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
GR01 Patent grant
GR01 Patent grant