CN110765168A - Data searching method and device based on user information - Google Patents

Data searching method and device based on user information Download PDF

Info

Publication number
CN110765168A
CN110765168A CN201911061021.3A CN201911061021A CN110765168A CN 110765168 A CN110765168 A CN 110765168A CN 201911061021 A CN201911061021 A CN 201911061021A CN 110765168 A CN110765168 A CN 110765168A
Authority
CN
China
Prior art keywords
information
user login
token
user
cache
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
CN201911061021.3A
Other languages
Chinese (zh)
Other versions
CN110765168B (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.)
DINGDIAN SOFTWARE Co Ltd FUJIAN
Original Assignee
DINGDIAN SOFTWARE Co Ltd FUJIAN
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 DINGDIAN SOFTWARE Co Ltd FUJIAN filed Critical DINGDIAN SOFTWARE Co Ltd FUJIAN
Priority to CN201911061021.3A priority Critical patent/CN110765168B/en
Publication of CN110765168A publication Critical patent/CN110765168A/en
Application granted granted Critical
Publication of CN110765168B publication Critical patent/CN110765168B/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/24552Database cache management

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a data searching method and a device based on user information, wherein the method comprises the following steps: acquiring user login information, and generating corresponding token information according to the user login information; estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the token information and the associated information, and storing the corresponding relation into a cache unit; and receiving the service request containing the token information, and acquiring the association attribute required by the current service request from the cache unit according to the token information. According to the scheme, the token information and the associated attribute are bound in advance, the corresponding associated attribute information is stored in the cache unit in advance, when a user initiates a service request by means of the token information, the associated attribute can be directly called from the cache unit, and the problem of high delay caused by repeated inquiry in the prior art is effectively solved.

Description

Data searching method and device based on user information
Technical Field
The invention relates to the field of memory design, in particular to a data searching method and device based on user information.
Background
Currently, when designing concurrent low-latency systems, it is required that each service request be processed as quickly as possible. A robust and reliable service request may have more processing flows, and the overall logic may be more during processing. Taking a client initiating a service operation as an example, the prior art process is to verify whether the client logs in, then verify whether the client request parameter is valid, and then verify other additional contents. After all the contents needing to be verified pass, some associated attribute data needed by the current service request are inquired, and the more associated attributes with inquiry, the more times of circular inquiry are needed.
As shown in fig. 1, when a service request is processed by using a prior art method, N pieces of associated attribute data of a user generally need to be acquired at a time, each associated attribute acquisition needs to be queried once, so that N steps need to be performed only by querying data, and the total data takes a long time.
Disclosure of Invention
Therefore, a technical scheme for searching data based on user information is needed to be provided, so as to solve the problem that service request processing is time-consuming.
To achieve the above object, the inventor provides a data searching method based on user information, the method comprising the following steps:
acquiring user login information, and generating corresponding token information according to the user login information;
estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the token information and the associated information, and storing the corresponding relation into a cache unit;
and receiving the service request containing the token information, and acquiring the association attribute required by the current service request from the cache unit according to the token information.
Further, "establishing a correspondence between the token information and the association information" includes:
and establishing a cache table structure according to the token information, wherein the cache table structure comprises a plurality of cache substructures, one cache substructure is used for storing the token information, and the other cache substructures are used for storing the memory address corresponding to the association attribute.
Further, the method comprises:
step S1: and reading the memory address to obtain the corresponding associated attribute.
Further, the method comprises:
judging whether the cache table structure contains token information corresponding to the current service request, if so, executing step S1, otherwise, executing step S2: the access request is refused.
Further, the method comprises:
in the cache substructure which does not store the token information, the reserved part of the cache substructure does not store the associated attribute information.
Further, "generating corresponding token information according to the user login information" includes:
and generating unique token information according to the user login time, the influence factor and the random number, wherein the influence factor is determined according to the service request.
Further, the method comprises:
when the user login information is acquired, judging whether the user login information passes verification, if so, generating corresponding token information according to the user login information; otherwise, quitting the login.
The inventors also provide a data lookup apparatus based on user information, said apparatus being adapted to perform the method as described hereinbefore.
The inventor also provides a data searching method based on user information, which comprises the following steps:
acquiring user login information;
estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the user login information and the associated information, and storing the corresponding relation into a cache unit;
and receiving a service request containing user login information, and acquiring the association attribute required by the current service request from the cache unit according to the user login information.
The inventors also provide a data lookup apparatus based on user information, said apparatus being adapted to perform the method as described hereinbefore.
Further, the apparatus processes the service request according to the method as described in any of the preceding.
The data searching method and device based on the user information in the technical scheme comprise the following steps: acquiring user login information, and generating corresponding token information according to the user login information; estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the token information and the associated information, and storing the corresponding relation into a cache unit; and receiving the service request containing the token information, and acquiring the association attribute required by the current service request from the cache unit according to the token information. Alternatively, the method comprises: acquiring user login information; estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the user login information and the associated information, and storing the corresponding relation into a cache unit; and receiving a service request containing user login information, and acquiring the association attribute required by the current service request from the cache unit according to the user login information.
According to the scheme, the user login information or the token information is bound with the associated attribute in advance, the corresponding associated attribute information is stored in the cache unit in advance, when the user initiates a service request by virtue of the login information or the token information, the associated attribute can be directly called from the cache unit, and the problem of high delay caused by repeated query in the prior art is effectively solved.
Drawings
FIG. 1 is a flow chart of a prior art data lookup method based on user information;
FIG. 2 is a flowchart of a data search method based on user information according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a data searching method based on user information according to another embodiment of the present invention;
FIG. 4 is a flowchart illustrating a data searching method based on user information according to another embodiment of the present invention;
FIG. 5 is a flowchart illustrating a data searching method based on user information according to another embodiment of the present invention;
FIG. 6 is a diagram illustrating a cache table structure according to another embodiment of the present invention;
fig. 7 is a schematic diagram of a data search apparatus based on user information according to an embodiment of the present invention.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Fig. 1 is a flowchart of a data searching method based on user information according to an embodiment of the present invention. In the prior art, in the process of processing a service request, a client initiates the service request firstly, and then a system verifies whether a client request parameter is valid or not, some attribute data associated with the client is inevitably needed when the service request is processed, according to the prior art, the client needs to initiate the request to acquire every time the attribute data is needed, if N attribute data needs to be acquired, N times of cyclic query are needed, and the total time consumption of the data is prolonged.
To solve the problem in the prior art in fig. 1, the present application provides a data searching method based on user information, please refer to fig. 5, where the method includes the following steps:
firstly, step S501 is entered to obtain user login information, and corresponding token information is generated according to the user login information.
The user login information refers to authentication information input when a user logs in the service system, such as a client account number, a password and the like. The Token information is Token, which is an object representing the right of the user to perform subsequent operations (such as initiating a service request).
In order to ensure the uniqueness of the token information, in this embodiment, "generating the corresponding token information according to the user login information" includes: and generating unique token information according to the user login time, the influence factor and the random number, wherein the influence factor is determined according to the service request. The user login time refers to the time when the user logs in the business system, the random number refers to a string of characters randomly generated by the random number generator, and the influence factor can be configured according to the type of the current business system, for example, when the business system is a bank system, the influence factor can be assigned as a string of specific characters. Of course, in other embodiments, the token information may also be designed as a string of integer numbers, thereby improving the computing power of the CPU.
And then, the method proceeds to step S502 to pre-estimate the associated attribute information corresponding to the user login information, establish the corresponding relationship between the token information and the associated information, and store the corresponding relationship into a cache unit.
Preferably, in this embodiment, the cache unit is a memory. The associated attribute information refers to basic data required by the user in the service processing process, and the basic data generally depends on the type of the service system which the user logs in. For example, after a user inputs login information, a certain associated attribute a and another associated attribute B corresponding to the user are queried in advance by a certain service system, and then the associated information a and B may be stored in a cache unit for subsequent invocation. The associated attribute information corresponding to the user may be determined according to historical data of a service request initiated by a previous user, preferably, the priority of the associated attribute corresponding to the user may be determined according to the time sequence of initiating the service request and the number of times of being called, and specifically, a certain weight value may be set for the time and the number of times of being called of the associated attribute, so as to comprehensively estimate the associated attribute value most likely to be used in the login.
Then, step S503 is executed to receive the service request containing the token information, and obtain the association attribute required by the current service request from the cache unit according to the token information.
Because the association attribute is pre-stored in the cache unit, when the association attribute needs to be called, the association attribute only needs to be directly acquired from the cache unit, so that the query times are effectively saved, the data query time is shortened, and the data query efficiency is improved.
In some embodiments, establishing the correspondence between the token information and the association information includes: and establishing a cache table structure according to the token information, wherein the cache table structure comprises a plurality of cache substructures, one cache substructure is used for storing the token information, and the other cache substructures are used for storing the memory address corresponding to the association attribute. The method comprises the following steps: step S1: and reading the memory address to obtain the corresponding associated attribute. Preferably, the method comprises: in the cache substructure which does not store the token information, the reserved part of the cache substructure does not store the associated attribute information.
For example, a certain associated attribute a of the client is queried in advance, and the memory address P1 of the associated attribute information is obtained; inquiring another correlation attribute B of the client in advance to obtain a memory address P2 of the information; by analogy, N association sequences N can be inquired in advance; meanwhile, memory addresses corresponding to the N associated attributes can be recorded.
As shown in fig. 6, the present invention designs a cache table structure of a token, which is used to store token information corresponding to a client (i.e. user login information) and memory address information of associated data bound to the token information. As shown in fig. 6, the token cache table structure may be represented in the following manner: TOKEN, P1 (associated with attribute 1 memory address), P2 … PN (associated with attribute N memory address). The number of attributes of the associated data can be counted according to the known services, and meanwhile, several table fields are reserved in the cache table structure for expanding new associated attributes. Thus, when a new association attribute needs to be added, a smooth transition can be achieved without modifying the table structure. Preferably, 3 cache substructures are reserved which do not store the associated attributes. After the cache table structure is generated, a corresponding relationship between the token information and the associated information is established, and the corresponding relationship is stored in a cache unit (such as a memory).
In certain embodiments, the method comprises: judging whether the cache table structure contains token information corresponding to the current service request, if so, executing step S1, otherwise, executing step S2: the access request is refused. In short, only when the token information is recorded in the cache table structure, the reading of the associated attribute information by the service request is supported, so that abnormal access can be avoided. Taking the business request of the financial industry as an example, the associated attribute information for the customer may be funds, an account number, and the like.
In certain embodiments, the method comprises: when the user login information is acquired, judging whether the user login information passes verification, if so, generating corresponding token information according to the user login information; otherwise, quitting the login. In short, the corresponding token information is generated only after the login information input by the user is successfully verified, and then the subsequent steps are executed to read the associated attribute. Thus, the data security can be effectively improved.
As shown in fig. 5, the present invention further provides a data searching method based on user information, wherein the method comprises the following steps:
firstly, step S401 is entered to obtain user login information;
then, entering step S402 to pre-estimate the associated attribute information corresponding to the user login information, establishing the corresponding relation between the user login information and the associated information, and storing the corresponding relation into a cache unit;
then, step S403 is performed to receive the service request containing the user login information, and obtain the association attribute required by the current service request from the cache unit according to the user login information.
In this embodiment, after the user logs in the service system by means of the login information, the user can directly initiate a service request by means of the login information, and the association attribute required by the service request is pre-stored in the cache unit, so that the access efficiency is improved.
As shown in fig. 2, when the data search method based on user information is implemented, the method first proceeds to step S100, where a user logs in, and the user can complete the client login by inputting user login information. The process then proceeds to step S110 to generate a client token, which is preferably generated based on the user login information. Then, step S120 is performed to associate the binding token with the client property, which is associated property information, which can be obtained according to the usage habit prediction of the user, such as associated properties 1-3 in fig. 2. And then, the steps of caching the token and the attribute data are carried out, namely, the token information and the associated attribute are cached in the caching unit, and when the associated attribute needs to be obtained, the token information and the associated attribute can be directly called from the caching unit, so that the efficiency is effectively improved.
As shown in fig. 3, after the corresponding relationship between the association attribute and the token information is stored in the cache unit, step S200 may be entered to initiate a service request including the token information, step S210 is then entered to determine whether the token is valid, if not, the request is directly rejected, step S220 is entered to cache the primary location token data, step S230 is then entered to read the attribute value according to the token, and then step S240 is entered to execute a subsequent service request.
And when the token information corresponding to the current user login information exists in the cache table structure, acquiring the associated attribute corresponding to the token information. And managing the data of the cache table structure in the cache unit by adopting an LRU (least recently used) algorithm to eliminate the token data with less use, so that the token data with frequent use is preferentially stored in the cache, the token data is positioned once, and the effect of accessing the token at the highest speed is achieved.
As shown in fig. 7, the present invention further provides a data search apparatus based on user information, which is used to execute the method described above. The apparatus comprises a processor 10 and a memory 20, the memory 20 having stored therein a computer program which, when executed by the processor, implements the method as described hereinbefore.
The invention provides a data searching method and a device based on user information, wherein the method comprises the following steps: acquiring user login information, and generating corresponding token information according to the user login information; estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the token information and the associated information, and storing the corresponding relation into a cache unit; and receiving the service request containing the token information, and acquiring the association attribute required by the current service request from the cache unit according to the token information. Alternatively, the method comprises: acquiring user login information; estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the user login information and the associated information, and storing the corresponding relation into a cache unit; and receiving a service request containing user login information, and acquiring the association attribute required by the current service request from the cache unit according to the user login information.
According to the scheme, the user login information or the token information is bound with the associated attribute in advance, the corresponding associated attribute information is stored in the cache unit in advance, when the user initiates a service request by virtue of the login information or the token information, the associated attribute can be directly called from the cache unit, and the problem of high delay caused by repeated query in the prior art is effectively solved.
It should be noted that, although the above embodiments have been described herein, the invention is not limited thereto. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.

Claims (10)

1. A data searching method based on user information is characterized by comprising the following steps:
acquiring user login information, and generating corresponding token information according to the user login information;
estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the token information and the associated information, and storing the corresponding relation into a cache unit;
and receiving the service request containing the token information, and acquiring the association attribute required by the current service request from the cache unit according to the token information.
2. The method according to claim 1, wherein the step of establishing the correspondence between the token information and the association information comprises:
and establishing a cache table structure according to the token information, wherein the cache table structure comprises a plurality of cache substructures, one cache substructure is used for storing the token information, and the other cache substructures are used for storing the memory address corresponding to the association attribute.
3. The method of claim 2, wherein the method comprises:
step S1: and reading the memory address to obtain the corresponding associated attribute.
4. The method of claim 3, wherein the method comprises:
judging whether the cache table structure contains token information corresponding to the current service request, if so, executing step S1, otherwise, executing step S2: the access request is refused.
5. The method of claim 2, wherein the method comprises:
in the cache substructure which does not store the token information, the reserved part of the cache substructure does not store the associated attribute information.
6. The method as claimed in claim 1, wherein generating the corresponding token information according to the user login information comprises:
and generating unique token information according to the user login time, the influence factor and the random number, wherein the influence factor is determined according to the service request.
7. The method of claim 1, wherein the method comprises:
when the user login information is acquired, judging whether the user login information passes verification, if so, generating corresponding token information according to the user login information; otherwise, quitting the login.
8. A data lookup apparatus based on user information, the apparatus being adapted to perform the method of any one of claims 1 to 7.
9. A data searching method based on user information is characterized by comprising the following steps:
acquiring user login information;
estimating associated attribute information corresponding to user login information, establishing a corresponding relation between the user login information and the associated information, and storing the corresponding relation into a cache unit;
and receiving a service request containing user login information, and acquiring the association attribute required by the current service request from the cache unit according to the user login information.
10. A data lookup apparatus based on user information, the apparatus being adapted to perform the method of claim 9.
CN201911061021.3A 2019-11-01 2019-11-01 Data searching method and device based on user information Active CN110765168B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911061021.3A CN110765168B (en) 2019-11-01 2019-11-01 Data searching method and device based on user information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911061021.3A CN110765168B (en) 2019-11-01 2019-11-01 Data searching method and device based on user information

Publications (2)

Publication Number Publication Date
CN110765168A true CN110765168A (en) 2020-02-07
CN110765168B CN110765168B (en) 2022-11-11

Family

ID=69335834

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911061021.3A Active CN110765168B (en) 2019-11-01 2019-11-01 Data searching method and device based on user information

Country Status (1)

Country Link
CN (1) CN110765168B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767315A (en) * 2020-06-29 2020-10-13 北京奇艺世纪科技有限公司 Black product identification method and device, electronic equipment and storage medium
CN112019343A (en) * 2020-07-28 2020-12-01 苏州浪潮智能科技有限公司 OpenStack token optimization method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105991293A (en) * 2016-07-26 2016-10-05 努比亚技术有限公司 Verification method and verification device
CN107222460A (en) * 2017-05-03 2017-09-29 飞天诚信科技股份有限公司 A kind of shared method and device of server data memory space
CN107908695A (en) * 2017-10-31 2018-04-13 平安普惠企业管理有限公司 Operation system operation method, device, system and readable storage medium storing program for executing
US10127391B1 (en) * 2015-12-28 2018-11-13 EMC IP Holding Company LLC Encrypted search indexes
CN109962908A (en) * 2019-01-22 2019-07-02 深圳壹账通智能科技有限公司 Right management method, device, equipment and storage medium based on token

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10127391B1 (en) * 2015-12-28 2018-11-13 EMC IP Holding Company LLC Encrypted search indexes
CN105991293A (en) * 2016-07-26 2016-10-05 努比亚技术有限公司 Verification method and verification device
CN107222460A (en) * 2017-05-03 2017-09-29 飞天诚信科技股份有限公司 A kind of shared method and device of server data memory space
CN107908695A (en) * 2017-10-31 2018-04-13 平安普惠企业管理有限公司 Operation system operation method, device, system and readable storage medium storing program for executing
CN109962908A (en) * 2019-01-22 2019-07-02 深圳壹账通智能科技有限公司 Right management method, device, equipment and storage medium based on token

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767315A (en) * 2020-06-29 2020-10-13 北京奇艺世纪科技有限公司 Black product identification method and device, electronic equipment and storage medium
CN111767315B (en) * 2020-06-29 2023-07-04 北京奇艺世纪科技有限公司 Black product identification method and device, electronic equipment and storage medium
CN112019343A (en) * 2020-07-28 2020-12-01 苏州浪潮智能科技有限公司 OpenStack token optimization method and system
CN112019343B (en) * 2020-07-28 2022-12-23 苏州浪潮智能科技有限公司 OpenStack token optimization method and system

Also Published As

Publication number Publication date
CN110765168B (en) 2022-11-11

Similar Documents

Publication Publication Date Title
EP3164795B1 (en) Prompting login account
CN106933854B (en) Short link processing method and device and server
US8370908B2 (en) Decreasing login latency
JP2016508633A (en) Method for executing user authentication, computer program, and computer system
CN111030812A (en) Token verification method, device, storage medium and server
CN110765168B (en) Data searching method and device based on user information
JP6859518B2 (en) How to prevent attacks on servers and devices
US20110302315A1 (en) Distributed services authorization management
EP3471010A1 (en) Generic runtime protection for transactional data
CN110581835B (en) Vulnerability detection method and device and terminal equipment
CN113949579B (en) Website attack defense method and device, computer equipment and storage medium
US20230319038A1 (en) Virtual credential authentication based on browsing context
US20150295918A1 (en) User authentication system in web mash-up circumstance and authenticating method thereof
CN112804222A (en) Data transmission method, device, equipment and storage medium based on cloud deployment
CN109063461B (en) Third-party password-free login method and system
US8281000B1 (en) Variable-length nonce generation
CN111179524B (en) ATM (automatic Teller machine) card retaining and retrieving method and device
CN111488568B (en) Client method, device, equipment and storage medium
CN112367302A (en) Identity authentication method and system suitable for chrome browser
US10454945B1 (en) Method, apparatus and computer program product for processing an electronic request to access a computerized resource
CN107517177B (en) Interface authorization method and device
WO2019203943A1 (en) Validation of short authentication data with a zero knowledge proof
CN116522395B (en) Method and system for processing data files in big data storage system
US12008550B2 (en) Post-provisioning authentication protocols
CN109801092B (en) Resource security management method, device, computer 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
GR01 Patent grant
GR01 Patent grant