+

CN110334114A - A kind of method and apparatus for inquiring data - Google Patents

A kind of method and apparatus for inquiring data Download PDF

Info

Publication number
CN110334114A
CN110334114A CN201810145202.3A CN201810145202A CN110334114A CN 110334114 A CN110334114 A CN 110334114A CN 201810145202 A CN201810145202 A CN 201810145202A CN 110334114 A CN110334114 A CN 110334114A
Authority
CN
China
Prior art keywords
jump
chained list
data
stored
checked
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
CN201810145202.3A
Other languages
Chinese (zh)
Other versions
CN110334114B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810145202.3A priority Critical patent/CN110334114B/en
Publication of CN110334114A publication Critical patent/CN110334114A/en
Application granted granted Critical
Publication of CN110334114B publication Critical patent/CN110334114B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/2453Query optimisation
    • G06F16/24532Query optimisation of parallel queries

Landscapes

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

Abstract

The invention discloses a kind of method and apparatus for inquiring data, are related to field of computer technology.One specific embodiment of this method includes: reception inquiry request, and the inquiry request includes: inquiry tag;According to inquiry tag, jump chained list to be checked is determined in the jump chained list set of pre-configuration, wherein the jump chained list is used to store the data with same queries label;Data are inquired in jump chained list to be checked, to obtain query result.Efficiently quick and performance cost is lower for the embodiment.

Description

A kind of method and apparatus for inquiring data
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus for inquiring data.
Background technique
In the processing and application process of data, the many-to-many relationship for establishing data and label is generally required, so as to basis The inquiry of label progress data.For example, electric business platform is even broadcast live by soft text relevant to commodity, evaluation and test, video When material generates the feed stream of commodity, it is necessary to the many-to-many relationship for establishing material and label, in the feed for generating a certain label When stream, by the tag queries material to generate feed stream.
Currently, being based on relationship based on the common method that the multi-to-multi corresponding relationship of data and label carries out the inquiry of data Type database realizing, specific there are two types of implementations: a kind of scheme is that group is combined into one in the way of agreement by multiple labels Field is stored in a certain column of data, when inquiring data, is inquired with sql fuzzy query sentence;Another scheme is to establish The contingency table of one data id corresponding label id, is inquired with the mode of connection table join.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery: looking into when using fuzzy When inquiry, query process cannot be using index, and search efficiency is lower, is unable to satisfy Internet era magnanimity and requests lower high availability It is required that.When using connection table inquiry, in the case where internet content platform mass data, the inquiry of connection table can bring excessively high property Energy expense, excessive pressure is caused to database, and availability is limited.
Therefore, a kind of method and apparatus of lower inquiry data of efficiently quick and performance cost are needed.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus for inquiring data, efficient quick and performance cost It is lower.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of method for inquiring data, packet are provided It includes:
Inquiry request is received, the inquiry request includes: inquiry tag;
According to inquiry tag, jump chained list to be checked is determined in the jump chained list set of pre-configuration, wherein the jump Jump chained list is used to store the data with same queries label;
Data are inquired in jump chained list to be checked, to obtain query result.
Further, the inquiry request further include: the characteristic range parameter of query object;
Determine that jump chained list to be checked includes: in the jump chained list set of pre-configuration
According to inquiry tag, the jump chained list subset of the inquiry tag in jump chained list set, the jump chained list are determined Subset includes: the jump chained list that storage has the data of the inquiry tag;
According to the characteristic range parameter of the query object, skip link to be checked is determined in the jump chained list subset Table.
Further, determine that jump chained list to be checked includes: in the jump chained list subset
Obtain the characteristic range parameter of each of jump chained list subset jump chained list;
Following step is executed to the characteristic range parameter of each jump chained list:
Judge whether current signature range with the characteristic range of the query object has intersection, if so, determining current special Levying the corresponding jump chained list of range parameter is jump chained list to be checked.
Further, the method for inquiry data provided in an embodiment of the present invention, further includes:
Receive data to be stored;
According to the label of data to be stored, jump chained list for storing the data to be stored is determined in jump chained list set Collection;
It is that keyword is arranged in the data to be stored according to the feature of the data to be stored;
According to the keyword of the data to be stored, determine in jump chained list subset for storing the jump of the data to be stored Chained list;
The data to be stored is stored in the jump chained list according to the keyword of data to be stored.
Further, data are inquired in jump chained list to be checked, includes: to obtain query result
According to the key range of the characteristic range gain of parameter query object of query object;
According to the key range of query object, data are inquired in each jump chained list to be checked, it is every to obtain The query result of one jump chained list to be checked;
The query result of all jump chained lists to be checked is merged, to obtain final query result.
To achieve the above object, other side according to an embodiment of the present invention provides a kind of device for inquiring data, Include:
Receiving module, for receiving inquiry request, the inquiry request includes: inquiry tag;
Determining module, for determining skip link to be checked in the jump chained list set of pre-configuration according to inquiry tag Table, wherein the jump chained list is used to store the data with same queries label;
Enquiry module, for inquiring data in jump chained list to be checked, to obtain query result.
Further, the inquiry request further include: the characteristic range parameter of query object;
The determining module is further used for determining the jump of the inquiry tag in jump chained list set according to inquiry tag Chained list subset, the jump chained list subset includes: the jump chained list that storage has the data of the inquiry tag, then according to The characteristic range parameter of query object determines jump chained list to be checked in the jump chained list subset.
Further, the determining module is further used for obtaining each of described jump chained list subset jump chained list Characteristic range parameter, then to each jump chained list characteristic range parameter execute following step:
Judge whether current signature range with the characteristic range of the query object has intersection, if so, determining current special Levying the corresponding jump chained list of range parameter is jump chained list to be checked.
Further, the device of inquiry data provided in an embodiment of the present invention, further includes:
Memory module, according to the label of data to be stored, is determined for receiving data to be stored in jump chained list set The jump chained list subset of the data to be stored is stored, is then that data to be stored setting is closed according to the feature of the data to be stored Key word determines in jump chained list subset according to the keyword of the data to be stored for storing the skip link of the data to be stored The data to be stored is finally stored in the jump chained list according to the keyword of data to be stored by table.
Further, the enquiry module is further used for the characteristic range gain of parameter query object according to query object Key range inquire data in each jump chained list to be checked then according to the key range of query object, To obtain the query result of each jump chained list to be checked, finally the query result of all jump chained lists to be checked is closed And to obtain final query result.
To achieve the above object, other side according to an embodiment of the present invention provides a kind of electronics for inquiring data Equipment, comprising:
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processing The method that device realizes inquiry data provided in an embodiment of the present invention.
To achieve the above object, other side according to an embodiment of the present invention provides a kind of computer-readable medium, It is stored thereon with computer program, the side of inquiry data provided in an embodiment of the present invention is realized when described program is executed by processor Method.
The data of different labels are respectively stored in difference by the method and apparatus of inquiry data provided in an embodiment of the present invention Jump chained list in, inquiry when, the jump chained list where data is determined according to label, then carries out the number inside jump chained list It is investigated that ask, thus realize the multi-to-multi corresponding relationship based on data and label data query, and relative to it is traditional based on The querying method of relevant database, the method for the present invention carry out the storage of data by jump chained list, so that the mistake of inquiry data The highly efficient quick and performance cost of journey is lower, and the construction cost of storage system is low, and use is more flexible.
In the present invention, multiple jump chained lists are provided for same label data in jump chained list subset, so that same label Multiple data can be respectively stored in different jump chained lists, be stored in the same jump chained list to avoid by all data In, when hot key phenomenon occurs, since bandwidth accesses the generation of overtime phenomenon caused by making.Meanwhile when there are it is multiple to When the jump chained list of inquiry, parallel all jump chained lists to be checked can be inquired, to reduce the time of inquiry Complexity.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the main flow of the method for inquiry data provided in an embodiment of the present invention;
Fig. 2 is the schematic diagram of the application flow of the method for inquiry data provided in an embodiment of the present invention;
Fig. 3 is the main flow provided in an embodiment of the present invention that jump chained list to be checked is determined in jump chained list subset Schematic diagram;
Fig. 4 is the signal of the main flow provided in an embodiment of the present invention that data are inquired in jump chained list to be checked Figure;
Fig. 5 is the schematic diagram of the main modular of the device of inquiry data provided in an embodiment of the present invention;
Fig. 6 is the schematic diagram of the system for generating feed stream of inquiry data provided in an embodiment of the present invention;
Fig. 7 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 8 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
The embodiment of the present invention provides a kind of method for inquiring data, as depicted in figs. 1 and 2, this method comprises: step S101, step S102 and step S103.In step s101, inquiry request is received, inquiry request includes: inquiry tag.User The inquiry request is initiated by client, indicates to need to inquire data corresponding to the label by inquiry tag.In this hair In bright, the corresponding relationship of data and label with multi-to-multi, an i.e. data may be marked with multiple labels, and a label can also It can be marked in a plurality of data.For example, in the application scenarios of electric business platform, the material data that data can flow for feed, one Material data can have the label of multiple dimensions, such as advertising campaign label, type of merchandise label etc., and advertising campaign label or Type of merchandise label can also be marked on other material datas with same characteristic features simultaneously.
In step s101, according to inquiry tag, skip link to be checked is determined in the jump chained list set of pre-configuration Table, wherein jump chained list is used to store the data with same queries label.It is pre-configured with jump chained list collection in the present invention It closes, including at least one chained list that jumps.The chained list skipList that jumps is a kind of quick lookup element traded space for time Data structure, it is a kind of alternate data structure of balanced tree, replaces stringent strong of balanced tree using random equilibrium strategy The tree balance strategy of system, therefore the chained list that jumps has more simple and effective insertion/deletion method, more relative to relevant database Fast search speed and lower construction cost.
In the present invention, data are stored in jump chained list, and the data stored in the chained list that jumps all have same mark Label, jump chained list have tag ID, externally to indicate the label of data that it is stored.It may include more in chained list set of jumping The jump chained list of a difference label, the jump chained list with same label may be multiple.
Step S103 inquires data in jump chained list to be checked, to obtain query result.It is determined in step S102 Data query is carried out in jump chained list to be checked can be obtained the data of corresponding label, and result is then issued to client, To show user.
The data of different labels, are respectively stored in different jumps by the method for inquiry data provided in an embodiment of the present invention In chained list, in inquiry, the jump chained list where data is determined according to label, the data inside jump chained list is then carried out and looks into It askes, to realize the data query of the multi-to-multi corresponding relationship based on data and label, and relative to traditional based on relationship The querying method of type database, the method for the present invention carry out the storage of data by jump chained list, so that the process of inquiry data is more Lower for efficiently quick and performance cost, the construction cost of storage system is low, and use is more flexible.
In embodiments of the present invention, inquiry request further include: the characteristic range parameter of query object, query object, that is, user Want the data of inquiry, with the feature of query object as the condition of inquiry, in the present invention, the feature of data can be combined Specific application scenarios and demand are selected, such as (can browse number to get over for the time of data publication or the temperature of data More, temperature is higher) etc..In step S102, the process of jump chained list to be checked is determined in the jump chained list set of pre-configuration Specifically: firstly, determining the jump chained list subset of the inquiry tag in jump chained list set according to inquiry tag, jump chained list Subset includes: the jump chained list that storage has the data of the inquiry tag, i.e., in the jump chained list subset of a certain inquiry tag All jump chained lists all have same tag ID, that is to say, that all data in the jump chained list subset of i.e. a certain inquiry tag It is labeled with same label.Then according to the characteristic range parameter of query object, jump to be checked is determined in jump chained list subset Jump chained list.
More specifically, in inventive embodiments, as shown in figure 3, determining jump to be checked in jump chained list subset The process of chained list specifically: firstly, obtaining the characteristic range parameter of each of jump chained list subset jump chained list.The present invention In, the characteristic range of data currently stored in jump chained list record after writing data into jump chained list To characteristic range parameter, and after the write-in or deletion of data, real-time update this feature range parameter.When inquiring data, obtain The current characteristic range parameter of the record is taken, to understand the characteristic range of all jump chained lists.
Then, the characteristic range parameter for traversing each jump chained list, to the characteristic range parameter of each jump chained list It executes following judgment steps: judging whether the characteristic range of current signature range and query object has intersection, if so, determination is worked as The corresponding jump chained list of preceding characteristic range parameter is jump chained list to be checked, and jump chained list queue to be checked is added, if it is not, Then give up the corresponding jump chained list of the current characteristic range parameter.Finally judge whether to have judged the feature of all jump chained lists Range parameter, if so, terminating the process for determining jump chained list to be checked in jump chained list subset, if it is not, then will jump The characteristic range parameter of next jump chained list in chained list subset repeats above-mentioned step as current signature range parameter Suddenly, until having judged all characteristic range parameters.
In the present invention, when the characteristic range and the characteristic range of query object of a certain jump chained list have intersection, then show The data that user wants to inquire are stored in the jump chained list to carry out data as jump chained list to be checked to it and look into It askes and can be obtained the data that user wants inquiry.
In the present invention, multiple jump chained lists are provided for same label data in jump chained list subset, so that same label Multiple data can be respectively stored in different jump chained lists, be stored in the same jump chained list to avoid by all data In, when hot key phenomenon occurs (for example, the online of a certain Big event of electric business platform causes some keyword key to access Excessively), the generation of overtime phenomenon is accessed caused by making as bandwidth.Meanwhile when there are multiple jump chained lists to be checked When, parallel all jump chained lists to be checked can be inquired, to reduce the time complexity of inquiry.
In embodiments of the present invention, step S103 inquires data in jump chained list to be checked, to obtain query result Process specifically: firstly, according to the key range of the characteristic range gain of parameter query object of query object, the inquiry pair The key range of elephant is at least a keyword, and keyword is the querying condition that data are inquired in jump chained list.According to looking into The key range for asking object, inquires data in each jump chained list to be checked, to obtain each jump to be checked The query result of jump chained list.Wherein, in jump chained list subset, each keyword is unique, that is to say, with same tag ID Jump chained list between, the keyword of data does not repeat, thus according to the key range of inquiry can jump chained list subset In inquire the corresponding unique data of each keyword.When there are multiple jump chained lists to be checked, this step can be multi-thread Cheng Binghang's inquires all jump chained lists to be checked.Then, the query result of all jump chained lists to be checked Merge, to obtain final complete query result.
In a kind of embodiment of invention, as shown in figure 4, in above-mentioned steps S103 multi-threaded parallel to all to be checked The jump chained list of inquiry inquire and merge query result, can pass through one in java.util.concurrent packet Synchronous assisted class CountDownLatch is realized.Firstly, the main thread quantity m according to jump chained list to be checked, initialization m is a CountDownLatch object, then main thread creates m sub thread and CountDownLatch object is transmitted to sub thread.It Afterwards, main thread calls the await () method of CountDownLatch object to hang up, and sub thread is waited to complete task.Sub thread is simultaneously Send out execution task: each sub thread accesses corresponding jump chained list and carries out data query, and after task execution is complete, calls The value of m is subtracted 1 by countDown () method of CountDownLatch object, when the value of m is reduced to 0, shows all sub threads It has been carried out task.In turn, judge whether that all sub threads have been carried out task according to the value of m, if it is not, then being continued by sub thread Execution task carries out the subsequent process for merging query result by main thread if so, waking up the main thread of hang-up.? In inventive embodiments, the query result of all jump chained lists to be checked can be merged, by multichannel conflation algorithm to obtain most Complete query result eventually.
The method of inquiry data provided in an embodiment of the present invention further includes following by data deposit jump chained list set Process: firstly, receiving data to be stored, according to the label of data to be stored, determine that storage should be wait deposit in jump chained list set Store up the jump chained list subset of data.Then, the feature based on data to be stored is that keyword is arranged in data to be stored, according to wait deposit The keyword of data is stored up, is determined in jump chained list subset for storing the jump chained list of the data to be stored.Finally, will be wait store Data are stored in the jump chained list.
Wherein, in one embodiment of the invention, for a plurality of data to be stored, its average can be assigned to In the multiple jump chained lists being pre-configured.For example, the feature of each data to be stored can be extracted for a plurality of data to be stored (temporal characteristics of such as data) handle feature according to predefined keyword create-rule, generate the keyword of data, Then hash value is calculated according to keyword, so that it is determined that the jump chained list of corresponding hash value, for storing this data to be stored.
The process provided by the invention that data are stored in jump chained list set, what data can be averaged is assigned to pre-configuration Multiple jump chained lists in, on the one hand solve as caused by hot key phenomenon the generation of the overtime phenomenon of access, on the other hand, Reduce the time complexity of jump chained list inquiry, it is assumed that total amount of data N, then using the time of a jump chained list inquiry Complexity is O (log (N)), and the present invention is using multiple (m) jump chained lists, since what data were averaged is assigned to m skip link In table, so that the time complexity of inquiry is reduced to O (log (N/m)), the response speed of inquiry is improved to a certain extent Degree.
In the present invention, predefined keyword create-rule can be set in conjunction with specific application scenarios and demand It sets.For example, keyword create-rule can be pass when the feature of the data to be stored of extraction is temporal characteristics or temperature feature Key word is according to the time of data to be stored or temperature monotonic increase or successively decreases.
In the present invention, jump chained list in the jump chained list quantity in chained list subset of jumping, and jump chained list set The quantity of collection can be set according to concrete application scene and demand.For example, in electric business sample platform, data that the present invention inquires For the material of composition feed stream, the scale with 10,000,000 materials can be developed to after in a few years when estimating certain theme label, Evaluating a jump chained list according to storage medium can store ten Wan Sucai simultaneously, then can be by the theme label Jump chained list subset in jump chained list quantity be set as 100.
Below with reference to a specific application scenarios, the method for inquiry data provided in an embodiment of the present invention is made further Explanation.In this application scene, jump chained list set is used to store the id information of the material of feed stream, and the id information of material has The theme label of preliminary making, in this example, the feature of the id information of material is selected as the time of material publication, the pass of the id information of material Key word key is got over according to its feature (issuing time) monotone decreasing, the i.e. more early material of issuing time, the key value of id information Greatly, the sequence in jump chained list more rearward, on the contrary, for the material of newest publication, the key value minimum of id information, Sequence in jump chained list is near preceding.
During the id information for being stored in material, after the keyword for the id information that material has been determined, according to the material Theme label determines multiple jump chained lists with theme label ID in jump chained list set.Then, it is based on keyword, according to Hash algorithm determines the id information of the material jump chained list to be stored in, and the ID of material is believed in above-mentioned multiple jump chained lists Breath deposit, while the institute stored in the jump chained list (is shown according to the characteristic range parameter that its feature updates the jump chained list There is the issuing time range of material).
When user clicks a certain theme label in mobile terminal and has selected the time range of feed stream (as most under the theme Nearly one week) when, it includes: the theme label in the request that mobile terminal, which issues the inquiry request of the corresponding feed stream of the theme label, With the characteristic range (nearest one week time range) of query object.
Then the jump chained list with theme label ID where can determine material according to theme label is sentenced respectively Break these jump chained lists time range and query object time range either with or without intersection, if so, then show jump chained list in It is stored with the id information for the material issued in nearest one week time range, using the jump chained list as skip link to be checked Table.
Using the id information for inquiring material from multiple jump chained lists to be checked of multi-threaded parallel, then by main thread The id information of these materials is incorporated as to final query result by multichannel and reduction method.It is returned due to each sub thread What the id information of material was ordered, it can be obtained the ID of all materials of composition feed stream using multichannel conflation algorithm at this time The specifying information of the ordered arrangement of information, material can be stored in redis database, using in above-mentioned final query result The id information of material goes in redis database the specifying information for extracting material to return to client, so that material is formed feed It flows and shows user.
The embodiment of the present invention also provides a kind of device for inquiring data, as shown in figure 5, the device 500 includes: receiving module 501, determining module 502 and enquiry module 503.
For receiving module 501 for receiving inquiry request, inquiry request includes: inquiry tag.
Determining module 502 is used to determine jump to be checked in the jump chained list set of pre-configuration according to inquiry tag Chained list, wherein jump chained list is used to store the data with same queries label.
Enquiry module 503 is for inquiring data in jump chained list to be checked, to obtain query result.
In embodiments of the present invention, inquiry request further include: the characteristic range parameter of query object.
Determining module is further used for determining the jump chained list of the inquiry tag in jump chained list set according to inquiry tag Subset, jump chained list subset includes: the jump chained list that storage has the data of the inquiry tag, then according to the spy of query object Range parameter is levied, determines jump chained list to be checked in jump chained list subset.
In embodiments of the present invention, determining module is further used for obtaining each of jump chained list subset jump chained list Characteristic range parameter, then to each jump chained list characteristic range parameter execute following step:
Judge whether current signature range with the characteristic range of query object has intersection, if so, determining current signature model Enclosing the corresponding jump chained list of parameter is jump chained list to be checked.
In embodiments of the present invention, enquiry module is further used for being inquired according to the characteristic range gain of parameter of query object The key range of object is inquired in each jump chained list to be checked then according to the key range of query object Data, to obtain the query result of each jump chained list to be checked, finally the inquiry of all jump chained lists to be checked As a result merge, to obtain final query result.
The device for the inquiry data that the embodiment of the present invention also provides further include: memory module.Memory module, for receive to Storing data determines the jump chained list for storing the data to be stored according to the label of data to be stored in jump chained list set Then subset is that keyword is arranged in the data to be stored according to the feature of the data to be stored, according to the pass of the data to be stored Key word determines in jump chained list subset for storing the jump chained list of the data to be stored, finally according to the pass of data to be stored The data to be stored is stored in the jump chained list by key word.
The embodiment of the present invention also provides a kind of system of generation feed stream, which is applied to inquire element according to theme label In application scenarios of the material to generate feed stream, as shown in fig. 6, the system includes: material release unit, material management unit, stream Formula computing unit, storage unit and multiple thread units.
Wherein, the creator that material release unit is supplied to material carries out material publication, this is all materials of this system Source, the material of publication submit to the audit of material management unit.
Material management unit is used by the service side for providing feed stream, is used to manage material, the material of publication is audited By and it is online.It is wherein integrated with the function of the memory module in the above embodiment of the present invention, the material of publication is received, in material After online, by material hash into different jump chained lists, while the characteristic range parameter of each jump chained list is updated to streaming Computing module.
The function of the receiving module and determining module that are integrated in the above embodiment of the present invention in streaming computing unit, is used for It safeguards that the characteristic range parameter of each jump chained list receives the request of user when user is issued by client to be requested, filters The jump chained list for not needing access, is pin-pointed to the jump chained list comprising required data.
Storage unit is the unit for storing material related data, it is by jump chained list set Lai real in the present invention It is existing.For example, as shown in the figure, storage unit includes n jump chained list skiplist1 to skiplist n, in each jump chained list A plurality of data are stored with, every data includes: keyword key and value value, and value is the id information of material.
It is integrated with the function of the enquiry module in the above embodiment of the present invention in multiple thread units, is used for single for storage In member, material related data by hash to multiple skip link tables the case where, go access evidence simultaneously using multiple threads, take data Carry out assembling simultaneously returned data in main thread again afterwards.
The data of different labels are respectively stored in difference by the method and apparatus of inquiry data provided in an embodiment of the present invention Jump chained list in, inquiry when, the jump chained list where data is determined according to label, then carries out the number inside jump chained list It is investigated that ask, thus realize the multi-to-multi corresponding relationship based on data and label data query, and relative to it is traditional based on The querying method of relevant database, the method for the present invention carry out the storage of data by jump chained list, so that the mistake of inquiry data The highly efficient quick and performance cost of journey is lower, and the construction cost of storage system is low, and use is more flexible.In the present invention, jumping Multiple jump chained lists are provided for same label data in jump chained list subset, multiple data of same label are stored respectively In different jump chained lists, it is stored in the same jump chained list to avoid by all data, when hot key phenomenon occurs, Since bandwidth accesses the generation of overtime phenomenon caused by making.It, can be with meanwhile when there are multiple jump chained lists to be checked Parallel inquires all jump chained lists to be checked, to reduce the time complexity of inquiry.
Fig. 7 is shown can be using the exemplary of the device of the method or inquiry data of the inquiry data of the embodiment of the present invention System architecture 700.
As shown in fig. 7, system architecture 100 may include terminal device 701,702,703, network 704 and server 705. Network 104 between terminal device 701,702,703 and server 705 to provide the medium of communication link.Network 704 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 701,702,703 and be interacted by network 704 with server 705, to receive or send out Send message etc..Various telecommunication customer end applications can be installed on terminal device 701,702,703, such as looked into server transmission Ask the application of request of data.
Terminal device 701,702,703 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 705 can be to provide the server of various services, such as utilize terminal device 701,702,703 to user The shopping class website browsed provides the back-stage management server supported.Back-stage management server can be according to the inquiry received Request of data carries out data query, and query result is fed back to terminal device.
It should be noted that the method for inquiry data provided by the embodiment of the present invention is generally executed by server 705, phase Ying Di, the device for inquiring data are generally positioned in server 705.
It should be understood that the number of terminal device, network and server in Fig. 7 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Below with reference to Fig. 8, it illustrates the computer systems 800 for the terminal device for being suitable for being used to realize the embodiment of the present invention Structural schematic diagram.Terminal device shown in Fig. 8 is only an example, function to the embodiment of the present invention and should not use model Shroud carrys out any restrictions.
As shown in figure 8, computer system 800 includes central processing unit (CPU) 801, it can be read-only according to being stored in Program in memory (ROM) 802 or be loaded into the program in random access storage device (RAM) 803 from storage section 808 and Execute various movements appropriate and processing.In RAM 803, also it is stored with system 800 and operates required various programs and data. CPU 801, ROM 802 and RAM 803 are connected with each other by bus 804.Input/output (I/O) interface 805 is also connected to always Line 804.
I/O interface 805 is connected to lower component: the importation 806 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 807 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 808 including hard disk etc.; And the communications portion 809 of the network interface card including LAN card, modem etc..Communications portion 809 via such as because The network of spy's net executes communication process.Driver 810 is also connected to I/O interface 805 as needed.Detachable media 811, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 810, in order to read from thereon Computer program be mounted into storage section 808 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.? In such embodiment, which can be downloaded and installed from network by communications portion 809, and/or from can Medium 811 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 801, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include receiving module, determining module, enquiry module and memory module.Wherein, the title of these modules not structure under certain conditions The restriction of the pairs of module itself, for example, determining module is also described as " for obtaining in the jump chained list subset The module of the characteristic range parameter of each jump chained list ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes Obtaining the equipment includes:
Inquiry request is received, the inquiry request includes: inquiry tag;
According to inquiry tag, jump chained list to be checked is determined in the jump chained list set of pre-configuration, wherein the jump Jump chained list is used to store the data with same queries label;
Data are inquired in jump chained list to be checked, to obtain query result.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (12)

1. a kind of method for inquiring data characterized by comprising
Inquiry request is received, the inquiry request includes: inquiry tag;
According to inquiry tag, jump chained list to be checked is determined in the jump chained list set of pre-configuration, wherein the skip link Table is used to store the data with same queries label;
Data are inquired in jump chained list to be checked, to obtain query result.
2. the method according to claim 1, wherein the inquiry request further include: the feature model of query object Enclose parameter;
Determine that jump chained list to be checked includes: in the jump chained list set of pre-configuration
According to inquiry tag, the jump chained list subset of the inquiry tag in jump chained list set, the jump chained list subset are determined It include: the jump chained list that storage has the data of the inquiry tag;
According to the characteristic range parameter of the query object, jump chained list to be checked is determined in the jump chained list subset.
3. according to the method described in claim 2, it is characterized in that, determining jump to be checked in the jump chained list subset Chained list includes:
Obtain the characteristic range parameter of each of jump chained list subset jump chained list;
Following step is executed to the characteristic range parameter of each jump chained list:
Judge whether current signature range with the characteristic range of the query object has intersection, if so, determining current signature model Enclosing the corresponding jump chained list of parameter is jump chained list to be checked.
4. according to the method in claim 2 or 3, which is characterized in that further include:
Receive data to be stored;
According to the label of data to be stored, the jump chained list subset for storing the data to be stored is determined in jump chained list set;
It is that keyword is arranged in the data to be stored according to the feature of the data to be stored;
According to the keyword of the data to be stored, determine in jump chained list subset for storing the skip link of the data to be stored Table;
The data to be stored is stored in the jump chained list according to the keyword of data to be stored.
5. according to the method described in claim 4, it is characterized in that, data are inquired in jump chained list to be checked, to obtain Query result includes:
According to the key range of the characteristic range gain of parameter query object of query object;
According to the key range of query object, data are inquired in each jump chained list to be checked, to obtain each The query result of jump chained list to be checked;
The query result of all jump chained lists to be checked is merged, to obtain final query result.
6. a kind of device for inquiring data characterized by comprising
Receiving module, for receiving inquiry request, the inquiry request includes: inquiry tag;
Determining module, for determining jump chained list to be checked in the jump chained list set of pre-configuration according to inquiry tag, In, the jump chained list is used to store the data with same queries label;
Enquiry module, for inquiring data in jump chained list to be checked, to obtain query result.
7. device according to claim 6, which is characterized in that the inquiry request further include: the feature model of query object Enclose parameter;
The determining module is further used for determining the jump chained list of the inquiry tag in jump chained list set according to inquiry tag Subset, the jump chained list subset includes: the jump chained list that storage has the data of the inquiry tag, then according to the inquiry The characteristic range parameter of object determines jump chained list to be checked in the jump chained list subset.
8. device according to claim 7, which is characterized in that the determining module is further used for obtaining the skip link The characteristic range parameter of each of table subset jump chained list, then executes the characteristic range parameter of each jump chained list Following step:
Judge whether current signature range with the characteristic range of the query object has intersection, if so, determining current signature model Enclosing the corresponding jump chained list of parameter is jump chained list to be checked.
9. device according to claim 7 or 8, which is characterized in that further include:
Memory module, according to the label of data to be stored, determines storage in jump chained list set for receiving data to be stored Then the jump chained list subset of the data to be stored is that data to be stored setting is crucial according to the feature of the data to be stored Word determines the jump chained list for being used to store the data to be stored in jump chained list subset according to the keyword of the data to be stored, The data to be stored is finally stored in by the jump chained list according to the keyword of data to be stored.
10. device according to claim 9, which is characterized in that the enquiry module is further used for according to query object Characteristic range gain of parameter query object key range, then according to the key range of query object, at each Data are inquired in jump chained list to be checked, to obtain the query result of each jump chained list to be checked, finally all The query result of jump chained list to be checked merges, to obtain final query result.
11. a kind of electronic equipment for inquiring data characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 5 is realized when row.
CN201810145202.3A 2018-02-12 2018-02-12 Method and device for inquiring data Active CN110334114B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810145202.3A CN110334114B (en) 2018-02-12 2018-02-12 Method and device for inquiring data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810145202.3A CN110334114B (en) 2018-02-12 2018-02-12 Method and device for inquiring data

Publications (2)

Publication Number Publication Date
CN110334114A true CN110334114A (en) 2019-10-15
CN110334114B CN110334114B (en) 2024-05-17

Family

ID=68138801

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810145202.3A Active CN110334114B (en) 2018-02-12 2018-02-12 Method and device for inquiring data

Country Status (1)

Country Link
CN (1) CN110334114B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113434572A (en) * 2021-06-24 2021-09-24 中国工商银行股份有限公司 Data query method, query system, device, storage medium and program product
CN114116368A (en) * 2020-08-31 2022-03-01 上海阵量智能科技有限公司 Data processing method and device for system chip performance monitoring

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479223A (en) * 2010-11-25 2012-05-30 中国移动通信集团浙江有限公司 Data query method and system
US20140032563A1 (en) * 2012-07-27 2014-01-30 Soren Bogh Lassen Indexing Based on Object Type
CN103729471A (en) * 2014-01-21 2014-04-16 华为软件技术有限公司 Method and device for database query
CN103942289A (en) * 2014-04-12 2014-07-23 广西师范大学 Memory caching method oriented to range querying on Hadoop
CN104346362A (en) * 2013-07-29 2015-02-11 腾讯科技(深圳)有限公司 Method and device for finding target objects on basis of attribute values
US20160232241A1 (en) * 2015-02-06 2016-08-11 Facebook, Inc. Aggregating News Events on Online Social Networks
CN106933914A (en) * 2015-12-31 2017-07-07 北京国双科技有限公司 The data processing method and device of many tables of data

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102479223A (en) * 2010-11-25 2012-05-30 中国移动通信集团浙江有限公司 Data query method and system
US20140032563A1 (en) * 2012-07-27 2014-01-30 Soren Bogh Lassen Indexing Based on Object Type
CN104346362A (en) * 2013-07-29 2015-02-11 腾讯科技(深圳)有限公司 Method and device for finding target objects on basis of attribute values
CN103729471A (en) * 2014-01-21 2014-04-16 华为软件技术有限公司 Method and device for database query
CN103942289A (en) * 2014-04-12 2014-07-23 广西师范大学 Memory caching method oriented to range querying on Hadoop
US20160232241A1 (en) * 2015-02-06 2016-08-11 Facebook, Inc. Aggregating News Events on Online Social Networks
CN106933914A (en) * 2015-12-31 2017-07-07 北京国双科技有限公司 The data processing method and device of many tables of data

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114116368A (en) * 2020-08-31 2022-03-01 上海阵量智能科技有限公司 Data processing method and device for system chip performance monitoring
CN113434572A (en) * 2021-06-24 2021-09-24 中国工商银行股份有限公司 Data query method, query system, device, storage medium and program product

Also Published As

Publication number Publication date
CN110334114B (en) 2024-05-17

Similar Documents

Publication Publication Date Title
US10127285B2 (en) Customizable ranking of search engine results in multi-tenant architecture
JP5453696B2 (en) System and method for effectively providing content to client devices in an electronic network
CN102763085B (en) Cloud service catalogue is used to supply service
CN105745646B (en) Native application search result
CN109947788A (en) Data query method and apparatus
CN109766497A (en) Ranking list generation method and device, storage medium, electronic equipment
EP2524318B1 (en) Syndication of multiple service instances
CN110209677A (en) The method and apparatus of more new data
US9390444B2 (en) Method, medium, and system for providing a subset of products
US11188543B2 (en) Utilizing social information for recommending an application
US10134067B2 (en) Autocomplete of searches for data stored in multi-tenant architecture
CN108959294A (en) A kind of method and apparatus accessing search engine
CN112784195B (en) A method and system for publishing page data
CN110334114A (en) A kind of method and apparatus for inquiring data
US10268991B1 (en) Dynamic selection across cache
CN110020349A (en) The method and device of page rendering
CN112732382B (en) A page display method, device, system, electronic device and storage medium
JP2023507694A (en) Merchandise processing methods and components, electronic devices, computer readable media
US12248658B2 (en) Optical fiber web application
CN102185863A (en) Intelligent data interactive publishing system and method between server and client
CN110109947A (en) The method and apparatus for extracting data
CN116521285A (en) Application trial method and device, electronic equipment and storage medium
CN114547455B (en) Method and device for determining hot object, storage medium and electronic equipment
CN113495887A (en) Data form processing method, device and system
CN113627998B (en) Order data processing method, device, electronic device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载