CN110765168B - Data searching method and device based on user information - Google Patents
Data searching method and device based on user information Download PDFInfo
- Publication number
- CN110765168B CN110765168B CN201911061021.3A CN201911061021A CN110765168B CN 110765168 B CN110765168 B CN 110765168B CN 201911061021 A CN201911061021 A CN 201911061021A CN 110765168 B CN110765168 B CN 110765168B
- Authority
- CN
- China
- Prior art keywords
- information
- token
- user
- user login
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24552—Database 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
Technical Field
The present invention relates to the field of memory design, and in particular, to a data searching method and apparatus 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. And after all the contents needing to be verified pass, querying some associated attribute data required by the current service request, wherein the more associated attributes with query are, the more times of cyclic query are required.
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, and each associated attribute acquisition needs to be queried once, so that N steps need to be performed only for querying data, and the total data is time-consuming.
Disclosure of Invention
Therefore, a technical solution for searching data based on user information is needed to solve the problem of long time consumption in processing service requests.
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 addresses corresponding to the association attributes.
Further, the method comprises:
step S1: and reading the memory address to obtain the corresponding correlation attribute.
Further, the method comprises:
judging whether the cache table structure contains token information corresponding to the current service request, if so, executing the step S1, otherwise, executing the 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, the apparatus being configured to perform the method as described above.
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 schematic flowchart of 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 a client is inquired in advance, and a memory address P1 of the associated attribute information is acquired; 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 can be represented in the following manner: TOKEN, P1 (associated with attribute 1 memory address), P2 \8230, 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 that do not store the associated attributes. After the cache table structure is generated, a corresponding relationship between the token information and the association 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 the step S1, otherwise, executing the 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, and if so, generating corresponding token information according to the user login information; otherwise, logging out. 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 executed 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 using the login information, the user can directly initiate a service request by using the login information, and the association attribute required by the service request is stored in the cache unit in advance, so that the access efficiency is improved.
As shown in fig. 2, when the data searching method based on user information of the present application is implemented, step S100 is first entered for client login, and a user may complete 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 which is less used, and preferentially storing the token data which is frequently used in the cache, thereby realizing the effect of positioning the token data once and achieving the effect of accessing the token at the highest speed.
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 (4)
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; generating corresponding token information according to the user login information comprises: generating unique token information according to user login time, an influence factor and a random number, wherein the influence factor is determined according to a service request;
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;
receiving a service request containing token information, judging whether a cache table structure contains token information corresponding to the current service request, if so, executing the step S1: obtaining the corresponding correlation attribute by reading the memory address, otherwise executing the step S2: refusing the access request;
establishing the corresponding relation between the token information and the associated information comprises the following steps: 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.
2. The method of claim 1, 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.
3. The user information-based data lookup method as claimed in claim 1, characterized in that the method comprises:
when the user login information is acquired, judging whether the user login information passes verification, and if so, generating corresponding token information according to the user login information; otherwise, logging out.
4. A data lookup apparatus based on user information, the apparatus being adapted to perform the method of any one of claims 1 to 3.
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 CN110765168A (en) | 2020-02-07 |
CN110765168B true 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) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111767315B (en) * | 2020-06-29 | 2023-07-04 | 北京奇艺世纪科技有限公司 | Black product identification method and device, electronic equipment and storage medium |
CN112019343B (en) * | 2020-07-28 | 2022-12-23 | 苏州浪潮智能科技有限公司 | OpenStack token optimization method and system |
CN113627886A (en) * | 2021-08-11 | 2021-11-09 | 中国银行股份有限公司 | Service processing method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105991293A (en) * | 2016-07-26 | 2016-10-05 | 努比亚技术有限公司 | Verification method and verification device |
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 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107222460B (en) * | 2017-05-03 | 2019-10-08 | 飞天诚信科技股份有限公司 | A kind of method and device that server data memory space is shared |
-
2019
- 2019-11-01 CN CN201911061021.3A patent/CN110765168B/en active Active
Patent Citations (4)
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 |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN110765168A (en) | 2020-02-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110765168B (en) | Data searching method and device based on user information | |
WO2017076193A1 (en) | Method and apparatus for processing request from client | |
US10116693B1 (en) | Server using proof-of-work technique for hardening against denial of service attacks | |
WO2016004013A1 (en) | Prompting login account | |
US8898318B2 (en) | Distributed services authorization management | |
JP6859518B2 (en) | How to prevent attacks on servers and devices | |
EP3471010A1 (en) | Generic runtime protection for transactional data | |
US20170244706A1 (en) | Delegated resource authorization for replicated applications | |
US11496470B2 (en) | Methods for randomized multi-factor authentication with biometrics and devices thereof | |
CN110581835B (en) | Vulnerability detection method and device and terminal equipment | |
CN113949579B (en) | Website attack defense method and device, computer equipment and storage medium | |
US10013694B1 (en) | Open data collection for threat intelligence posture assessment | |
CN112804222B (en) | Data transmission method, device, equipment and storage medium based on cloud deployment | |
US10326833B1 (en) | Systems and method for processing request for network resources | |
CN111988262A (en) | Authentication method, authentication device, server 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 | |
CN117254969A (en) | Registration authentication method for intelligent equipment accessing to Internet of things system | |
CN109063461B (en) | Third-party password-free login method and system | |
US8281000B1 (en) | Variable-length nonce generation | |
CN111488568B (en) | Client method, device, equipment and storage medium | |
US10915657B2 (en) | Identifying and protecting personal sensitive documents | |
US10454945B1 (en) | Method, apparatus and computer program product for processing an electronic request to access a computerized resource | |
WO2019203943A1 (en) | Validation of short authentication data with a zero knowledge proof | |
US20230412588A1 (en) | Detecting credentials abuse of cloud compute services |
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 |