CN110598009B - Method and device for searching works, electronic equipment and storage medium - Google Patents

Method and device for searching works, electronic equipment and storage medium Download PDF

Info

Publication number
CN110598009B
CN110598009B CN201910864234.3A CN201910864234A CN110598009B CN 110598009 B CN110598009 B CN 110598009B CN 201910864234 A CN201910864234 A CN 201910864234A CN 110598009 B CN110598009 B CN 110598009B
Authority
CN
China
Prior art keywords
work
keyword
type
index
global
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910864234.3A
Other languages
Chinese (zh)
Other versions
CN110598009A (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 Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet 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 Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910864234.3A priority Critical patent/CN110598009B/en
Publication of CN110598009A publication Critical patent/CN110598009A/en
Application granted granted Critical
Publication of CN110598009B publication Critical patent/CN110598009B/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/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/41Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/43Querying
    • G06F16/435Filtering based on additional data, e.g. user or group profiles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/43Querying
    • G06F16/438Presentation of query results

Landscapes

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

Abstract

The embodiment of the disclosure provides a method and a device for searching works, electronic equipment and a storage medium, which are applied to the technical field of multimedia. The method for searching works comprises the following steps: acquiring the type ID of the work type of the work corresponding to the keyword of the query request and the keyword ID of the keyword of the work; splicing and combining the type ID and the keyword ID to obtain the global ID of the work corresponding to the keyword of the query request; determining an index item comprising a global ID of the work corresponding to the keyword of the query request according to a pre-established inverted index; and obtaining the works corresponding to the keywords of the query request from the storage addresses included in the determined index items. In the embodiment of the disclosure, only one index service needs to be provided, and under the condition of reducing the occupation of server resources, the search of different types of works is effectively realized.

Description

Method and device for searching works, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of multimedia technologies, and in particular, to a method and an apparatus for searching works, an electronic device, and a storage medium.
Background
In the technical field of multimedia, indexes are often required to be created for works such as videos, topic texts, music and the like, so that when the works need to be displayed to a user, a server can quickly find the corresponding works through the indexes and display the found corresponding works to the user.
In the related technology, in order to search works, works with common characteristics, such as works with text labels manually added by users, works with background music, works using magic expressions and the like, are divided into the same type according to the common characteristics of the works, and independent index services are respectively provided for the different types of the works; for example, a single index service is provided for works with text labels, another single index service is provided for works with background music, and further when works with text labels or works with background music are searched, the works need to be searched based on the index services corresponding to the provided works.
Since different index services need to be provided for different types of works, when the types of the provided index services are more, more server resources are undoubtedly occupied. Therefore, under the condition of reducing the occupation of server resources, how to effectively realize the search of different types of works is an urgent problem to be solved.
Disclosure of Invention
The present disclosure provides a method, an apparatus, an electronic device and a storage medium for searching works, so as to at least solve the problem in the prior art of how to effectively search different types of works while reducing the occupation of server resources. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method of finding a work, including:
acquiring the type ID of the product type of the product to be searched corresponding to the keyword of the query request and the keyword ID of the keyword of the product;
splicing and combining the type ID and the keyword ID according to a splicing and combining mode to obtain a global ID of a work corresponding to the keyword of the query request to be searched;
according to a pre-established inverted index, determining an index item comprising a global ID of a work corresponding to a keyword of the query request to be searched, wherein each index item of the inverted index comprises a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated;
and acquiring the works corresponding to the keywords of the query request to be searched from the storage address included by the determined index item.
In one embodiment, the number of the works corresponding to the obtained keywords of the query request to be searched is multiple, and the method further includes:
according to the attribute characteristics of the works, sequencing the works corresponding to the keywords of the obtained query requests to be searched to obtain the display sequence information of the works corresponding to the keywords of the obtained query requests to be searched;
and sending the works corresponding to the keywords of the query requests to be searched and the display sequence information to a client.
In one embodiment, the work attribute characteristics include one or more of a predicted click through rate of the work, a click through rate of the work as a ratio of a number of times the work is clicked through to play to a number of times the work is presented, and a correlation of the work to keywords as a ratio of a number of times the work is clicked through to play to a number of times the work is clicked through to play, the correlation of the work to keywords indicating how close the content of the work is to the keywords.
In an embodiment, the performing a splicing combination on the type ID and the keyword ID according to a splicing combination manner to obtain a global ID of a work corresponding to the keyword of the query request to be searched includes:
splicing and combining the tail part of the type ID and the head part of the keyword ID to obtain the global ID of the work corresponding to the keyword of the query request to be searched, wherein the work comprises the type ID and the keyword ID; or
And splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the work corresponding to the keyword of the query request to be searched, which comprises the type ID and the keyword ID.
According to a second aspect of the embodiments of the present disclosure, there is provided an index creating method of a work, including:
acquiring the type ID of the work type of the index work to be created and the keyword ID of the keyword of the work;
splicing and combining the type ID and the keyword ID according to a splicing and combining mode to obtain a global ID of the index work to be created;
and creating an inverted index by taking the constructed global ID and the storage address of the index work to be created as index items.
In an embodiment, the splicing and combining the type ID and the keyword ID according to a splicing and combining manner to obtain a global ID of the index work to be created includes:
splicing and combining the tail part of the type ID and the head part of the key word ID to obtain a global ID of the index work to be created, wherein the global ID comprises the type ID and the key word ID; or
And splicing and combining the tail part of the key word ID and the head part of the type ID to obtain the global ID of the index work to be created, which comprises the type ID and the key word ID.
In one embodiment, after the step of obtaining the type ID of the work type of the index work to be created and the key ID of the work key, the method further includes:
and if the keyword ID of the work keyword is not obtained, generating the keyword ID of the work keyword of the index work to be created.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for searching for a work, including:
the first acquisition module is configured to execute acquisition of a type ID of a work type of a work corresponding to a keyword of a query request and a keyword ID of the keyword;
the first combination module is configured to perform combination of the type ID and the keyword ID according to a combination manner to obtain a global ID of a work corresponding to the keyword of the query request;
the determining module is configured to execute determining, according to a pre-established inverted index, an index item including a global ID of a work corresponding to a keyword of the query request, where each index item of the inverted index includes a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated;
and the acquisition module is configured to acquire the works corresponding to the keywords of the query request from the storage addresses included in the determined index items.
In one embodiment, the number of the works corresponding to the obtained keywords of the query request is multiple, and the apparatus further includes:
the sequencing module is configured to sequence the works corresponding to the keywords of the acquired query requests according to the attribute characteristics of the works to obtain the display sequence information of the works corresponding to the keywords of the acquired query requests;
and the sending module is configured to execute sending the works corresponding to the keywords of the acquired query requests and the display sequence information to a client.
In one embodiment, the work attribute characteristics include one or more of a predicted click through rate of the work, a click through rate of the work as a ratio of a number of times the work is clicked through to play to a number of times the work is presented, and a relevance of the work to the keywords as a ratio of a number of times the work is clicked through to play.
In an embodiment, the first combining module is specifically configured to perform splicing and combining a tail part of the type ID and a head part of the keyword ID to obtain a global ID of a work corresponding to a keyword of the query request including the type ID and the keyword ID; or splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the work corresponding to the keyword of the query request comprising the type ID and the keyword ID.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an index creating apparatus of a work, including:
a second obtaining module configured to perform obtaining a type ID of a work type of an index work to be created and a keyword ID of a work keyword;
the second combination module is configured to perform splicing combination on the type ID and the keyword ID according to a splicing combination mode to obtain a global ID of the index work to be created;
and the first creation module is configured to create the inverted index by taking the constructed global ID and the storage address of the index work to be created as index items.
In an embodiment, the second combining module is specifically configured to perform splicing of the tail of the type ID and the head of the keyword ID to obtain a global ID of an index work to be created, where the global ID includes the type ID and the keyword ID; or splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the index work to be created, wherein the global ID comprises the type ID and the keyword ID.
In one embodiment, the apparatus further comprises:
and the generation module is configured to execute the step of obtaining the type ID of the work type of the index work to be created and the keyword ID of the work keyword, and then generate the keyword ID of the work keyword of the index work to be created if the keyword ID of the work keyword is not obtained.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a method of finding a work as described above.
According to a sixth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of finding a work as described above.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer program product which, when run on a computer, causes the computer to perform the method of finding a work as described above.
According to an eighth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the index creation method for a work as described above.
According to a ninth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the index creation method of a work as described above.
According to a tenth aspect of embodiments of the present disclosure, there is provided a computer program product which, when run on a computer, causes the computer to execute the index creation method of a work as described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
acquiring the type ID of the work type of the work corresponding to the keyword of the query request and the keyword ID of the keyword of the work; splicing and combining the type ID and the keyword ID according to a splicing and combining mode to obtain the global ID of the work corresponding to the keyword of the query request; according to a pre-established inverted index, determining an index item comprising a global ID of a work corresponding to a keyword of the query request, wherein each index item of the inverted index comprises a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated, and the work corresponding to the keyword of the query request is obtained from the storage address included in the determined index item. In the embodiment of the disclosure, since the global ID can represent the type ID and the keyword ID of the work, different types of works can be searched in one index service, compared with the prior art in which different types of works need to provide different index services, the method only needs to provide one index service, and the search of different types of works is effectively realized under the condition of reducing the occupation of server resources.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a flow diagram illustrating a method of finding a work in accordance with an exemplary embodiment.
FIG. 2 is another flow diagram illustrating a method of finding a work in accordance with an exemplary embodiment.
FIG. 3 is a flow chart illustrating a method of index creation for a work in accordance with an exemplary embodiment.
FIG. 4-1 is a block diagram illustrating an exemplary structure of an apparatus for finding a work according to one illustrative embodiment.
FIG. 4-2 is a schematic block diagram illustrating another configuration of an apparatus for finding a work according to an exemplary embodiment.
FIG. 5-1 is a block diagram illustrating a schematic structure of an index creation apparatus for a work according to an exemplary embodiment.
Fig. 5-2 is a schematic block diagram illustrating another structure of an index creating apparatus for a work according to an exemplary embodiment.
FIG. 6 is a block diagram illustrating an apparatus for finding a work in accordance with an exemplary embodiment.
FIG. 7 is a block diagram illustrating an apparatus for index creation of a work in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
FIG. 1 is a flow diagram illustrating a method of finding a work, according to an exemplary embodiment, as shown in FIG. 1, including the steps of:
in step S11, the type ID of the work type of the work corresponding to the keyword of the query request and the keyword ID of the keyword are acquired.
The works corresponding to the keywords of the query request may be the works requested to be read or watched by the user, and the division of the types of the works may be performed according to the commonalities of the contents of the works, for example, the types of the works with background music may be divided into the types of the works with background music. The keywords of the works are words having substantial meaning for the content of the works, and if the background music of the works with the background music is sky city, the user can input a query request of sky city to search the works with the background music of sky city, and the sky city can be used as the keywords. The type ID and the keyword ID may be preset numerical values, each type ID corresponds to a type of work, and each keyword ID corresponds to a keyword.
In this step, after receiving a read work request sent by a reader who wants to view a work, a preset type ID corresponding to the work type identifier and a preset keyword ID corresponding to the keyword of the work may be obtained according to the keyword of the work and the work type identifier corresponding to the keyword of the query request in the request.
In step S12, the type ID and the keyword ID are combined in a splicing manner to obtain a global ID of the work corresponding to the keyword of the query request.
The global ID is obtained by splicing and combining the type ID and the keyword ID according to a splicing combination mode, is unique and represents the ID of the work in the index service.
In this step, after the type ID and the keyword ID are obtained, the type ID and the keyword ID may be combined in a splicing combination manner to obtain a global ID of a work corresponding to a keyword of the query request including the type ID and the keyword ID. For example, if the obtained type ID is 10101011 and the keyword ID is 11100101, the global ID obtained after the concatenation combination may be 1010101111100101, or may be concatenated in another manner, which is not limited in this embodiment.
In step S13, according to a pre-established inverted index, determining an index item including a global ID of a work corresponding to a keyword of the query request, where each index item of the inverted index includes a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated.
The pre-established inverted index is an index mode for searching records according to index values, and each item in the index table comprises an attribute value and the address of each record with the attribute value. In this step, each index entry in the pre-established inverted index may include a global ID and a storage address of a work corresponding to the global ID. The global ID may be an attribute value of the inverted index, and the storage address may be an address of a record of the inverted index. After the global ID is generated in step S12, the index entry including the global ID of the work corresponding to the keyword of the query request may be determined according to the inverted index established in advance.
In step S14, the work corresponding to the keyword of the query request is obtained from the storage address included in the determined index entry.
In this step, the work corresponding to the global ID may be found through the storage address in the determined index entry. And, the number of works corresponding to the keyword of the obtained query request may be one or more.
In the embodiment of the disclosure, since the global ID can represent the type ID and the keyword ID of the work, different types of works can be searched in one index service, compared with the prior art in which different types of works need to provide different index services, the method only needs to provide one index service, and the search of different types of works is effectively realized under the condition of reducing the occupation of server resources.
The method for finding a work provided by the embodiment of the present disclosure is described in detail below, and fig. 2 is another flowchart of the method for finding a work according to an exemplary embodiment, as shown in fig. 2, including the following steps:
in step S21, the type ID of the work type of the work corresponding to the keyword of the inquiry request and the keyword ID of the work keyword are acquired.
In this step, the work corresponding to the keyword of the query request may be a work that the user requests to read or view. Wherein the work type may include: a type of work with text labels, a type of work framed with the original work, a type of work with background music, a type of work using magic expression, and the like. The corresponding type ID may be preset for each type of work, for example, the type ID of the type of work with text labels may be preset to 1, the type ID of the type of work in the same frame with the original work may be preset to 2, the type ID of the type of work with background music may be preset to 3, and the type ID of the type of work using magic expression may be preset to 4. The preset type ID can form a table with the work type or the work type identification for subsequent query acquisition.
Wherein, the key words of the work are different according to the work or the type of the work, for example, the work with text labels, such as # king glory #, the key words can be 'king glory', such as # zhangsan and wangwu #, and the key words can be 'zhangsan and wangwwu'; the key words of the works in the same frame with the original works can be the names of the works of the original works or the names of actors in the original works, etc.; the key words of the composition with the background music can be the music name of the background music; the key word of the work using the magic expression may be the name of the magic expression. Similarly, a corresponding key ID may be preset for each key, and the key ID may be preset to 32-bit long integer data.
In this step, after receiving a request for reading a work sent by a reader who wants to view the work, a preset type ID and a keyword ID corresponding to the keyword and the work type identifier of the work corresponding to the keyword of the query request in the request may be obtained. The obtaining mode can be a table look-up mode.
In step S22, the type ID and the keyword ID are combined in a splicing manner to obtain a global ID of the work corresponding to the keyword of the query request.
In this step, after the type ID and the keyword ID are obtained, the type ID and the keyword ID may be spliced and combined in a splicing and combining manner to obtain a global ID of a work corresponding to a keyword of the query request including the type ID and the keyword ID. Specifically, the tail part of the type ID and the head part of the keyword ID may be spliced and combined to obtain the global ID of the work corresponding to the keyword of the query request including the type ID and the keyword ID; for example, if the type ID is 123 and the key ID is 5678, the tail of 123 is spliced with the head of 5678 to obtain a global ID of 1235678. Or splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the work corresponding to the keyword of the query request comprising the type ID and the keyword ID; for example, after the tail of 5678 is spliced with the head of 123, the global ID is 5678123.
Alternatively, the type ID and the keyword ID may be combined by using a separator "|", for example, in a work with background music "liang zhu", if the type ID of the work type with background music is 100 and the ID of the keyword "liang zhu" is 6668, data in the form of "100 | 6668" may be obtained as the global ID of the work corresponding to the keyword of the query request by combining the type ID and the keyword ID. Or may be in other combinations, which are not listed here.
In step S23, according to a pre-established inverted index, determining an index item including a global ID of a work corresponding to a keyword of the query request, where each index item of the inverted index includes a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated.
The pre-established inverted index is an index mode for searching records according to index values, and each item in the index table comprises an attribute value and the address of each record with the attribute value. In this step, each index entry in the pre-established inverted index may include a global ID, where the global ID is an index value, and a storage address of a work corresponding to the global ID, where the storage address is an address of each record having the attribute value. After the global ID is generated in step S12, the index entry including the global ID of the work corresponding to the keyword of the query request may be determined according to the inverted index established in advance.
In step S24, the work corresponding to the keyword of the query request is obtained from the storage address included in the determined index entry.
In this step, the work corresponding to the global ID can be found through the storage address in the determined index entry.
In step S25, when there are a plurality of works corresponding to the keywords of the obtained query request, the works corresponding to the keywords of each obtained query request are sorted according to the predetermined attribute features of the works, so as to obtain the display order information of the works corresponding to the keywords of each obtained query request.
The attribute characteristics of the work can be a predicted click rate of the work, a click rate of the work or a correlation degree between the work and keywords, the predicted click rate is a ratio of a number of times that the work is clicked to play to the number of times that the work is displayed in a pre-estimated manner, the click rate is a ratio of the number of times that the work is clicked to play to the number of times that the work is clicked to play, the correlation degree between the work and the keywords represents a correlation degree between content of the work and the keywords, and a calculation method for applying the correlation degree can refer to the prior art, and details are not described herein. In this step, the searched works may be sorted according to one or more of the above-mentioned work attribute features of the works, and the display order of the obtained works is display order information. It can be understood that the global IDs corresponding to the searched works are the same global ID.
In step S26, the works corresponding to the keywords of each acquired query request and the presentation order information are sent to the client.
In this step, the works and the display sequence information corresponding to the keywords of each acquired query request may be sent to the client through a unified interface between the server and the client.
According to the technical scheme provided by the embodiment of the disclosure, the searched works can be sequenced according to the attribute characteristics of the works, so that the works displayed by the client are more popular with readers, and the experience is better.
Accordingly, there is also provided in an exemplary embodiment a flow chart of a method of index creation for a work, as shown in fig. 3, comprising:
in step S31, the type ID of the work type of the index work to be created and the key ID of the work key are acquired.
In this step, after receiving the works uploaded by the user, according to keywords of the uploaded works and the work type identifiers, a preset type ID corresponding to the work type identifiers and a preset keyword ID corresponding to the keywords may be obtained. The type ID corresponding to the work type identifier may be the work type identifier itself, or may be other data besides the work type identifier, for example, the type ID may also be 32-bit long integer data. For example, if the user uploads a work with background music of "Liangzhu", the ID corresponding to "Liangzhu" may be obtained, and the type ID of the type of the work with background music may be obtained.
In step S32, the type ID and the keyword ID are spliced and combined according to the splicing and combining manner, so as to obtain a global ID of the index work to be created.
In this step, after the type ID and the keyword ID of the index work to be created are obtained, the global ID of the index work to be created may be constructed based on the type ID and the keyword ID, and specifically, the tail of the type ID and the head of the keyword ID may be spliced and combined to obtain the global ID of the index work to be created including the type ID and the keyword ID; or splicing and combining the tail part of the key word ID and the head part of the type ID to obtain the global ID of the index work to be created, which comprises the type ID and the key word ID. For example, if the ID corresponding to the "bridge congratulatory message" is binary 10101110, and the type ID of the type of the work with background music is binary 10001001, the global ID of 1010111010001001 or 1000100110101110 can be obtained by concatenating 10101110 and 10001001.
Alternatively, optionally, the type ID and the keyword ID may also be combined by using the symbol "-", for example, for a work with background music "lianzhu", if the type ID of the work with background music is 1100, and the ID of the keyword "lianzhu" is 1010101, the data in the form of "1100-" 1010101 "may be obtained after combining the type ID and the keyword ID, and the data is used as the global ID of the index work to be created. Or may be in other combinations, which are not listed here.
In step S33, an inverted index is created with the constructed global ID and the storage address of the index work to be created as index items.
In this step, the global ID of the index work to be created may be used as an attribute value, and the storage address of the index work to be created may be used as a recorded address to form an index entry, and create an inverted index.
According to the technical scheme provided by the embodiment of the disclosure, as the global ID in the inverted index can reflect the type ID of the type of the work and the keyword ID of the keyword, namely the inverted index can contain the storage address and the global ID of the works of different types, compared with the prior art that the inverted index of each service contains the storage address of a work of one type, the scheme provided by the disclosure can contain the storage addresses of the works of various types under the condition of providing one index service, and occupied server resources are reduced.
In an exemplary embodiment, after the step of obtaining the type ID of the work type of the index work to be created and the keyword ID of the work keyword, if the keyword ID of the work keyword is not obtained, the keyword ID of the work keyword of the index work to be created is generated. When the keyword ID is generated, IDs other than the keyword IDs corresponding to all keywords in the work type may be generated according to the work type of the work corresponding to the keyword, for example, in the work with background music, the background music is new song ABC, and the keyword ABC does not have a corresponding keyword ID, and in this case, if the keyword ID of the keyword in the work with background music is 1 to 1000000, 1000001 may be created for the keyword ID of the keyword for the keyword.
Similarly, when a new work type is uploaded, IDs except type IDs corresponding to all types in the existing work types can be created, so that the development workload is small, and the labor cost is saved.
Based on the same inventive concept, according to the method for searching works provided by the embodiments of the present disclosure, fig. 4-1 is a schematic block diagram of a structure of an apparatus for searching works according to an exemplary embodiment, which includes:
a first obtaining module 40 configured to perform obtaining a type ID of a work type of a work corresponding to a keyword of the query request and a keyword ID of the keyword;
the first assembling module 41 is configured to perform a splicing combination on the type ID and the keyword ID according to a splicing combination manner, so as to obtain a global ID of a work corresponding to the keyword of the query request;
a determining module 42 configured to determine, according to a pre-established inverted index, an index item including a global ID of a work corresponding to a keyword of the query request, where each index item of the inverted index includes a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated;
and the obtaining module 43 is configured to obtain the work corresponding to the keyword of the query request from the storage address included in the determined index entry.
In one embodiment, the number of works corresponding to the keywords of the acquired query request is multiple; as shown in fig. 4-2, the apparatus further comprises:
the sorting module 44 is configured to perform sorting on the works corresponding to the keywords of the obtained query requests according to the attribute characteristics of the works to obtain display sequence information of the works corresponding to the keywords of the obtained query requests;
and the sending module 45 is configured to execute sending the works corresponding to the keywords of the acquired query requests and the display sequence information to the client.
In one embodiment, the work attribute characteristics include one or more of a predicted click through rate of the work, a click through rate of the work as a ratio of a number of times the work is clicked through to play to a number of times the work is presented, and a relevance of the work to the keywords as a ratio of a number of times the work is clicked through to play.
In an embodiment, the first combining module 41 is specifically configured to perform splicing and combining the tail part of the type ID and the head part of the keyword ID to obtain a global ID of a work corresponding to the keyword of the query request including the type ID and the keyword ID; or splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the work corresponding to the keyword of the query request comprising the type ID and the keyword ID.
According to the index creating method of the above-mentioned works provided by the embodiment of the present disclosure, fig. 5-1 is a schematic block diagram of a structure of an index creating apparatus of a work shown according to an exemplary embodiment, including:
a second obtaining module 50 configured to perform obtaining a type ID of a work type of an index work to be created and a keyword ID of a work keyword;
the second combining module 51 is configured to perform a splicing combination on the type ID and the keyword ID according to a splicing combination manner, so as to obtain a global ID of the index work to be created;
and the first creating module 52 is configured to perform creating the inverted index by using the constructed global ID and the storage address of the index work to be created as index items.
In an embodiment, the second combining module 51 is specifically configured to perform splicing of the tail of the type ID and the head of the key ID, so as to obtain a global ID of the index work to be created, which includes the type ID and the key ID; or splicing and combining the tail part of the key word ID and the head part of the type ID to obtain the global ID of the index work to be created, which comprises the type ID and the key word ID.
In one embodiment, as shown in fig. 5-2, the apparatus further comprises:
the generation module 53 is configured to execute the step of obtaining the type ID of the work type of the index work to be created and the keyword ID of the work keyword, and then generate the keyword ID of the work keyword of the index work to be created if the keyword ID of the work keyword is not obtained.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 6 is a block diagram illustrating an apparatus 600 for finding a work according to an exemplary embodiment. For example, the apparatus 600 may be provided as a server. Referring to fig. 6, the apparatus 600 includes a processing component 622 that further includes one or more processors and memory resources, represented by memory 632, for storing instructions, such as applications, that are executable by the processing component 622. The application programs stored in memory 632 may include one or more modules that each correspond to a set of instructions. Further, the processing component 622 is configured to execute instructions to perform the find work method described above.
The apparatus 600 may also include a power component 626 configured to perform power management of the apparatus 600, a wired or wireless network interface 650 configured to connect the apparatus 600 to a network, and an input/output (I/O) interface 658. The apparatus 600 may operate based on an operating system, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc., stored in the memory 632.
In an exemplary embodiment, a storage medium including instructions is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform a method of finding a work as described above.
In an exemplary embodiment, a computer program product is also provided. Which when run on a computer causes the computer to perform the method steps of finding a work described above.
FIG. 7 is a block diagram illustrating an index creation apparatus 700 for a work in accordance with an exemplary embodiment. For example, the apparatus 700 may be provided as a server. Referring to fig. 7, apparatus 700 includes a processing component 722 that further includes one or more processors and memory resources, represented by memory 732, for storing instructions, such as applications, that are executable by processing component 722. The application programs stored in memory 732 may include one or more modules that each correspond to a set of instructions. Further, the processing component 722 is configured to execute instructions to perform the find work method described above.
The apparatus 700 may also include a power component 726 configured to perform power management of the apparatus 700, a wired or wireless network interface 750 configured to connect the apparatus 700 to a network, and an input output (I/O) interface 758. The device 700 may operate based on an operating system, such as Windows Server, Mac OSXTM, UnixTM, LinuxTM, FreeBSDTM, etc., stored in the memory 732.
In an exemplary embodiment, a storage medium including instructions is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform an index creation method for a work as described above.
In an exemplary embodiment, a computer program product is also provided. Which when run on a computer causes the computer to perform the index creation method steps for the work described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. A method of finding a work, comprising:
acquiring the type ID of the work type of the work corresponding to the keyword of the query request and the keyword ID of the keyword; the works corresponding to the keywords of the query request are the works which the user requests to read or watch, and the types of the works are divided according to the commonalities of the contents of the works;
according to a splicing combination mode, splicing combination is carried out on the type ID and the keyword ID to obtain a global ID of the work corresponding to the keyword of the query request, wherein the global ID is unique and represents the ID of the work in the index service;
according to a pre-established inverted index, determining an index item comprising a global ID of a work corresponding to a keyword of the query request, wherein each index item of the inverted index comprises a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated;
and acquiring the works corresponding to the keywords of the query request from the storage addresses included in the determined index items.
2. The method of finding works according to claim 1, wherein the number of the obtained works corresponding to the keyword of the query request is plural, the method further comprising:
sequencing the works corresponding to the keywords of the acquired query requests according to the attribute characteristics of the works to obtain the display sequence information of the works corresponding to the keywords of the acquired query requests;
and sending the works corresponding to the keywords of the acquired query requests and the display sequence information to a client.
3. The method of finding a work of claim 2, wherein the work attribute characteristics include one or more of a predicted click through rate of the work, a click through rate of the work as a ratio of a number of times the work is clicked for playback to the number of times the work is presented, and a relevance of the work to a keyword, the click through rate being a ratio of a number of times the work is clicked for playback to the number of times the work is clicked for playback.
4. The method for searching works according to claim 1, wherein the splicing and combining the type ID and the keyword ID according to a splicing and combining manner to obtain a global ID of the work corresponding to the keyword of the query request comprises:
splicing and combining the tail part of the type ID and the head part of the keyword ID to obtain the global ID of the work corresponding to the keyword of the query request comprising the type ID and the keyword ID; or
And splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the work corresponding to the keyword of the query request comprising the type ID and the keyword ID.
5. A method of index creation for a work, comprising:
acquiring the type ID of the work type of the index work to be created and the keyword ID of the keyword of the work;
if the keyword ID of the work keyword is not obtained, generating the keyword ID of the work keyword of the index work to be created; wherein generating the key ID of the work key of the index work to be created includes: generating IDs except the keyword IDs corresponding to all the work keywords in the work type according to the work type of the work corresponding to the work keywords;
splicing and combining the type ID and the keyword ID according to a splicing and combining mode to obtain a global ID of the index work to be created, wherein the global ID is unique and represents the ID of the work in the index service;
and creating an inverted index by taking the constructed global ID and the storage address of the index work to be created as index items.
6. The work index creation method of claim 5, wherein the obtaining the global ID of the work to be created index by splicing and combining the type ID and the keyword ID according to a splicing and combining manner comprises:
splicing and combining the tail part of the type ID and the head part of the key word ID to obtain a global ID of the index work to be created, wherein the global ID comprises the type ID and the key word ID; or
And splicing and combining the tail part of the key word ID and the head part of the type ID to obtain the global ID of the index work to be created, which comprises the type ID and the key word ID.
7. An apparatus for finding a work, comprising:
the first acquisition module is configured to execute acquisition of a type ID of a work type of a work corresponding to a keyword of a query request and a keyword ID of the keyword; the works corresponding to the keywords of the query request are the works which the user requests to read or watch, and the types of the works are divided according to the commonalities of the contents of the works;
the first combination module is configured to perform combination of the type ID and the keyword ID according to a combination manner to obtain a global ID of a work corresponding to the keyword of the query request, wherein the global ID is unique and represents an ID of the work in an index service;
the determining module is configured to execute determining, according to a pre-established inverted index, an index item including a global ID of a work corresponding to a keyword of the query request, where each index item of the inverted index includes a global ID and a storage address of the work corresponding to the global ID; the work corresponding to the global ID is the work corresponding to the type ID and the keyword ID used when the global ID is generated;
and the acquisition module is configured to acquire the works corresponding to the keywords of the query request from the storage addresses included in the determined index items.
8. The work lookup apparatus as claimed in claim 7, wherein the number of the obtained works corresponding to the keyword of the query request is plural, the apparatus further comprises:
the sequencing module is configured to sequence the works corresponding to the keywords of the acquired query requests according to the attribute characteristics of the works to obtain the display sequence information of the works corresponding to the keywords of the acquired query requests;
and the sending module is configured to execute sending the works corresponding to the keywords of the acquired query requests and the display sequence information to a client.
9. The work finding apparatus of claim 8, wherein the work attribute characteristics include one or more of a predicted click through rate of the work, a click through rate of the work, and a correlation of the work to keywords, the predicted click through rate being a ratio of a number of times the work is clicked through for playback to the number of times the work is presented, and the click through rate being a ratio of a number of times the work is clicked through for playback to the number of times the work is clicked through for playback.
10. The work searching apparatus according to claim 7, wherein the first combining module is specifically configured to perform a splicing combination of a tail portion of the type ID and a head portion of the keyword ID, so as to obtain a global ID of a work corresponding to a keyword of the query request that includes the type ID and the keyword ID; or splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the work corresponding to the keyword of the query request comprising the type ID and the keyword ID.
11. An index creation apparatus for a work, comprising:
a second obtaining module configured to perform obtaining a type ID of a work type of an index work to be created and a keyword ID of a work keyword;
the generation module is configured to execute the step of generating the keyword ID of the work keyword of the index work to be created if the keyword ID of the work keyword is not obtained; wherein generating the key ID of the work key of the index work to be created includes: generating IDs except the keyword IDs corresponding to all the work keywords in the work type according to the work type of the work corresponding to the work keywords;
the second combination module is configured to perform the splicing combination of the type ID and the keyword ID according to a splicing combination mode to obtain a global ID of the index work to be created, wherein the global ID is unique and represents the ID of the work in the index service;
and the first creation module is configured to create the inverted index by taking the constructed global ID and the storage address of the index work to be created as index items.
12. The work index creation apparatus according to claim 11, wherein the second combining module is specifically configured to perform concatenation of a tail of the type ID and a head of the key ID, to obtain a global ID of an index work to be created that includes the type ID and the key ID; or splicing and combining the tail part of the keyword ID and the head part of the type ID to obtain the global ID of the index work to be created, wherein the global ID comprises the type ID and the keyword ID.
13. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement a method of finding a work as claimed in any one of claims 1 to 4.
14. A storage medium having instructions which, when executed by a processor of an electronic device, enable the electronic device to perform a method of finding a work as claimed in any one of claims 1 to 4.
15. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement an index creation method for a work as claimed in any one of claims 5 to 6.
16. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform an index creation method of a work as claimed in any one of claims 5 to 6.
CN201910864234.3A 2019-09-12 2019-09-12 Method and device for searching works, electronic equipment and storage medium Active CN110598009B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910864234.3A CN110598009B (en) 2019-09-12 2019-09-12 Method and device for searching works, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910864234.3A CN110598009B (en) 2019-09-12 2019-09-12 Method and device for searching works, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110598009A CN110598009A (en) 2019-12-20
CN110598009B true CN110598009B (en) 2022-04-22

Family

ID=68859499

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910864234.3A Active CN110598009B (en) 2019-09-12 2019-09-12 Method and device for searching works, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110598009B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113297339B (en) * 2021-07-27 2022-02-11 阿里云计算有限公司 Method, apparatus, storage medium and product for storing data

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063476A (en) * 2010-12-13 2011-05-18 百度时代网络技术(北京)有限公司 Video searching method and system
CN102929955A (en) * 2012-09-29 2013-02-13 上海景格汽车科技有限公司 Method and system for playing multimedia resources in courses
CN102999498A (en) * 2011-09-08 2013-03-27 中兴通讯股份有限公司 Method and device for searching multi-media programs
CN104219575A (en) * 2013-05-29 2014-12-17 酷盛(天津)科技有限公司 Related video recommending method and system
CN105279233A (en) * 2015-09-23 2016-01-27 浙江宇视科技有限公司 Resource retrieving method and device
US9292552B2 (en) * 2012-07-26 2016-03-22 Telefonaktiebolaget L M Ericsson (Publ) Apparatus, methods, and computer program products for adaptive multimedia content indexing
CN105868348A (en) * 2016-03-28 2016-08-17 乐视控股(北京)有限公司 Content obtaining method and device
US9633015B2 (en) * 2012-07-26 2017-04-25 Telefonaktiebolaget Lm Ericsson (Publ) Apparatus and methods for user generated content indexing
CN108038165A (en) * 2017-12-06 2018-05-15 东软集团股份有限公司 A kind of information search method, searcher, terminal device and server apparatus
CN108255972A (en) * 2017-12-27 2018-07-06 浪潮通用软件有限公司 A kind of text searching method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063476A (en) * 2010-12-13 2011-05-18 百度时代网络技术(北京)有限公司 Video searching method and system
CN102999498A (en) * 2011-09-08 2013-03-27 中兴通讯股份有限公司 Method and device for searching multi-media programs
US9292552B2 (en) * 2012-07-26 2016-03-22 Telefonaktiebolaget L M Ericsson (Publ) Apparatus, methods, and computer program products for adaptive multimedia content indexing
US9633015B2 (en) * 2012-07-26 2017-04-25 Telefonaktiebolaget Lm Ericsson (Publ) Apparatus and methods for user generated content indexing
CN102929955A (en) * 2012-09-29 2013-02-13 上海景格汽车科技有限公司 Method and system for playing multimedia resources in courses
CN104219575A (en) * 2013-05-29 2014-12-17 酷盛(天津)科技有限公司 Related video recommending method and system
CN105279233A (en) * 2015-09-23 2016-01-27 浙江宇视科技有限公司 Resource retrieving method and device
CN105868348A (en) * 2016-03-28 2016-08-17 乐视控股(北京)有限公司 Content obtaining method and device
CN108038165A (en) * 2017-12-06 2018-05-15 东软集团股份有限公司 A kind of information search method, searcher, terminal device and server apparatus
CN108255972A (en) * 2017-12-27 2018-07-06 浪潮通用软件有限公司 A kind of text searching method and system

Also Published As

Publication number Publication date
CN110598009A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
CN107256267B (en) Query method and device
CN107844586B (en) News recommendation method and device
US8370358B2 (en) Tagging content with metadata pre-filtered by context
US11748408B2 (en) Analyzing user searches of verbal media content
US9703779B2 (en) Method of and system for enhanced local-device content discovery
WO2017028624A1 (en) Method and device for processing resources
US9047298B2 (en) File searching on mobile devices
CN106156244B (en) Information search navigation method and device
US20090094189A1 (en) Methods, systems, and computer program products for managing tags added by users engaged in social tagging of content
RU2592393C2 (en) System and method for completing user's query and providing a response to a query
CN113079417B (en) Method, device and equipment for generating bullet screen and storage medium
CN109255037B (en) Method and apparatus for outputting information
CN104090899B (en) A kind of method and apparatus of feedback display content information
WO2017062170A1 (en) Media consumption context for personalized instant query suggest
CN106558311B (en) Voice content prompting method and device
KR20200049193A (en) Method for providing contents and service device supporting the same
US20140330774A1 (en) Information searching method and system
KR101682659B1 (en) Method for customized news alarm based on keyword and management server for news search for the same
CN110059172B (en) Method and device for recommending answers based on natural language understanding
CN110598009B (en) Method and device for searching works, electronic equipment and storage medium
US20240037134A1 (en) Method and apparatus for searching for clipping template
KR20090085946A (en) Symantic client, symantic information management server, method for generaing symantic information, method for searching symantic information and computer program recording medium for performing the methods
US9762687B2 (en) Continuity of content
US9576077B2 (en) Generating and displaying media content search results on a computing device
WO2017133171A1 (en) Information pushing method and device

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