CN115129978A - Preference query method, user terminal, server and storage medium - Google Patents

Preference query method, user terminal, server and storage medium Download PDF

Info

Publication number
CN115129978A
CN115129978A CN202210597197.6A CN202210597197A CN115129978A CN 115129978 A CN115129978 A CN 115129978A CN 202210597197 A CN202210597197 A CN 202210597197A CN 115129978 A CN115129978 A CN 115129978A
Authority
CN
China
Prior art keywords
preference
vector
initial
standard
query
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
CN202210597197.6A
Other languages
Chinese (zh)
Other versions
CN115129978B (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.)
Jinan University
Original Assignee
Jinan University
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 Jinan University filed Critical Jinan University
Priority to CN202210597197.6A priority Critical patent/CN115129978B/en
Publication of CN115129978A publication Critical patent/CN115129978A/en
Application granted granted Critical
Publication of CN115129978B publication Critical patent/CN115129978B/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes

Abstract

The invention discloses a preference query method, a user terminal, a server and a storage medium, wherein the preference query method is applied to the user terminal and comprises the following steps: acquiring an initial preference vector of a user and acquiring a standard number set; arranging all the standard numbers in the standard number set to obtain a disturbance preference vector; and sending the disturbance preference vector to a server so that the server can perform weighted summation processing on the attributes of each storage object in the database by adopting the disturbance preference vector to obtain a preference score corresponding to the storage object, determining a query result according to the preference score, and sending the query result to a user terminal. The invention realizes that the privacy information of the user is protected from being leaked in the process of preference query.

Description

Preference query method, user terminal, server and storage medium
Technical Field
The present invention relates to the field of database query technologies, and in particular, to a preference query method, a user terminal, a server, and a storage medium.
Background
In the process of querying by a user, the user can search according to the preference of the user to obtain a desired result, and the query mode is called preference query. Preference query is widely applied in many fields, such as e-commerce, recommendation systems, search engines, and the like, however, when a user performs preference query, after acquiring the preference of the user, a server may acquire the privacy information of the user according to the preference vector of the user, thereby causing the privacy information of the user to be revealed, and negatively affecting the interests and reputation of the user.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a preference query method, a user terminal, a server and a storage medium, and aims to solve the technical problem that user privacy information is leaked in a preference query process.
In order to achieve the above object, the present invention provides a preference query method, which is applied to a user terminal, and comprises the following steps:
acquiring an initial preference vector of a user and acquiring a standard number set, wherein the number of the standard numbers in the standard number set is consistent with the number of initial preference weights in the initial preference vector;
arranging all the standard numbers in the standard number set to obtain a disturbance preference vector, wherein the standard numbers in the disturbance preference vector are the same as the sequence numbers of initial preference weights at the same position in the initial preference vector when the initial preference weights are sorted in the respective vectors according to the size;
and sending the disturbance preference vector to a server so that the server can perform weighted summation processing on the attributes of each storage object in the database by adopting the disturbance preference vector to obtain a preference score corresponding to the storage object, determining a query result according to the preference score, and sending the query result to a user terminal.
Optionally, the step of arranging each standard number in the standard number set to obtain a disturbance preference vector includes:
respectively taking each initial preference weight in the initial preference vector as a target weight, and determining a target position of the target weight in the initial preference vector and a first sequence number of the target weight when the target weight is sorted according to size in the initial preference vector;
determining a second sequence number of each standard number in the standard number set when the standard numbers are sorted according to the size, taking out a target standard number corresponding to the second sequence number which is the same as the first sequence number from the standard number set, and placing the target standard number at the position which is the same as the target position in a preset arrangement vector, wherein the element number of the arrangement vector is the same as the element number of the initial preference vector;
and after all the standard numbers in the standard number set are stored into the permutation vector, determining the permutation vector as the disturbance preference vector.
Optionally, the step of obtaining the set of criteria includes:
randomly generating a plurality of random numbers to obtain a random number set, wherein the number of the random numbers is consistent with the number of initial preference weights in the initial preference vector;
and carrying out normalization processing on the random number set to obtain a standard number set.
Optionally, after the step of randomly generating a plurality of random numbers to obtain the random number set, the method further includes:
detecting whether the numerical value of each random number is the same as the numerical value of each initial preference weight in the initial preference vector;
when the numerical value of each random number is determined to be the same as the numerical value of each initial preference weight in the initial preference vector, returning to the step of randomly generating a plurality of random numbers to obtain a random number set;
and when the numerical value of each random number is determined to be not corresponding to the numerical value of each initial preference weight in the initial preference vector, performing normalization processing on the random number set to obtain a standard number set.
Optionally, the preference query method is applied to a server, and the preference query method includes the following steps:
receiving a disturbance preference vector sent by a user terminal, wherein the user terminal obtains an initial preference vector of a user and a standard number set, the number of the standard numbers in the standard number set is consistent with the number of initial preference weights in the initial preference vector, all the standard numbers in the standard number set are arranged to obtain the disturbance preference vector, the serial numbers of the standard numbers in the disturbance preference vector and the initial preference weights at the same position in the initial preference vector when the standard numbers in the disturbance preference vector and the initial preference weights in the initial preference vector are sequenced in respective vectors are the same, and the disturbance preference vector is sent to a server;
and weighting and summing the attributes of each storage object in the database by adopting the disturbance preference vector to obtain a preference score corresponding to each storage object, determining a query result according to the preference scores, and sending the query result to the user terminal.
Optionally, the step of performing weighted summation on the attributes of each storage object in the database by using the disturbance preference vector to obtain a preference score corresponding to each storage object, determining a query result according to the preference score, and sending the query result to the user terminal includes:
weighting and summing the attributes of each storage object of the storage nodes in the database by adopting the disturbance preference vector to obtain the preference scores of each storage object of the storage nodes in the database, wherein the database is stored based on a high-dimensional data storage structure, and the storage object is a minimum external box object or a data record;
sorting each storage object of the storage nodes in the database according to the descending order of the corresponding preference scores to obtain a sorting queue;
detecting whether the number of the storage objects in the sorting queue is 0 or not;
when the number of the storage objects in the sorting queue is determined to be 0, sending a preset query result to a user terminal;
when the number of the storage objects in the sorting queue is determined to be not 0, taking out a head object at the head in the sorting queue;
when the head-of-line object is determined to be the minimum external box object, weighting and summing the attributes of all storage objects contained in the minimum external box object by adopting a disturbance preference vector to obtain preference scores correspondingly, inserting all the storage objects contained in the minimum external box object into a sorting queue according to the descending order of the preference scores, and returning to the step of detecting whether the number of the storage objects in the sorting queue is 0 or not;
and when the head object is determined to be the data record, adding the head object to a preset query result, and returning to the step of detecting whether the number of the storage objects in the sequencing queue is 0.
Optionally, after the step of inserting each storage object included in the minimum bounding box object into the sorting queue in descending order of the preference score, the method further includes:
detecting whether the number of the storage objects in the sorting queue exceeds the preset inquiry requirement number or not;
and when the number of the storage objects in the sorting queue is determined to exceed the number of the query requirements, deleting the storage objects exceeding the number of the query requirements in the sorting queue from the tail end of the sorting queue.
In order to achieve the above object, the present invention further provides a user terminal, which includes: a memory, a processor, and a preference query program stored on the memory and executable on the processor, the preference query program when executed by the processor implementing the steps of the preference query method as above.
In order to achieve the above object, the present invention further provides a server, including: a memory, a processor, and a preference query program stored on the memory and executable on the processor, the preference query program when executed by the processor implementing the steps of the preference query method as above.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, on which a preference query program is stored, and the preference query program, when executed by a processor, implements the steps of the preference query method as above.
In the invention, a user terminal acquires an initial preference vector of a user and a standard number set, the number of standard numbers in the standard number set is consistent with the number of initial preference weights in the initial preference vector, all the standard numbers in the standard number set are arranged to obtain a disturbance preference vector, the serial numbers of the standard numbers in the disturbance preference vector and the initial preference weights at the same position in the initial preference vector when the standard numbers in the disturbance preference vector and the initial preference weights in the initial preference vector are sorted according to the sizes are the same, the disturbance preference vector is sent to a server, so that the server performs weighted summation processing on the attributes of all storage objects in a database by adopting the disturbance preference vector to obtain preference scores corresponding to the storage objects, a query result is determined according to the preference scores, and the query result is sent to the user terminal. The invention realizes that the privacy information of the user is protected from being leaked in the process of preference query.
Drawings
FIG. 1 is a flowchart illustrating a preference query method according to a first embodiment of the present invention;
FIG. 2 is a preference query service outsourcing model in a cloud computing environment;
FIG. 3 is a flowchart illustrating a preference query method according to a third embodiment of the present invention;
FIG. 4 is a flowchart of one embodiment of a preference query method of the present invention;
fig. 5 is a schematic structural diagram of a user terminal in a hardware operating environment according to an embodiment of the present invention.
The implementation, functional features and advantages of the present invention will be further described with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
An embodiment of the present invention provides a preference query method, and referring to fig. 1, fig. 1 is a flowchart illustrating a first embodiment of a preference query method according to the present invention. It should be noted that, although a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than that shown or described herein. The preference query method of the embodiment of the invention is applied to the user terminal, and the user terminal can be a mobile phone device, a computer device, and the like, and is not limited in the embodiment. In this embodiment, the preference query method includes:
step A10, obtaining an initial preference vector of a user, and obtaining a standard number set, wherein the number of the standard numbers in the standard number set is consistent with the number of the initial preference weights in the initial preference vector;
the preference query means that the user can search according to own preference so as to obtain the most desirable result. As shown in fig. 2, the server receives the data records sent by the data owner, stores the data records in the database of the server, when performing preference query, the user sends a preference query request to the server through the user terminal, and the server determines a query result according to the preference query request of the user and sends the query result to the user terminal.
In the preference query process, when a user sends a preference query request through a user terminal, a preference vector is specified, and the preference vector comprises a plurality of preference weights respectively corresponding to attributes in the data records. After receiving the preference vector of the user, the server performs linear weighted summation calculation on the preference vector and the attribute of the data record to obtain a preference score of the data record, and after determining a query result according to the preference score, the server sends the query result to the user terminal.
The user's preference vector can often reflect some private information related to the user, such as occupation, salary, health, etc. After receiving the preference vector of the user, the server records the preference vector of the user faithfully, and the server can obtain the privacy information of the user according to the preference vector of the user, so that the privacy information of the user is leaked.
In this embodiment, the user terminal sends the disturbed preference vector to the server to perform the preference query instead of the real preference vector of the user, so that the server cannot obtain the real privacy information of the user according to the disturbed preference vector, thereby protecting the privacy information of the user from being leaked.
Specifically, in this embodiment, the user terminal obtains preference weights corresponding to respective attributes of data records (hereinafter referred to as storage objects to indicate differentiation) in the database by the user to obtain a preference vector, hereinafter referred to as an initial preference vector, and a preference weight in the initial preference vector is referred to as an initial preference weight to indicate differentiation.
The user terminal acquires a set of initial preference vectors for disturbing the user, and the set is referred to as a standard number set hereinafter, and numerical values in the standard number set are referred to as standard numbers for distinction. Specifically, in an embodiment, the user terminal may obtain a standard number set preset in the user terminal according to the number of initial preference weights in the initial preference vector; in another embodiment, the user terminal may randomly generate a plurality of values according to the number of the initial preference weights in the initial preference vector, and then process the randomly generated values to obtain a standard number set, which is not limited herein.
Step A20, arranging each standard number in the standard number set to obtain a disturbance preference vector, wherein the standard number in the disturbance preference vector is the same as the sequence number of the initial preference weight at the same position in the initial preference vector when the initial preference weights are sorted in the respective vectors according to the size;
and arranging the standard numbers in the standard number set to enable the serial numbers of the arranged vectors to be the same as the serial numbers of the initial preference weights at the same positions in the initial preference vectors when the standard numbers and the initial preference weights are sorted in the respective vectors according to the sizes, wherein the vectors obtained after arranging the standard numbers are called disturbance preference vectors hereinafter, and elements in the disturbance preference vectors are called disturbance preference weights for distinguishing.
The disturbance preference vector obtained by arranging the standard numbers in the standard number set can be processed in different manners, and in one embodiment, the disturbance preference vector can be obtained by arranging the standard numbers in the standard number set; in another embodiment, the reference numbers in the reference number set may be placed in a new vector according to the sequence numbers and positions of the initial preference weights in the initial preference vector when they are sorted according to the magnitudes to obtain the perturbation preference vector, which may be specifically set according to actual requirements, which is not limited herein.
Step A30, sending the disturbance preference vector to a server, so that the server can use the disturbance preference vector to perform weighted summation processing on the attributes of each storage object in the database to obtain a preference score corresponding to the storage object, determine a query result according to the preference score, and send the query result to the user terminal.
And the user terminal sends the disturbance preference vector to the server so as to be used for the server to carry out preference query.
The process of the server for making the preference query may be: the server adopts the disturbance preference vector to carry out weighting summation processing on the attributes of each storage object in the database to obtain the preference score corresponding to the storage object, determines the query result according to the preference score, and sends the query result to the user terminal.
It should be noted that, the user terminal sends the perturbation preference vector to the server instead of the real preference vector of the user to provide the server for preference query, so that privacy information of the user is protected from being leaked.
Further, in one embodiment, the step of obtaining the standard number set in step a10 includes:
a101, randomly generating a plurality of random numbers to obtain a random number set, wherein the number of the random numbers is consistent with the number of initial preference weights in the initial preference vector;
step A102, normalizing the random number set to obtain a standard number.
In the present embodiment, the user terminal randomly generates a number of values such as the number of initial preference weights in the initial preference vector, and hereinafter, the randomly generated values are referred to as random numbers, and a set of random numbers is referred to as a random number set to indicate the distinction.
In a specific embodiment, when each random number in the random number set is inconsistent with the magnitude of the initial preference weight in the initial preference vector, normalization processing may be performed on the random number set to make the magnitude of each random number in the random number set consistent with the magnitude of the initial preference weight, so as to obtain a standard number set. For example, when the value range of each preference weight in the initial preference vector is [0,1], and the sum of each initial preference weight is 1, the random numbers in the random number set may be normalized so that the value range of the standard numbers in the standard number set obtained after the processing is [0,1] and the sum of each standard number is 1.
Further, in an embodiment, after the step a101, the method further includes:
step A103, detecting whether the numerical value of each random number is the same as the numerical value of each initial preference weight in the initial preference vector;
in this embodiment, the user terminal regenerates the random number by detecting whether the value of each random number is the same as the value of each initial preference weight, so as to avoid revealing the real preference of the user when the value of each random number is the same as the value of each initial preference weight.
The specific detection process may be: determining the sequence number of each random number in the random number set when the random numbers are sorted according to the numerical sequence from large to small, and determining the sequence number of each initial preference weight in the initial preference vector when the random numbers are sorted according to the numerical sequence from large to small. And comparing the numerical values of the random numbers with the same serial number with the numerical value of the initial preference weight, and determining whether the numerical values of the random numbers corresponding to the same serial number are the same as the numerical value of the initial preference weight or determining whether the numerical values of the random numbers corresponding to the serial numbers are in the same proportion with the numerical value of the initial preference weight. When it is determined that the numerical values of the random numbers corresponding to the same sequence number are the same as the numerical values of the initial preference weights, or it is determined that the numerical values of the random numbers corresponding to the respective sequence numbers are in the same proportion to the numerical values of the initial preference weights, it may be determined that the numerical values of the respective random numbers are correspondingly the same as the numerical values of the respective initial preference weights; when it is determined that the numerical values of the random numbers corresponding to the same sequence number are different from the numerical value of the initial preference weight, and it is determined that the numerical values of the random numbers corresponding to the respective sequence numbers are not in the same proportion to the numerical value of the initial preference weight, it may be determined that the numerical values of the random numbers are not in correspondence with the numerical values of the initial preference weights.
Step A104, when it is determined that the numerical value of each random number is the same as the numerical value of each initial preference weight in the initial preference vector, returning to the step of randomly generating a plurality of random numbers to obtain a random number set;
when the numerical value of each random number is determined to be the same as the numerical value of each initial preference weight in the initial preference vector, at the moment, the random number is subjected to normalization processing to obtain a standard number set, the disturbance preference vector obtained by arranging the standard number set can enable the disturbance preference weight in the obtained disturbance preference vector to be the same as the initial preference weight in the initial preference vector, so that the real preference of a user can be revealed, and therefore, the step of generating a plurality of random numbers to obtain the random number set is returned to be executed to obtain the random numbers again.
Step A105, when it is determined that the numerical value of each random number is not corresponding to the numerical value of each initial preference weight in the initial preference vector, performing normalization processing on the random number set to obtain a standard number set.
When it is determined that the numerical value of each random number is not corresponding to the numerical value of each initial preference weight in the initial preference vector, the random number set may be normalized to obtain a standard number set.
It should be noted that, in this embodiment, it may be ensured that the disturbance preference vector obtained through subsequent processing does not reveal the real preference of the user by detecting whether the numerical value of each random number is the same as the numerical value of each initial preference weight in the initial preference vector, and regenerating the random number when it is determined that the numerical value of each random number is the same as the numerical value of each initial preference weight in the initial preference vector, thereby protecting the privacy information of the user.
In the embodiment, the user terminal obtains the initial preference vector and the standard number set of the user, arranges each standard number in the standard number set to obtain the disturbance preference vector, and sends the disturbance preference vector to the server, so that the server performs weighted summation on the attributes of each storage object in the database by using the disturbance preference vector to obtain the preference score corresponding to the storage object, determines the query result according to the preference score, and sends the query result to the user terminal, thereby protecting the privacy information of the user from being leaked.
Further, based on the first embodiment described above, a second embodiment of the preference query method of the present invention is provided, in this embodiment, step a20 includes:
step A201, using each initial preference weight in the initial preference vector as a target weight, and determining a target position of the target weight in the initial preference vector and a first sequence number of the target weight when the target weight is sorted according to size in the initial preference vector;
in this embodiment, the user terminal arranges the standard numbers in the standard number set according to the sequence numbers and positions of the initial preference weights in the initial preference vector when the initial preference weights are sorted according to the sizes to obtain the disturbance preference vector, so that the accuracy of the preference query result is ensured while the privacy information of the user is not leaked.
Specifically, in the present embodiment, the respective initial preference weights in the initial preference vector are respectively taken as target weights, and the positions of the target weights in the initial preference vector (hereinafter referred to as target positions to illustrate distinction) and the ordinal numbers of the target weights in the initial preference vector when they are sorted by size (hereinafter referred to as first ordinal numbers to illustrate distinction) are determined.
In a specific embodiment, the position where the target weight is determined from the left end of the initial preference vector may be the target position, or the position where the target weight is determined from the right end of the initial preference vector may be the target position, which is not limited herein. The sorting of the initial preference weights may be a sorting in order from large values to small values, or a sorting in order from small values to large values, which is not limited in this embodiment.
Step A202, determining a second serial number when each standard number in the standard number set is sorted according to size, taking out a target standard number corresponding to the second serial number which is the same as the first serial number from the standard number set, and placing the target standard number at a position which is the same as the target position in a preset arrangement vector, wherein the number of elements of the arrangement vector is the same as that of the initial preference vector;
determining the sequence numbers (hereinafter referred to as a second sequence number for distinction) of the standard numbers in the standard number set according to the sequence sizes, it is understood that the sequence sizes of the standard numbers may be from large to small according to the numerical values, or from small to large according to the numerical values, and in a specific embodiment, the basis for sequencing the standard numbers should be the same as the basis for sequencing the initial preference weights.
And (3) taking out a standard number (hereinafter referred to as a target standard number for distinction) corresponding to a second sequence number which is the same as the first sequence number of the target weight from the standard number set, and storing the target standard number in a preset ordering vector according to the target position of the target weight in the initial preference vector at the position which is the same as the target position to obtain a disturbance preference vector. It is understood that, when the target position of the target weight is determined from the left end of the initial preference vector, the position of the target criterion number stored in the arrangement vector should be determined from the left end of the arrangement vector; likewise, when the target position of the target weight is determined from the right end of the initial preference vector, the position of the target criterion number stored in the arrangement vector should also be determined from the right end of the arrangement vector.
In a specific embodiment, the number of elements in the preset ranking vector is the same as the number of elements in the initial preference vector, that is, the number of elements in the ranking vector is the same as the number of initial preference weights in the initial preference vector, so as to ensure that the number of perturbation preference weights in the perturbation preference vector is the same as the number of initial preference weights in the initial preference vector, so that the perturbation preference weights in the perturbation preference vector can be in one-to-one correspondence with the attributes of the storage objects in the database.
Step A203, after each standard number in the standard number set is stored into the permutation vector, determining the permutation vector as a disturbance preference vector.
And after all the standard numbers in the standard number set are stored into the arrangement vector, determining the arrangement vector as a disturbance preference vector.
The step of storing each standard number in the detected standard number set into the permutation vector may be to determine whether all the standard numbers are stored into the disturbance preference vector by detecting whether the standard numbers exist in the standard number set, and may also be to perform detection with reference to the prior art, which is not limited herein.
Further, in an embodiment, a target weight may be determined from each initial preference weight in the initial preference vector, a target position and a sequence number of the target weight in the initial preference vector when sorted according to size are determined, a target standard number that is the same as the sequence number of the target weight when sorted according to size is taken out from the standard number set, the target standard number is stored in the permutation vector according to the target position of the target weight, and then the target weight is replaced with a preset replacement value. And determining a target weight from the remaining initial preference weights in the initial preference vector, and repeating the above processing until the arrangement vector is determined to be the disturbance preference vector when all the standard numbers in the set of determined standard numbers are stored in the arrangement vector.
In this embodiment, the user terminal arranges the standard number set according to the relative position of the initial preference weight in the initial preference vector to obtain the disturbance preference vector. According to the embodiment, the accuracy of the preference query result is guaranteed, and meanwhile the privacy information of the user is protected from being revealed.
Further, based on the first embodiment, a third embodiment of the preference query method of the present invention is provided, and the preference query method of the present embodiment is applied to a server. In this embodiment, referring to fig. 3, the preference query method includes:
step B10, receiving a disturbance preference vector sent by a user terminal, wherein the user terminal obtains an initial preference vector of a user and a standard number set, the number of the standard numbers in the standard number set is consistent with the number of initial preference weights in the initial preference vector, all the standard numbers in the standard number set are arranged to obtain the disturbance preference vector, the serial numbers of the standard numbers in the disturbance preference vector and the initial preference weights at the same position in the initial preference vector when the standard numbers in the disturbance preference vector are sequenced in the respective vectors according to the size are the same, and the disturbance preference vector is sent to a server;
in this embodiment, the server determines a query result according to the preference score of the storage object by using a value (hereinafter, referred to as a preference score for convenience of description) obtained by weighted summation of the disturbance preference vector and each attribute of data records (hereinafter, referred to as a storage object for distinction) in the database, so that the preference query can be performed without revealing privacy information of the user.
Specifically, in this embodiment, the server receives the perturbation preference vector sent by the user terminal, and the specific process of generating the perturbation preference vector by the user terminal may refer to the first embodiment and the second embodiment, which is not described herein again.
And step B20, weighting and summing the attributes of each storage object in the database by adopting the disturbance preference vector to obtain a preference score corresponding to each storage object, determining a query result according to the preference score, and sending the query result to the user terminal.
And the server adopts the disturbance preference vector to carry out weighted summation processing on the attributes of the storage objects in the database to obtain the preference scores of the storage objects. The specific treatment process can be as follows: and multiplying the disturbance preference weight in the disturbance preference vector with each attribute of the storage object respectively, and adding the obtained products to obtain the preference score of the storage object.
In a specific embodiment, the step of determining, by the server, the query result according to the preference score of each storage object may be determining, according to the size of the preference score, a storage object with a high preference score as the query result; the query result may also be determined according to the preference score and the platform push requirement, which is not limited herein.
And after determining the query result, the server sends the query result to the user terminal.
Further, in one embodiment, step B20 includes:
step B201, weighting and summing the attributes of each storage object of the storage nodes in the database by using the disturbance preference vector to obtain preference scores of each storage object of the storage nodes in the database, wherein the database is stored based on a high-dimensional data storage structure, and the storage object is a minimum external box object or a data record;
in this embodiment, the database stores the storage object based on the high-dimensional data storage structure, and the storage object may be a minimum external box object in the high-dimensional data storage structure or may be a data record.
The server carries out preference query based on the high-dimensional data storage structure, and calculates preference scores for storage objects of storage nodes of the high-dimensional data storage structure (hereinafter referred to as storage objects of the storage nodes in the database for distinguishing) by adopting preference disturbance vectors. In a specific embodiment, when the storage object is a minimum external box object, the value of the upper right corner of the minimum external box object is used as the attribute of the minimum external box object to calculate the preference score; and when the storage object is a data record, calculating the preference score by adopting the attribute of the data record. The detailed calculation process is not described herein.
Step B202, sorting each storage object of the storage nodes in the database according to the descending order of the corresponding preference scores to obtain a sorting queue;
and sorting each storage object of the storage nodes in the database according to the descending order of the corresponding preference scores to obtain a sorting queue, wherein the specific sorting method is not limited herein.
Step B203, detecting whether the number of the storage objects in the sorting queue is 0;
and detecting whether the number of the storage objects in the sorting queue is 0, wherein a specific detection mode is not limited herein.
Step B204, when the number of the storage objects in the sorting queue is determined to be 0, sending a preset query result to the user terminal;
when the number of the storage objects in the sorting queue is determined to be 0, it may be determined that there is no storage object that can be added to the query result in the sorting queue at this time, and the preset query result is sent to the user terminal.
Step B205, when the number of the storage objects in the sorting queue is determined not to be 0, taking out the head object at the head in the sorting queue;
when the number of the storage objects in the sorting queue is determined to be not 0, the storage object at the head of the queue in the sorting queue (hereinafter referred to as the head of queue object for distinguishing) is taken out, and the head of queue object is the storage object with the highest preference score in the sorting queue.
Step B206, when the head-of-line object is determined to be the minimum circumscribed box object, performing weighted summation processing on the attributes of each storage object contained in the minimum circumscribed box object by using the disturbance preference vector to obtain preference scores correspondingly, inserting each storage object contained in the minimum circumscribed box object into the sorting queue according to the descending order of the preference scores, and returning to the step of detecting whether the number of the storage objects in the sorting queue is 0;
when the head of line object is the minimum external box object, the minimum external box object may contain a plurality of storage objects, the minimum external box object is expanded, preference scores of the storage objects contained in the minimum external box object are calculated, the storage objects contained in the minimum external box object are inserted into the sorting queue according to the descending order of the preference scores, and then the operation of detecting whether the number of the storage objects in the sorting queue is 0 is returned.
Step B207, when it is determined that the head of line object is the data record, adding the head of line object to the preset query result, and returning to the step of detecting whether the number of storage objects in the sorting queue is 0.
And when the queue head object is determined to be the data record, the queue head object is a storage object meeting the user preference query requirement, the queue head object is added to a preset query result, and the step of detecting whether the storage object in the sequencing queue is 0 is returned.
Further, in an embodiment, after the step of inserting each storage object included in the minimum bounding box object into the sorting queue in descending order of preference score in step B206, the method further includes:
step B208, detecting whether the number of the storage objects in the sorting queue exceeds the preset inquiry requirement number;
in this embodiment, in the process of performing the preference query, the server may perform pruning processing on the storage objects in the sorting queue to improve the query efficiency.
Specifically, in this embodiment, it is detected whether the number of storage objects in the sorting queue exceeds a preset query requirement number.
And step B209, when the number of the storage objects in the sorting queue is determined to exceed the query requirement number, deleting the storage objects exceeding the query requirement number in the sorting queue from the tail end of the sorting queue.
And when detecting that the number of the storage objects in the sorting queue exceeds the number of the query requirements, deleting the storage objects exceeding the number of the query requirements in the sorting queue from the tail end of the sorting queue. For example, the number of the query requirements is 5, and when the server detects that the number of the stored objects in the sorting queue exceeds 5, the 6 th object and the objects after the 6 th object in the sorting queue are deleted from the tail end of the sorting queue.
Further, in an embodiment, after the step of adding the head of line object to the preset query result in step B207, it may be detected whether the number of results in the preset query result reaches the number of query requirements, and when it is determined that the number of results in the preset query result reaches the number of query requirements, it may be determined that the preference query has been completed, and the server sends the preset query result to the user terminal; and when the number of the results in the preset query result does not reach the query required number, continuously executing the step of detecting whether the number of the storage objects in the sorting queue is 0 or not.
Further, in one embodiment, the server has a relational database D ═ a 1 ,A 2 ,...,A d In which any attribute A i The values of (1 ≦ i ≦ d) are all numerical types, and let the user initial preference vector f ≦ w 1 ,w 2 ,...,w d H, any initial preference weight in the initial preference vector satisfies w i Is a [0,1]]And the sum of the respective initial preference weights is 1. Referring to fig. 4, a specific process of the preference query may be:
1) the user terminal obtains an initial preference vector of a user and generates d random numbers with the same number as the initial preference weight in the initial preference vector. D random numbers are stored in a set T (namely a random number set), normalization processing is carried out on elements in the set T, and the elements are subjected to descending order to obtain T '(namely a standard number set), so that the value range of any element (namely the standard number) in the set T' is [0,1], and the sum of all elements is 1.
2) And sequencing the random numbers (namely standard numbers) in the set T ' according to the relative preference relation (namely the position of the initial preference weight in the initial preference vector and the sequence number in the sequencing according to the size) of the components (namely the initial preference weight) in the f to obtain a disturbed preference vector f ' (namely the disturbed preference vector), and sending the disturbed vector f ' to a server by a user for the server to perform preference query.
3) The server dynamically indexes the data records in the database based on an R-tree storage structure (namely, a high-dimensional data storage structure), and maintains a queue h (namely, a sorting queue) for recording intermediate results of a query process in the process of processing a user query request each time, wherein the queue h needs to keep a descending state so as to ensure that the maximum value in the intermediate results is taken out each time.
4) Starting from the root node of the storage structure, all objects contained in the storage structure (namely storage objects of the storage nodes in the database) are taken out and are subjected to linear weighted summation with a preference vector f', wherein an MBB (minimum Bounding Box) object calculates scores according to the upper right corner of the MBB object, and the MBB object is stored in a sorting queue h after the preference scores are obtained.
5) Taking out a head element (namely a head object) of the queue h, if the head element is an MBB object, unfolding the head element, respectively calculating preference scores of all objects contained in the MBB object, storing the preference scores into the queue, and sorting the h in a descending order; if the element is a specific data point (i.e., data record), add it to the result set; if the number of elements in queue h exceeds k (i.e., the number of query requirements), then a pruning operation is performed on queue h [ k +1: ] (i.e., the portion of the sorted queue that exceeds the number of query requirements).
6) And jumping to the step 5 to continue the execution until h is empty (namely when the number of the storage objects in the sorting queue is 0) or k elements exist in the result set (namely the number of the results in the preset query result meets the query requirement number).
7) And finally, the server returns k elements (data records) in the result set to the user (namely, the preset query result is sent to the user terminal).
In the embodiment, the server receives the disturbance preference vector sent by the user terminal, and uses the disturbance preference vector to perform preference query, so that the privacy information of the user is protected from being leaked, and meanwhile, the accuracy of a preference query result is ensured.
In addition, an embodiment of the present invention further provides a user terminal, as shown in fig. 5, where the user terminal may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to implement connection communication among these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 5 is not intended to be limiting of the user terminal and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 5, the memory 1005, which is a storage medium, may include therein an operating system, a data storage module, a network communication module, a user interface module, and a preference query program.
In the user terminal shown in fig. 5, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the user terminal of the present invention may be disposed in the user terminal, and the user terminal invokes the preference query program stored in the memory 1005 through the processor 1001 and executes the steps of the preference query method provided by the embodiment of the present invention.
The first embodiment and the second embodiment of the preference query method of the present invention can be referred to in each embodiment of the user terminal of the present invention, and details are not described herein again.
In addition, an embodiment of the present invention further provides a server, where the server may include: a processor, such as a Central Processing Unit (CPU), a communications bus, a user interface, a network interface, and memory. Wherein the communication bus is used for realizing connection communication among the components. The user interface may comprise a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface may also comprise a standard wired interface, a wireless interface. The network interface may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory may alternatively be a storage device separate from the aforementioned processor.
Those skilled in the art will appreciate that the above-described architecture is not meant to be limiting with respect to servers and may include more or fewer components than those described, or some components may be combined, or a different arrangement of components.
The memory, which is a storage medium, may include therein an operating system, a data storage module, a network communication module, a user interface module, and a preference query program.
The network interface is mainly used for carrying out data communication with other equipment; the user interface is mainly used for data interaction with a user; the processor and the memory in the server of the present invention may be arranged in the server, and the server calls the preference query program stored in the memory through the processor and executes the steps of the preference query method provided by the embodiment of the present invention.
For each embodiment of the server of the present invention, reference may be made to the third embodiment of the preference query method of the present invention, and details are not described herein again.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a preference query program is stored on the storage medium, and when executed by a processor, the preference query program implements the steps of the preference query method as described above.
The embodiments of the computer-readable storage medium of the present invention can refer to the embodiments of the preference query method of the present invention, and are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or system in which the element is included.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A preference query method is applied to a user terminal, and is characterized by comprising the following steps:
acquiring an initial preference vector of a user and acquiring a standard number set, wherein the number of standard numbers in the standard number set is consistent with the number of initial preference weights in the initial preference vector;
arranging all the standard numbers in the standard number set to obtain a disturbance preference vector, wherein the standard numbers in the disturbance preference vector are the same as the sequence numbers of initial preference weights at the same position in the initial preference vector when the initial preference weights are sorted in the respective vectors according to the magnitude;
and sending the disturbance preference vector to a server so that the server can perform weighted summation processing on the attributes of each storage object in the database by adopting the disturbance preference vector to obtain a preference score corresponding to the storage object, determining a query result according to the preference score, and sending the query result to the user terminal.
2. The preference query method of claim 1, wherein the step of ranking each criterion number in the set of criterion numbers to obtain a perturbation preference vector comprises:
respectively taking each initial preference weight in the initial preference vector as a target weight, and determining a target position of the target weight in the initial preference vector and a first sequence number of the target weight when the target weight is sorted according to size in the initial preference vector;
determining a second sequence number when each standard number in the standard number set is sorted according to size, taking out a target standard number corresponding to the second sequence number which is the same as the first sequence number from the standard number set, and placing the target standard number at the position which is the same as the target position in a preset arrangement vector, wherein the element number of the arrangement vector is the same as the element number of the initial preference vector;
and after all the standard numbers in the standard number set are stored into the permutation vector, determining the permutation vector as a disturbance preference vector.
3. The preference query method of any one of claims 1 to 2, wherein the step of obtaining a set of criteria comprises:
randomly generating a plurality of random numbers to obtain a random number set, wherein the number of the random numbers is consistent with the number of initial preference weights in the initial preference vector;
and carrying out normalization processing on the random number set to obtain a standard number set.
4. The preference query method of claim 3, wherein after the step of randomly generating a plurality of random numbers to obtain a set of random numbers, further comprising:
detecting whether the numerical value of each random number is correspondingly the same as the numerical value of each initial preference weight in the initial preference vector;
when the numerical value of each random number is determined to be the same as the numerical value of each initial preference weight in the initial preference vector, returning to the step of randomly generating a plurality of random numbers to obtain a random number set;
and when the numerical value of each random number is determined to be not corresponding to the numerical value of each initial preference weight in the initial preference vector, executing the step of carrying out normalization processing on the random number set to obtain a standard number set.
5. A preference query method is applied to a server, and comprises the following steps:
receiving a disturbance preference vector sent by a user terminal, wherein the user terminal obtains an initial preference vector of a user and a standard number set, the number of standard numbers in the standard number set is consistent with the number of initial preference weights in the initial preference vector, all the standard numbers in the standard number set are arranged to obtain the disturbance preference vector, the serial numbers of the standard numbers in the disturbance preference vector and the initial preference weights at the same position in the initial preference vector when the standard numbers in the disturbance preference vector and the initial preference weights in the initial preference vector are sorted according to the size in the respective vectors are the same, and the disturbance preference vector is sent to a server;
and weighting and summing the attributes of each storage object in the database by adopting the disturbance preference vector to obtain a preference score corresponding to each storage object, determining a query result according to the preference score, and sending the query result to the user terminal.
6. The preference query method of claim 5, wherein the step of performing weighted summation processing on the attributes of each storage object in the database by using the perturbation preference vector to obtain a preference score corresponding to each storage object, determining a query result according to the preference score, and sending the query result to the user terminal comprises:
weighting and summing the attributes of each storage object of the storage nodes in the database by adopting the disturbance preference vector to obtain preference scores of each storage object of the storage nodes in the database, wherein the database is stored based on a high-dimensional data storage structure, and the storage object is a minimum external box object or a data record;
sorting each storage object of the storage nodes in the database according to the descending order of the corresponding preference scores to obtain a sorting queue;
detecting whether the number of the storage objects in the sorting queue is 0 or not;
when the number of the storage objects in the sorting queue is determined to be 0, sending a preset query result to a user terminal;
when the number of the storage objects in the sorting queue is determined to be not 0, taking out a head object at the head in the sorting queue;
when the head-of-line object is determined to be the minimum external box object, weighting and summing the attributes of each storage object contained in the minimum external box object by adopting the disturbance preference vector to obtain preference scores correspondingly, inserting each storage object contained in the minimum external box object into the sorting queue according to the descending order of the preference scores, and returning to the step of detecting whether the number of the storage objects in the sorting queue is 0 or not;
and when the head of queue object is determined to be the data record, adding the head of queue object to the preset query result, and returning to execute the step of detecting whether the number of the storage objects in the sequencing queue is 0.
7. The preference query method of claim 6, wherein after the step of inserting the storage objects contained in the minimum inbox object into the sort queue in descending order of preference score, further comprising:
detecting whether the number of the storage objects in the sorting queue exceeds the preset inquiry requirement number or not;
and when the number of the storage objects in the sorting queue exceeds the query requirement number, deleting the storage objects exceeding the query requirement number in the sorting queue from the tail end of the sorting queue.
8. A user terminal, characterized in that the user terminal comprises: a memory, a processor, and a preference query program stored on the memory and executable on the processor, the preference query program configured to implement the steps of the preference query method of any of claims 1 to 4.
9. A server, characterized in that the server comprises: a memory, a processor, and a preference query program stored on the memory and executable on the processor, the preference query program configured to implement the steps of the preference query method as claimed in any one of claims 5 to 7.
10. A storage medium, characterized in that the storage medium has stored thereon a preference query program, which when executed by a processor implements the steps of the preference query method of any one of claims 1 to 7.
CN202210597197.6A 2022-05-27 2022-05-27 Preference query method, user terminal, server and storage medium Active CN115129978B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210597197.6A CN115129978B (en) 2022-05-27 2022-05-27 Preference query method, user terminal, server and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210597197.6A CN115129978B (en) 2022-05-27 2022-05-27 Preference query method, user terminal, server and storage medium

Publications (2)

Publication Number Publication Date
CN115129978A true CN115129978A (en) 2022-09-30
CN115129978B CN115129978B (en) 2024-03-29

Family

ID=83378401

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210597197.6A Active CN115129978B (en) 2022-05-27 2022-05-27 Preference query method, user terminal, server and storage medium

Country Status (1)

Country Link
CN (1) CN115129978B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108073605A (en) * 2016-11-10 2018-05-25 阿里巴巴集团控股有限公司 A kind of loading of business datum, push, the generation method of interactive information and device
CN109189812A (en) * 2018-08-14 2019-01-11 中国平安人寿保险股份有限公司 A kind of index querying method, computer readable storage medium and server
CN109977309A (en) * 2019-03-21 2019-07-05 杭州电子科技大学 Combination point of interest querying method based on multiple key and user preference
CN111090877A (en) * 2019-11-21 2020-05-01 腾讯科技(深圳)有限公司 Data generation method, data acquisition method, corresponding devices and storage medium
CN114528478A (en) * 2022-01-14 2022-05-24 南方科技大学 User query recommendation method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108073605A (en) * 2016-11-10 2018-05-25 阿里巴巴集团控股有限公司 A kind of loading of business datum, push, the generation method of interactive information and device
CN109189812A (en) * 2018-08-14 2019-01-11 中国平安人寿保险股份有限公司 A kind of index querying method, computer readable storage medium and server
CN109977309A (en) * 2019-03-21 2019-07-05 杭州电子科技大学 Combination point of interest querying method based on multiple key and user preference
CN111090877A (en) * 2019-11-21 2020-05-01 腾讯科技(深圳)有限公司 Data generation method, data acquisition method, corresponding devices and storage medium
CN114528478A (en) * 2022-01-14 2022-05-24 南方科技大学 User query recommendation method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN115129978B (en) 2024-03-29

Similar Documents

Publication Publication Date Title
US10311106B2 (en) Social graph visualization and user interface
EP2741227B1 (en) Method, system, client and server for scanning file
US11748452B2 (en) Method for data processing by performing different non-linear combination processing
AU2017268599B2 (en) Method, device, server and storage medium of searching a group based on social network
CN109857377B (en) API (application program interface) arrangement method and device
CN107807935B (en) Using recommended method and device
CN109165057B (en) Method and device for executing task by intelligent equipment
US9300712B2 (en) Stream processing with context data affinity
CN108009205A (en) Location-based search result caching method, searching method, client and system
CN111026765A (en) Dynamic processing method, equipment, storage medium and device for strictly balanced binary tree
CN110609958A (en) Data pushing method and device, electronic equipment and storage medium
CN114461384A (en) Task execution method and device, computer equipment and storage medium
CN110852603B (en) High-throughput wind control data processing method, device, equipment and storage medium
CN109492149A (en) Crawler task processing method and device
CN109345252A (en) A kind of online trading control method, device and computer equipment
CN111008873B (en) User determination method, device, electronic equipment and storage medium
CN115129978B (en) Preference query method, user terminal, server and storage medium
CN110392115B (en) Block chain node management method, device and readable storage medium
CN115238837B (en) Data processing method and device, electronic equipment and storage medium
CN113704251A (en) Method and device for layout of home page of distributed storage database all-in-one machine
CN114528478A (en) User query recommendation method and device, electronic equipment and storage medium
CN113282804A (en) Method and device for adjusting relational graph and storage medium
CN108958902B (en) Graph calculation method and system
CN112257111A (en) Dynamic numerical value desensitization method, device and storage medium
JP6333306B2 (en) SEARCH DATA MANAGEMENT DEVICE, SEARCH DATA MANAGEMENT METHOD, AND SEARCH DATA MANAGEMENT PROGRAM

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