Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
In order to solve the problem that the content searched by the existing search function module provided by each APP or site for a user is not comprehensive enough, the embodiment of the specification provides a content searching method based on a block chain. The execution subject of the method provided in the embodiments of the present disclosure may be, but is not limited to, a target search server and the like, and may be configured to execute at least one of the method apparatuses provided in the embodiments of the present disclosure.
For convenience of description, an embodiment of the method will be described below taking an execution body of the method as an example of a target search server capable of executing the method. It will be appreciated that the subject matter of the method is merely an exemplary illustration of a content crawling platform and should not be construed as limiting the method.
Specifically, an implementation flow diagram of a content searching method based on a blockchain provided in one or more embodiments of the present disclosure is shown in fig. 1, and includes:
step 110, receiving a search request of a user, wherein the search request carries a search keyword of the user;
optionally, after obtaining the search keyword of the user, in order to provide the content with a higher matching degree with the search keyword for the user so as to improve the accuracy of the search, and improve the content search experience of the user, before obtaining the content list matched with the search keyword of the user based on the search keyword of the user, the embodiment of the present disclosure further includes:
acquiring a content search record from a blockchain;
the association degree between the search keywords in the content search records and the corresponding content is greater than or equal to a preset threshold value, and the content search records are uploaded to the blockchain by other search servers.
It should be appreciated that in order to make the content search in the target search server more comprehensive and accurate, the target search server may obtain content search records from the blockchain that may be obtained by other search servers based on the user searching within their corresponding APP or site and uploaded to the blockchain by other search servers periodically. In order to update the content search record in the target search server in time, the target search server may acquire the content search record from the blockchain every preset time period. The content search record may include a plurality of search keywords and content matching the plurality of search keywords, and a degree of association between each search keyword and the corresponding content.
The association degree between each search keyword and the corresponding content can be calculated based on the behavior operation record of the user on the content corresponding to each search keyword. The behavioral operation record of the user on the content corresponding to each search keyword may include: clicking behavior, copying behavior, sharing behavior, browsing behavior and browsing duration of the content corresponding to each search keyword by the user. The association degree between each search keyword and the corresponding content is used for ranking the content corresponding to each search keyword, so that the content ranked in the first few positions, namely the content with higher association degree, is displayed to the user, and the search accuracy is improved.
Generally, the format of the content includes one or more of text, image, video and audio, which causes the capacity of different content to be different, the content containing text only tends to be smaller, and if the content includes image, video or audio, the capacity of such content is larger. In order to reduce the amount of storage space occupied by such content uploaded to the blockchain, in the embodiment of the present disclosure, the content in the content search record obtained by the target search server from the blockchain is typically a link corresponding to the content.
Step 120, based on the search keyword of the user, obtaining a content list matched with the search keyword of the user;
it should be understood that a content search library should be maintained in the target search server, where the content search library includes a plurality of search keywords and contents corresponding to the plurality of search keywords, and then, based on the search keywords of the user, a content list matching the search keywords of the user is obtained, and in particular, the content list matching the search keywords of the user may be obtained in the content search library in the target search server. In order to provide a user with a more complete search result, the content search library includes, in addition to the search keywords and corresponding content existing locally at the target search server, the search keywords and corresponding content uploaded by other search servers and downloaded from the blockchain by the target search server.
And 130, displaying at least one target content with the highest association degree with the search keywords of the user in the content list to the user, wherein part or all of the content in the content list is obtained from the blockchain.
The content in the content list may be ranked based on the relevance between the content in the content list and the search keyword of the user, for example, the content in the content list may be ranked in order from high to low, and the top-ranked content in the content list may be displayed to the user, for example, the top-ranked content in the content list may be displayed to the user.
Optionally, in order to provide a more accurate search result for the user, the embodiment of the specification may further obtain a behavior operation record of the user on the search result, and calculate the association degree between the search keyword and the corresponding content based on the behavior operation record by pre-configuring the specified intelligent contract in the blockchain, so that the next time the user inputs the same search keyword, the user may display the content with higher association degree, thereby improving the search experience of the user. Specifically, after at least one target content in the content list, which is ranked in front of the association degree of the search keyword of the user, is presented to the user, the method further comprises:
acquiring a behavior operation record of a user on at least one target content;
uploading a transaction carrying a content search record of a user to a blockchain to trigger a specified intelligent contract in the blockchain to determine the association degree of a search keyword of the user and at least one target content based on a behavior operation record;
the content search records of the user comprise search keywords of the user, links of at least one target content and behavior operation records of the user on a plurality of target contents.
Optionally, the behavior operation record of the user on the at least one target content includes at least one of the following:
a user's copying behavior of at least one target content;
a browsing duration of the user for at least one target content;
a sharing behavior of the user on the at least one target content;
clicking actions of the user on at least one target content.
It should be understood that, because the storage space in the blockchain is limited, in order to facilitate storage of the behavior operation records of the user, in this embodiment of the present disclosure, the identifiers corresponding to different operation behaviors may be preset, for example, the identifier of the copy behavior of the user on at least one target content may be set to be C, the identifier of the browsing duration of the user on at least one target content may be set to be r_time (the time may be a specific duration, the unit may be seconds), the identifier of the sharing behavior of the user on at least one target content may be S, and the identifier of the click behavior of the user on at least one target content may be set to be D.
To facilitate determining the association of a user's search keyword with at least one target content based on behavioral records, embodiments of the present disclosure may pre-configure a specified smart contract in the blockchain that triggers when a user's behavioral records are uploaded into the blockchain, or that triggers when multiple users ' behavioral records of the same search keyword for one content are uploaded into the blockchain. More specifically, the score corresponding to each operation behavior of the user and the corresponding weight may be preset in the specified smart contract, so that the specified smart contract calculates the degree of association between the search keyword and each corresponding content based on the score corresponding to each operation behavior in the behavior operation record of the user and the corresponding weight.
Alternatively, since the collaboration agreement may or may not be reached online between different search servers, embodiments of the present description may set download rights for content search records uploaded into the blockchain for such a case. Specifically, the content search record of the user carries a content sharing identifier list, and the content sharing identifier in the content sharing identifier list is used for indicating that the permission of downloading the content search record of the user is provided. That is, when the target search server downloads content search records uploaded by other search servers from the blockchain, only the content search records carrying the target search server identification can be downloaded.
Optionally, in the case that the download authority is set, the method provided by the embodiment of the present specification further includes:
acquiring a content search record carrying an identifier of a target search server from a blockchain;
the content search record carrying the identification of the target search server is uploaded to the blockchain for other search servers; the content search record carrying the identification of the target search server comprises at least one search keyword, links of the content corresponding to the at least one search keyword and the association degree between the at least one search keyword and the links of the corresponding content.
Optionally, in order to ensure that the association degree between each search keyword in the target search server and the corresponding content is kept at a high level, the embodiments of the present disclosure provide two ways to obtain the content search record carrying the identifier of the target search server from the blockchain: in the first mode, a timer is locally set at a target search server, so that the target search server acquires a content search record carrying an identifier of the target search server from a blockchain every preset time period; in a second way, trigger conditions are configured in the specified intelligent contracts in the blockchain such that the specified intelligent contracts in the blockchain are triggered when other search servers upload content search records to the blockchain that carry the identity of the target search server.
Specifically, obtaining a content search record carrying an identifier of a target search server from a blockchain includes:
acquiring a content search record carrying an identifier of a target search server from a blockchain every preset time period; or alternatively
And acquiring a content search record carrying the identification of the target search server from the blockchain through a specified intelligent contract in the blockchain.
Optionally, the embodiment of the specification may further calculate a relevance between the search keyword of the user and at least one target content through the target search server, and upload the relevance to the blockchain after calculation. After presenting the at least one target content in the content list that is top-ranked with respect to the search keyword to the user, the method further comprises:
acquiring a behavior operation record of a user on at least one target content;
determining the association degree of the search keywords of the user and at least one target content based on the behavior operation record;
uploading a transaction carrying the association degree of the search keyword of the user and at least one target content to the blockchain through a specified intelligent contract in the blockchain;
the content search records of the user comprise search keywords of the user, links of at least one target content and behavior operation records of the user on a plurality of target contents.
The following describes the content searching method based on the blockchain in detail according to the embodiment of the present disclosure with an actual scenario shown in fig. 2, where a server and a server are search servers, and a specific implementation process includes:
s21, the A server uploads a local content search record to the blockchain, wherein the content search record comprises a plurality of search keywords, content links corresponding to the search keywords and behavior operation records of users on the content links corresponding to the search keywords;
the behavior operation record of the user on the content links corresponding to the plurality of search keywords is used for triggering a specified intelligent contract in the blockchain to calculate the association degree between the plurality of search keywords and the corresponding content links.
S22, the B server downloads content search records uploaded by other servers from the blockchain every preset time period, wherein the content search records carry a plurality of search keywords and content links corresponding to the search keywords, and also carry the association degree between the search keywords and the corresponding content links;
s23, the user searches content in the APP or the browser corresponding to the B server, so that the APP or the browser corresponding to the B server sends a search request to the B server, wherein the search request comprises search keywords of the user;
s24, B service searches a content list matched with the search keywords of the user based on the local content search record and the content search record downloaded from the blockchain, and displays the content with higher association degree ranking with the search keywords of the user in the content list to the user through an APP or a browser;
s25, the APP or the browser acquires behavior operation records of the displayed content, such as records of clicking, sharing, copying, browsing duration and the like, and uploads user information, search keywords of the user, content corresponding to the search keywords of the user and behavior operation records of the content corresponding to the search keywords of the user into a blockchain;
s26, triggering specified intelligent contract calculation in the blockchain and updating the association degree between the search keywords of the user and the corresponding content based on the behavior operation records of the content corresponding to the search keywords of the user uploaded to the blockchain;
in order to improve the accuracy of the association degree, when the behavior operation records of the content corresponding to the keyword uploaded to the blockchain reach a preset number, namely, after the behavior operation records of the content corresponding to the same keyword by a preset number of users are uploaded to the blockchain, the association degree between the keyword and the corresponding content can be calculated and updated by triggering the appointed intelligent contract in the blockchain.
And S27, the A server downloads content search records uploaded by other servers from the blockchain, wherein the content search records comprise a plurality of keywords, contents corresponding to the keywords and association degrees between the keywords and the corresponding contents.
When a user searches for content at a target search server, the user search request can be received, the search request carries a search keyword of the user, a content list matched with the search keyword of the user can be obtained based on the search keyword of the user, and at least one target content with the highest association degree rank with the search keyword of the user in the content list is finally displayed to the user, wherein part or all of the content in the content list is obtained from a blockchain. Because the target search server can acquire the content provided by the blockchain from the blockchain, comprehensive content in the blockchain is synthesized, and at least one target content with the highest association degree with the search keywords of the user is provided for the user. This aspect makes the content acquired by the user based on the search keyword more comprehensive; on the other hand, the accuracy of content searching is improved.
Fig. 3 is a schematic structural diagram of a target search server 300 according to an embodiment of the present disclosure. Referring to fig. 3, in a software implementation, a target search server 300 may include a receiving unit 301, an obtaining unit 302, and a displaying unit 303, where:
a receiving unit 301, configured to receive a search request of a user, where the search request carries a search keyword of the user;
an acquisition unit 302 that acquires a content list matching the search keyword of the user based on the search keyword of the user;
and the display unit 303 is used for displaying at least one target content with the highest association degree ranking with the search keywords of the user in the content list to the user, wherein part or all of the content in the content list is obtained from a blockchain.
Optionally, in one embodiment, after the presenting unit 303 presents at least one target content in the content list, which is ranked top with respect to the search keyword of the user, to the user, the target server further includes:
a first obtaining unit 304, configured to obtain a behavioral operation record of the user on the at least one target content;
an uploading unit 305, configured to upload a transaction carrying a content search record of the user to a blockchain, so as to trigger a specified intelligent contract in the blockchain to determine a degree of association between a search keyword of the user and the at least one target content based on the behavior operation record;
wherein the content search record of the user comprises a search keyword of the user, a link of the at least one target content, and a behavior operation record of the user on the plurality of target contents.
Optionally, in an embodiment, the content search record of the user carries a content sharing identifier list, and a content sharing identifier in the content sharing identifier list is used for indicating that the authority for downloading the content search record of the user is provided.
Optionally, in an implementation manner, the target search server further includes:
a second obtaining unit 306, configured to obtain a content search record carrying an identifier of the target search server from the blockchain;
the content search record carrying the identification of the target search server is uploaded to the blockchain for other search servers; the content search record carrying the identification of the target search server comprises at least one search keyword, links of the content corresponding to the at least one search keyword and the association degree between the at least one search keyword and the links of the corresponding content.
Optionally, in an embodiment, the second obtaining unit 306 is configured to:
acquiring a content search record carrying the identifier of the target search server from the blockchain every preset time period; or alternatively
And acquiring a content search record carrying the identification of the target search server from the blockchain through a specified intelligent contract in the blockchain.
Optionally, in one embodiment, after the presenting unit 303 presents at least one target content in the content list, which is ranked top with respect to the association degree of the search keyword, to the user, the target search server further includes:
a third obtaining unit 307 that obtains a behavior operation record of the user on the at least one target content;
a determining unit 308 that determines a degree of association of the search keyword of the user with the at least one target content based on the behavior operation record;
uploading a transaction carrying the association of the search keyword of the user and the at least one target content into the blockchain through a specified intelligent contract in the blockchain;
wherein the content search record of the user comprises a search keyword of the user, a link of the at least one target content, and a behavior operation record of the user on the plurality of target contents.
Optionally, in one embodiment, before the obtaining unit 301 obtains a content list matched with the search keyword of the user based on the search keyword of the user, the target search server further includes:
a fourth acquisition unit 309 that acquires a content search record from the blockchain;
the association degree between the search keywords in the content search records and the corresponding content is greater than or equal to a preset threshold value, and the content search records are uploaded into the blockchain by other search servers.
Optionally, in one embodiment, the behavioral operation record of the at least one target content by the user includes at least one of:
a copying action of the user to the at least one target content;
a browsing duration of the user for the at least one target content;
the user's sharing behavior of the at least one target content;
and the clicking action of the user on the at least one target content.
The target search server 300 can implement the method of the method embodiments of fig. 1 to 2, and specifically, reference may be made to the content search method based on the blockchain in the embodiment shown in fig. 1 to 2, which is not described herein.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. Referring to fig. 4, at the hardware level, the electronic device includes a processor, and optionally an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory (non-volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, network interface, and memory may be interconnected by an internal bus, which may be an ISA (Industry Standard Architecture ) bus, a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or EISA (Extended Industry Standard Architecture ) bus, among others. The buses may be classified as address buses, data buses, control buses, etc. For ease of illustration, only one bi-directional arrow is shown in FIG. 4, but not only one bus or type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer-operating instructions. The memory may include memory and non-volatile storage and provide instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs to form the content searching device based on the block chain on the logic level. The processor is used for executing the programs stored in the memory and is specifically used for executing the following operations:
receiving a search request of a user, wherein the search request carries a search keyword of the user;
acquiring a content list matched with the search keywords of the user based on the search keywords of the user;
and displaying at least one target content with the highest association degree with the search keyword of the user in the content list to the user, wherein part or all of the content in the content list is obtained from a blockchain.
The blockchain-based content searching method disclosed in the embodiments shown in fig. 1-2 of the present specification can be applied to a processor or implemented by the processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or by instructions in the form of software. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in one or more embodiments of the present description may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with one or more embodiments of the present disclosure may be embodied directly in a hardware decoding processor or in a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
The electronic device may also execute the blockchain-based content searching method of fig. 1-2, and this description is not repeated here.
Of course, in addition to the software implementation, the electronic device in this specification does not exclude other implementations, such as a logic device or a combination of software and hardware, that is, the execution subject of the following process is not limited to each logic unit, but may also be hardware or a logic device.
The embodiments also provide a computer readable storage medium storing one or more programs, the one or more programs comprising instructions, which when executed by a portable electronic device comprising a plurality of application programs, enable the portable electronic device to perform the method of the embodiments shown in fig. 1-2, and in particular to perform the operations of:
receiving a search request of a user, wherein the search request carries a search keyword of the user;
acquiring a content list matched with the search keywords of the user based on the search keywords of the user;
and displaying at least one target content with the highest association degree with the search keyword of the user in the content list to the user, wherein part or all of the content in the content list is obtained from a blockchain.
In summary, the foregoing description is only a preferred embodiment of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of one or more embodiments of the present disclosure, is intended to be included within the scope of one or more embodiments of the present disclosure.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.