CN111488521A - Data processing method and device - Google Patents

Data processing method and device Download PDF

Info

Publication number
CN111488521A
CN111488521A CN202010265280.4A CN202010265280A CN111488521A CN 111488521 A CN111488521 A CN 111488521A CN 202010265280 A CN202010265280 A CN 202010265280A CN 111488521 A CN111488521 A CN 111488521A
Authority
CN
China
Prior art keywords
target object
queue
user
cache queue
target objects
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.)
Pending
Application number
CN202010265280.4A
Other languages
Chinese (zh)
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202010265280.4A priority Critical patent/CN111488521A/en
Publication of CN111488521A publication Critical patent/CN111488521A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the specification provides a data processing method and a data processing device, wherein the data processing method comprises the steps of receiving an access request of a user; calling a third-party interface for providing target object recommendation based on the access request; determining a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful; the first target objects cached in the cache queue are arranged in a reverse order, and a preset number of first target objects are obtained and displayed to the user; according to the data processing method, under the condition that the interface providing the target object recommendation algorithm is determined to be abnormal, the first target objects in the cache queue are subjected to descending order, a preset number of first target objects are obtained and displayed to the user, and therefore the first target objects displayed to the user are all latest and latest data, data effectiveness is guaranteed, and a good data display mechanism is embodied.

Description

Data processing method and device
Technical Field
The embodiment of the specification relates to the technical field of computers, in particular to a data processing method. One or more embodiments of the present specification also relate to a data processing apparatus, a computing device, and a computer-readable storage medium.
Background
In order to improve the use experience of an access user, the current internet generally realizes page display in a mode of recommendation by an access algorithm, and recommends new content to the user on a page according to the characteristics of the user through the pull-down refreshing operation of the user, but when the algorithm is abnormal, the recommendation of the new content cannot be realized, the experience effect of the user is greatly reduced, and the attention of the user is reduced.
Therefore, it is urgently needed to provide a data processing method with a disaster recovery mechanism to realize normal browsing without affecting users.
Disclosure of Invention
In view of this, the present specification provides a data processing method. One or more embodiments of the present specification also relate to a data processing apparatus, a computing device, and a computer-readable storage medium to address technical deficiencies in the prior art.
According to a first aspect of embodiments herein, there is provided a data processing method including:
receiving an access request of a user;
calling a third-party interface for providing target object recommendation based on the access request;
determining a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful;
and performing reverse order arrangement on the first target objects cached in the cache queue, and acquiring a preset number of first target objects to display to the user.
According to a second aspect of embodiments herein, there is provided a data processing apparatus comprising:
a request receiving module configured to receive an access request of a user;
the interface calling module is configured to call a third-party interface for providing target object recommendation based on the access request;
the object acquisition module is configured to determine a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful;
and the display module is configured to perform reverse order arrangement on the first target objects cached in the cache queue, and acquire a preset number of first target objects to display to the user.
According to a third aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
receiving an access request of a user;
calling a third-party interface for providing target object recommendation based on the access request;
determining a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful;
and performing reverse order arrangement on the first target objects cached in the cache queue, and acquiring a preset number of first target objects to display to the user.
According to a fourth aspect of embodiments herein, there is provided a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of any one of the data processing methods.
One embodiment of the present specification implements a data processing method and apparatus, where the data processing method includes receiving an access request of a user; calling a third-party interface for providing target object recommendation based on the access request; determining a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful; the first target objects cached in the cache queue are arranged in a reverse order, and a preset number of first target objects are obtained and displayed to the user; according to the data processing method, under the condition that the interface providing the target object recommendation algorithm is determined to be abnormal, the first target objects in the cache queue are subjected to descending order, a preset number of first target objects are obtained and displayed to the user, and therefore the first target objects displayed to the user are all latest and latest data, data effectiveness is guaranteed, and a good data display mechanism is embodied.
Drawings
FIG. 1 is a flow chart of a data processing method provided by an embodiment of the present description;
fig. 2 is a schematic diagram of a buffer queue in a data processing method according to an embodiment of the present disclosure;
FIG. 3 is a flowchart of a data processing method applied to a specific shopping APP provided in one embodiment of the present specification;
fig. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present specification;
fig. 5 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, as those skilled in the art will be able to make and use the present disclosure without departing from the spirit and scope of the present disclosure.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
First, the noun terms to which one or more embodiments of the present specification relate are explained.
Caching disaster tolerance: the cache is used for backing up system data, and the data can be taken out through the cache after a disaster happens, so that the aim of disaster recovery is fulfilled.
Data preservation: if the data in the cache is updated too slowly, the difference between the data and the actual data is large, and the purpose of disaster tolerance cannot be met, so that the data needs to be preserved, and the real-time availability of the data is ensured.
APP: the mobile phone software mainly refers to software installed on a smart phone, and can also be called as a mobile phone application program.
In the present specification, a data processing method is provided, and the present specification relates to a data processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
Fig. 1 shows a flowchart of a data processing method provided according to an embodiment of the present specification, including steps 102 to 108.
Step 102: an access request of a user is received.
The access request can be an access request for a user to access any page, for example, a web page of a website browsed by the user, a shopping application program of a mobile phone, an entertainment application program and the like all generate an access request; in practical applications, each time a user opens a certain web page or page, an access request to the web page or page is generated.
For convenience of understanding, in the embodiment of the present specification, the data processing method is applied to a shopping APP of a mobile phone for detailed description, but in practical application, the data processing method may be applied to any field where cache disaster recovery needs to be implemented, for example, the data processing method may also be applied to a webpage of any website, and is not limited herein.
When the data processing method is applied to a mobile phone shopping APP, an access request of a user is received, namely a request for accessing a shopping page of the mobile phone shopping APP is generated when the user clicks the shopping page, or an access request for accessing commodities under a navigation bar is generated when the user clicks a certain navigation bar of the shopping page, or an access request is generated for the shopping page by the user through a pull-down refreshing operation on a certain shopping page.
Step 104: and calling a third-party interface for providing target object recommendation based on the access request.
The target objects are different according to different application scenes of the data processing method; in the case that the data processing method is applied to a shopping scene, the target object may be any commodity, in the case that the data processing method is applied to a video viewing scene, the target object may be any video, in addition, the data processing method may also be applied to various scenes in which video cover page recommendation and mobile phone application program recommendation can be implemented, and at this time, the target object may also include a video picture or a mobile phone application program and the like.
Specifically, the target object includes, but is not limited to, a commodity, a picture or a video.
The third-party interface for providing the target object recommendation can be understood as any interface of a third-party algorithm or a machine learning model which can realize the target object recommendation; in practical application, after receiving an access request of a user, an algorithm or a machine learning model of the third-party interface may be called to realize recommendation of a target object, and the target object which is considered by the algorithm or the machine learning model to be most interesting and favorite by the user is recommended to the user, so as to increase the access experience of the user.
Taking the target object as a commodity as an example, after the mobile phone shopping APP receives an access request of a user, firstly calling a commodity which is most interested by the user in the shopping APP and calculated by an algorithm of a third-party interface or a machine learning model, and then recommending and displaying the calculated commodity to the user.
Step 106: and under the condition that the target object recommendation for the user is unsuccessful according to the interface, determining a first target object cached in a cache queue.
Specifically, after a third-party interface providing target object recommendation is called based on the access request, two situations may occur, one being that a target object may be successfully recommended to the user according to the interface, and the other being that the target object may not be successfully recommended to the user due to an abnormal occurrence of the interface due to an excessive number of access requests received at the same time.
And under the condition that the target object recommendation for the user according to the interface is unsuccessful, in order to not influence the normal page browsing of the user, the first target object recommended and cached in the cache queue through the third-party interface in advance can be obtained, and the first target object is displayed to the user subsequently, so that the effect of cache disaster tolerance is achieved.
Step 108: and performing reverse order arrangement on the first target objects cached in the cache queue, and acquiring a preset number of first target objects to display to the user.
Specifically, since the cache data (i.e., the first target objects) in the cache queue are all first-in first-out, but the first target object at the tail of the cache queue enters the cache queue at the latest, the first target object at the tail of the cache queue is the latest data, and in order to ensure that the first target object displayed to the user is the latest data, before displaying to the user, the read first target objects in the cache queue are arranged in a reverse order according to the time of entering the cache queue, and then a preset number of first target objects are displayed to the user.
In addition, taking the mobile phone shopping APP as an example, the number of commodities that can be displayed on each shopping page is limited, so that a corresponding number of commodities can be displayed for the user according to the number of commodities that can be displayed.
Therefore, the preset number is set according to the actual application scenario of the data processing method, and is not limited herein, for example, 20 or 30 are set.
For example, the data processing method is applied to the application program a, eighty percent of users browse two or so pages according to past user data of the application program, the number of commodities displayed on each page is 9, the number of commodities displayed on two pages is 18, the preset number can be 18, and the application program a acquires 18 commodities (i.e., the first target object) and updates the commodities on the first two pages, so as to display the commodities to the users.
In specific implementation, the length of the cache queue may also be set according to the actual application scenario of the data processing method, so as to save cache space and avoid unnecessary waste, and taking the above as an example, if the number of the first target objects displayed to the user is 18, the length of the cache queue is 50, that is, the requirement for updating the first two pages of merchandise of the application program a may be met, and it is ensured that the latest and sufficient number of first target objects displayed to the user are enough.
In the embodiment of the specification, the data processing method obtains a preset number of first target objects to be displayed to a user after determining that an interface providing a target object recommendation algorithm is abnormal and performing descending order on the first target objects in a cache queue, so that the first target objects displayed to the user are all latest and latest data, data validity is guaranteed, and a good data display mechanism is embodied.
In another embodiment of this specification, after the invoking an interface for providing a target object recommendation algorithm based on the access request, the method further includes:
and under the condition that the target object is successfully recommended to the user according to the interface, determining a second target object recommended to the user by the interface and the recommendation score of the second target object.
Specifically, if the target object can be successfully recommended to the user according to the interface, then a suitable second target object and the user's preference degree for each second target object, that is, the recommendation score of each second target object, can be automatically recommended to the user through the interface.
And after determining the second target object recommended by the interface for the user and the recommendation score of the second target object, further comprising:
determining whether the user has permission to update the cache queue,
if yes, updating the cache queue based on the second target object,
if not, the second target objects are sorted in a descending order based on the recommendation scores of the second target objects, a preset number of second target objects are read and displayed to the user,
and after the second target object is updated to the cache queue, the first target object cached in the cache queue.
Specifically, after determining that the interface is the second target object recommended by the user and the recommendation score of the second target object, it is first determined whether the user has the right to update the cache queue, if so, the cache queue may be updated based on the second target object recommended by the interface, and if not, the second target object meeting the condition needs to be displayed to the user.
In practical application, judging whether the user has the authority to update the cache queue, if so, checking whether the user has a cache white list or a random proportion P, and only if the user in the cache white list or the random proportion P is a qualified user, the authority to update the cache queue exists; the cache white list is a preset cache white list, the cache white list can be set according to actual experience, users in the random proportion P are obtained according to calculation, for example, one percent of users configured in the application program a have an updating right, and the one percent of users can be selected according to the last two bits of the user ID, for example, the user whose two bits are '00' after the user ID is selected, so that the selected part of users have a right to update the cache queue.
In specific implementation, the updating the cache queue based on the second target object specifically includes the following several cases.
Firstly, the cache queue is empty, and at this time, the second target object is filled in the cache queue to update the cache queue.
Specifically, if the number of the second target objects is greater than the queue length of the cache queue, the cache queue may be filled with the recommendation score earlier according to the recommendation score of the second target object.
Secondly, the buffer queue is not empty, and two situations are included when the buffer queue is not empty, wherein one situation is that: an available queue exists in the buffer queue, and the other condition is as follows: the buffer queue is full and no queue is available, for both cases, as will be explained in more detail below.
With reference to the above introduction, in practical applications, a specific implementation manner of updating the cache queue based on the second target object is as follows:
the updating the cache queue based on the second target object comprises:
determining whether the buffer queue is empty,
if yes, caching the second target object to the cache queue,
if not, updating the cache queue based on the second target object under the condition that the time interval between the last updating time and the current time of the cache queue exceeds a preset time threshold.
Specifically, when the cache queue is empty, the second target object is cached to the cache queue, and specifically, caching the second target object to the cache queue is implemented in the following manner:
determining the number of the second target objects and the queue length of the buffer queue;
and under the condition that the number of the second target objects is larger than the queue length of the cache queue, after the second target objects are arranged in a descending order based on the recommendation scores of the second target objects, obtaining the number of second target objects which is equal to the queue length of the cache queue to be cached in the cache queue.
By caching the second target object into the cache queue and caching the second target object with higher recommendation score into the cache queue, the target objects cached in the cache queue can be guaranteed to be all target objects more suitable for the user, and the click rate and attention of the user to the target objects are improved when the target objects in the cache queue are recommended and displayed to the user in the following process. For example, the target object is a commodity, the commodity with the high recommendation score is preferentially cached in the cache queue, and when the subsequent recommendation display is performed on the user based on the commodity in the cache queue, the commodity with the high recommendation score in the cache queue is recommended and displayed to the user, so that the purchase rate of the user and the time for browsing the shopping page can be greatly improved, and the user quantity can be correspondingly increased under the condition that a certain user is satisfied with the commodity recommended by the shopping application program.
For example, referring to fig. 2, fig. 2 is a schematic diagram of a buffer queue in a data processing method provided in an embodiment of the present disclosure.
Referring to FIG. 2, a is included in the buffer queue1To anIn practical application, a second target object enters the cache queue from the queue tail to update or increase the cache queue; in the embodiment of the present specification, in order to facilitate understanding, the target object is divided into a first target object and a second target object, and in a specific application, the first target object is the second target object cached or updated in the cache queue, so as to ensure that the first target object in the cache queue is an accurate target object recommended by the algorithm and better in accordance with the interests and hobbies of the user.
After obtaining the second target objects with the same number as the queue length of the buffer queue to buffer the buffer queue, the method further includes:
and performing descending order arrangement on the second target objects based on the recommendation scores of the second target objects, and reading a preset number of second target objects to display to the user.
In practical application, the cache queue of the second target object recommended by the interface is updated, and the second target object recommended by the interface is recommended and displayed to a user according to a certain rule.
Specifically, the second target objects are arranged in a descending order according to the recommendation scores of the second target objects, and then a preset number of second target objects are obtained from top to bottom and displayed to the user, that is, the preset number of second target objects before scoring is displayed to the user, so that the experience effect of the user is improved.
When the cache queue is not empty and the time interval between the last update time and the current time of the cache queue exceeds the preset time threshold, updating the cache queue based on the second target object, and when the time interval between the last update time and the current time of the cache queue exceeds the preset time threshold, updating the cache queue based on the second target object is implemented as follows:
determining whether there is an available queue in the buffer queue,
if yes, caching the second target object to the available queue,
if not, under the condition that the time interval between the last updating time and the current time of the cache queue exceeds a preset time threshold, updating the cache queue based on the second target object.
The preset time threshold is set according to practical applications, and is not limited herein, for example, set to 2 minutes or 3 minutes.
Specifically, under the condition that the buffer queue is not empty, whether an available queue exists in the buffer queue is judged, if yes, the second target object is buffered into the available queue, and in practical application, the second target object enters the buffer queue from the tail of the buffer queue to fill the available queue in the buffer queue; if the available queue does not exist in the cache queue, whether the time interval between the last updating time of the cache queue and the current time exceeds a preset time threshold value needs to be judged, if so, the cache queue is updated based on a second target object, namely, the original target object in the cache queue is taken out from the head of the cache queue, then the second target object meeting the requirement is cached to the cache queue from the tail of the cache queue, the first target object cached in the cache queue is formed, and the cache queue is updated.
Wherein the caching the second target object to the available queue comprises:
determining the number of the second target objects and the length of the available queue;
and under the condition that the number of the second target objects is larger than the length of the available queue, after the second target objects are sorted in a descending order based on the recommendation scores of the second target objects, obtaining the number of the second target objects which is equal to the length of the available queue and caching the second target objects in the available queue.
The second target objects with the number equal to that of the available queues are obtained through the method, then the second target objects enter the buffer queues from the tail of the buffer queues, and the available queues in the buffer queues are filled.
With the above embodiment, in practical application, when the interface does not recommend a target object successfully, the first target object with the latest cache in the cache queue is displayed to the user according to the above manner, so that the validity of the target object is ensured, the target object difference calculated by the algorithm or the machine learning model of the interface is small, and the target object is cached in the cache queue as the bottom-defining data, so that the first target object in the cache queue is ensured to be the target object which is recommended by the algorithm or the machine learning model and is accurate and better in line with the user requirement.
In addition, the updating time of the cache queue is set for the cache data (namely the target object) in the cache queue, so that the validity of the bottom data and the consistency with the data recommended through the interface are ensured, the updating frequency of the cache queue is reduced, and the workload is reduced on the basis of ensuring the latest target object displayed to the user.
In another embodiment of this specification, when there is no available queue in the cache queue and the time interval between the last update time of the cache queue and the current time of the cache queue does not exceed the preset time threshold, it may be stated that the cache queue is not updated, and the second target object is directly displayed to the user, where a specific implementation manner is as follows:
and under the condition that the time interval between the last updating time and the current time of the cache queue does not exceed a preset time threshold, performing descending order arrangement on the second target objects based on the recommendation scores of the second target objects, and reading a preset number of second target objects to display to the user.
In the embodiment of the present specification, a time interval is set for updating the cache queue, and when the time interval between the last update time of the cache queue and the current time does not exceed the preset time threshold, the cache queue is not updated, and only the second target object is processed in the above manner and then displayed to the user, so that the cache update frequency is reduced, and the work efficiency is improved.
The data processing method provided by the embodiment of the specification has a good updating mechanism, and the number of users with the cache queue updating authority and the updating time of the cache queue can be configured according to a specific application scene, so that the updating frequency of the cache queue is reduced on the basis of ensuring the cache timeliness, the system operation times are reduced, and the system operation speed is increased; the method has a good data display mechanism, and the latest target object is preferentially displayed to the user when the cache disaster is recovered, so that the data validity is ensured; in addition, the difference between the target object which is acquired from the cache queue and displayed to the user and the target object recommended by the algorithm is small, which is equivalent to that the bibliographic data is written in the cache queue, and the data processing method writes the target object recommended by the algorithm into the cache, so that the target objects in the cache queue are all the target objects recommended by the algorithm, and the accuracy is high; and finally, the length of the cache queue can be set according to a specific application scene, so that the cache space is saved, and unnecessary waste is avoided.
Referring to fig. 3, fig. 3 shows a processing flow chart of a data processing method applied to a specific shopping APP according to an embodiment of the present specification, including steps 302 to 328.
Step 302: and receiving an access request of a user a for browsing the commodities under a certain navigation of the shopping APP.
Step 304: and calling an algorithm interface for providing commodity recommendation based on the access request.
Step 306: and judging whether the algorithm interface successfully recommends the commodity for the user a, if so, executing step 308, and if not, executing step 320.
Step 308: and judging whether the user a has the authority of updating the commodity cache queue, if so, executing the step 310, and if not, executing the step 312.
Specifically, it is determined whether the user a has the authority to update the commodity cache queue, that is, it is verified whether the current user a is in the update cache white list or the random proportion P, and only the user meeting any one of the above conditions can update the commodity cache queue.
Step 310: and judging whether the commodity cache queue corresponding to the navigation bar is empty, if so, executing step 314, and if not, executing step 316.
Step 312: and assembling the commodities recommended to the user a through the algorithm according to a preset requirement, returning the commodities and displaying the commodities to the user a.
Specifically, the preset requirements include, but are not limited to, a preset number of commodities obtained after the commodities are sorted according to the recommendation scores of the commodities calculated by the algorithm.
Step 314: and caching the commodities recommended to the user a by the algorithm to the commodity caching queue.
Step 316: it is determined whether the goods cache queue is not full, if yes, step 314 is performed, and if not, step 318 is performed.
Specifically, when the commodity cache queue is empty or the commodity cache queue is not yet filled, the commodities recommended to the user a by the algorithm need to be cached in the commodity cache queue, the commodity cache queue may be understood as being filled by the commodity cache queue, and the commodity cache queue may be understood as being replenished by the commodity cache queue.
Step 318: and judging whether the time interval between the last updating time and the current time of the commodity cache queue exceeds N minutes, if so, executing the step 314, and if not, executing the step 312.
The N minute may be 2 minutes, 3 minutes, or the like.
Specifically, under the condition that the commodity cache queue meets the update time, the commodity recommended to the user a by the algorithm is cached in the commodity cache queue to update the commodity cache queue, and the specific update mode is referred to the above embodiment and is not described herein again.
Step 320: and acquiring the commodities in the commodity cache queue.
Step 322: it is determined whether the acquisition of the goods in the goods cache queue is successful, if yes, step 324 is executed, and if not, step 326 is executed.
Step 324: and sequencing the obtained commodities in the commodity cache queue in a reverse order, and preferentially taking 10 commodities at the tail of the queue for packaging.
Step 326: other processing is performed.
Specifically, under the condition that cache data do not exist in the commodity cache queue, commodity display can be acquired from additionally preset bottom-pocket data and given to the user a, and therefore poor user experience caused by abnormal commodity display is avoided.
Step 328: and displaying the packaged 10 commodities to the user a.
The data in fig. 3 represents the product, and the cache data represents the product in the product cache queue.
As shown in fig. 3, in practical applications, when the data processing method is implemented, a cache white list or a random proportion P and an update time N of a commodity cache queue need to be configured according to a specific application scenario, after the data processing method is applied to a shopping APP, a project member will access an application scenario related to the shopping APP first, so as to ensure that bottom data (i.e. commodities) already exist in the commodity cache queue, and the set random proportion P, when the data processing method is applied subsequently, only a user in the random proportion P has an authority to update the commodity cache queue, for example, a certain application has an access amount of one hundred million per day, and the set P is one ten thousand, only 1 ten thousand people have the authority to update the commodity cache queue, so as to reduce an update frequency of the commodity cache queue; in addition, the update time N of the commodity cache queue supports dynamic configuration, and can be set according to actual application scenarios, for example, the commodities are updated frequently, and the update time can be set to 2 minutes, so that the effectiveness of the commodities in the commodity cache queue is ensured.
And the updating mechanism in the commodity cache queue is first-in first-out, when the commodity cache queue is updated every time, if the queue is full, the data at the head of the queue is dequeued first, and then the latest data is enqueued, and the length of the commodity cache queue can be determined by self according to the practical application scene, and the determined standard is as follows: the data volume of the bottom-pocketed data (namely, the commodities) meets the requirements of the actual application scene.
When the cache data is read in a disaster tolerance mode (namely, when recommended commodities cannot be obtained through an algorithm interface), queue data taken out of the commodity cache queue is sorted in a reverse order, namely, data at the tail of the queue is recommended to a user, so that the first-out data at the bottom of the queue is the latest data, and the data at the bottom of the queue is the commodities.
The general solution for refreshing the cache disaster recovery data provided by the data processing method in the embodiments of the present specification can not only set the update time of the cache queue according to the service characteristics of a specific application scenario, thereby ensuring the validity of the bottom data and the consistency with the algorithm recommendation data, reducing the cache update frequency, but also take out the data in a descending order according to the cache queue, thereby ensuring that the data displayed first is the latest and latest data, and ensuring the accuracy of the displayed goods.
Corresponding to the above method embodiment, this specification further provides an embodiment of a data processing apparatus, and fig. 4 shows a schematic structural diagram of a data processing apparatus provided in an embodiment of this specification. As shown in fig. 4, the apparatus includes:
a request receiving module 402 configured to receive an access request of a user;
an interface calling module 404 configured to call a third party interface providing a target object recommendation based on the access request;
an object obtaining module 406, configured to determine a first target object cached in a cache queue in a case that recommending a target object for the user according to the interface is unsuccessful;
the display module 408 is configured to perform reverse order arrangement on the first target objects cached in the cache queue, and obtain a preset number of first target objects to display to the user.
Optionally, the apparatus further includes:
and the target object recommending module is configured to determine a second target object recommended by the interface for the user and a recommendation score of the second target object under the condition that the target object is successfully recommended for the user according to the interface.
Optionally, the apparatus further includes:
an authority judgment module configured to judge whether the user has an authority to update the cache queue, if yes, update the cache queue based on the second target object,
if not, the second target objects are sorted in a descending order based on the recommendation scores of the second target objects, a preset number of second target objects are read and displayed to the user,
and after the second target object is updated to the cache queue, the first target object cached in the cache queue.
Optionally, the permission determining module is further configured to:
determining whether the buffer queue is empty,
if yes, caching the second target object to the cache queue,
if not, updating the cache queue based on the second target object under the condition that the time interval between the last updating time and the current time of the cache queue exceeds a preset time threshold.
Optionally, the permission determining module is further configured to:
determining whether there is an available queue in the buffer queue,
if yes, caching the second target object to the available queue,
if not, under the condition that the time interval between the last updating time and the current time of the cache queue exceeds a preset time threshold, updating the cache queue based on the second target object.
Optionally, the apparatus further includes:
and the time judging module is configured to perform descending order arrangement on the second target objects based on the recommendation scores of the second target objects and read a preset number of second target objects to display to the user when the time interval between the last updating time and the current time of the cache queue does not exceed a preset time threshold.
Optionally, the permission determining module is further configured to:
determining the number of the second target objects and the queue length of the buffer queue;
and under the condition that the number of the second target objects is larger than the queue length of the cache queue, after the second target objects are arranged in a descending order based on the recommendation scores of the second target objects, obtaining the number of second target objects which is equal to the queue length of the cache queue to be cached in the cache queue.
Optionally, the apparatus further includes:
and the object display module is configured to sort the second target objects in a descending order based on the recommendation scores of the second target objects, and read a preset number of second target objects to display to the user.
Optionally, the permission determining module is further configured to:
determining the number of the second target objects and the length of the available queue;
and under the condition that the number of the second target objects is larger than the length of the available queue, after the second target objects are sorted in a descending order based on the recommendation scores of the second target objects, obtaining the number of the second target objects which is equal to the length of the available queue and caching the second target objects in the available queue.
Optionally, the target object includes a commodity, a picture or a video.
The above is a schematic configuration of a data processing apparatus of the present embodiment. It should be noted that the technical solution of the data processing apparatus and the technical solution of the data processing method belong to the same concept, and details that are not described in detail in the technical solution of the data processing apparatus can be referred to the description of the technical solution of the data processing method.
FIG. 5 illustrates a block diagram of a computing device 500 provided in accordance with one embodiment of the present description. The components of the computing device 500 include, but are not limited to, a memory 510 and a processor 520. Processor 520 is coupled to memory 510 via bus 530, and database 550 is used to store data.
The computing device 500 also includes AN access device 540, the access device 540 enabling the computing device 500 to communicate via one or more networks 560. examples of such networks include a Public Switched Telephone Network (PSTN), a local area network (L AN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet the access device 540 may include one or more of any type of network interface, e.g., a Network Interface Card (NIC), wired or wireless, such as AN IEEE802.11 wireless local area network (W L AN) wireless interface, a Global microwave Internet Access (Wi-MAX) interface, AN Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 500, as well as other components not shown in FIG. 5, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 5 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.
Wherein processor 520 is configured to execute the following computer-executable instructions:
receiving an access request of a user;
calling a third-party interface for providing target object recommendation based on the access request;
determining a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful;
and performing reverse order arrangement on the first target objects cached in the cache queue, and acquiring a preset number of first target objects to display to the user.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that the technical solution of the computing device and the technical solution of the data processing method belong to the same concept, and details that are not described in detail in the technical solution of the computing device can be referred to the description of the technical solution of the data processing method.
An embodiment of the present specification further provides a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the data processing method.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the data processing method, and details that are not described in detail in the technical solution of the storage medium can be referred to the description of the technical solution of the data processing method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in the form of source code, object code, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts, but those skilled in the art should understand that the present embodiment is not limited by the described acts, because some steps may be performed in other sequences or simultaneously according to the present embodiment. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred embodiments and that acts and modules referred to are not necessarily required for an embodiment of the specification.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the embodiments and the practical application, to thereby enable others skilled in the art to best understand and utilize the embodiments. The specification is limited only by the claims and their full scope and equivalents.

Claims (13)

1. A method of data processing, comprising:
receiving an access request of a user;
calling a third-party interface for providing target object recommendation based on the access request;
determining a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful;
and performing reverse order arrangement on the first target objects cached in the cache queue, and acquiring a preset number of first target objects to display to the user.
2. The data processing method of claim 1, further comprising, after invoking a third party interface that provides target object recommendations based on the access request:
and under the condition that the target object is successfully recommended to the user according to the interface, determining a second target object recommended to the user by the interface and the recommendation score of the second target object.
3. The data processing method of claim 2, after determining the second target object recommended by the interface for the user and the recommendation score of the second target object, further comprising:
determining whether the user has permission to update the cache queue,
if yes, updating the cache queue based on the second target object,
if not, the second target objects are sorted in a descending order based on the recommendation scores of the second target objects, a preset number of second target objects are read and displayed to the user,
and after the second target object is updated to the cache queue, the first target object cached in the cache queue.
4. The data processing method of claim 3, the updating the cache queue based on the second target object comprising:
determining whether the buffer queue is empty,
if yes, caching the second target object to the cache queue,
if not, updating the cache queue based on the second target object under the condition that the time interval between the last updating time and the current time of the cache queue exceeds a preset time threshold.
5. The data processing method according to claim 4, wherein the updating the cache queue based on the second target object when the time interval between the last update time and the current time of the cache queue exceeds a preset time threshold comprises:
determining whether there is an available queue in the buffer queue,
if yes, caching the second target object to the available queue,
if not, under the condition that the time interval between the last updating time and the current time of the cache queue exceeds a preset time threshold, updating the cache queue based on the second target object.
6. The data processing method of claim 4, the method further comprising:
and under the condition that the time interval between the last updating time and the current time of the cache queue does not exceed a preset time threshold, performing descending order arrangement on the second target objects based on the recommendation scores of the second target objects, and reading a preset number of second target objects to display to the user.
7. The data processing method of claim 4, the caching the second target object to the cache queue comprising:
determining the number of the second target objects and the queue length of the buffer queue;
and under the condition that the number of the second target objects is larger than the queue length of the cache queue, after the second target objects are arranged in a descending order based on the recommendation scores of the second target objects, obtaining the number of second target objects which is equal to the queue length of the cache queue to be cached in the cache queue.
8. The data processing method according to claim 7, wherein after obtaining the number of second target objects equal to the queue length of the buffer queue and buffering the second target objects in the buffer queue, the method further comprises:
and performing descending order arrangement on the second target objects based on the recommendation scores of the second target objects, and reading a preset number of second target objects to display to the user.
9. The data processing method of claim 5, the caching the second target object to the available queue comprising:
determining the number of the second target objects and the length of the available queue;
and under the condition that the number of the second target objects is larger than the length of the available queue, after the second target objects are sorted in a descending order based on the recommendation scores of the second target objects, obtaining the number of the second target objects which is equal to the length of the available queue and caching the second target objects in the available queue.
10. The data processing method of claim 1, the target object comprising a commodity, a picture, or a video.
11. A data processing apparatus comprising:
a request receiving module configured to receive an access request of a user;
the interface calling module is configured to call a third-party interface for providing target object recommendation based on the access request;
the object acquisition module is configured to determine a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful;
and the display module is configured to perform reverse order arrangement on the first target objects cached in the cache queue, and acquire a preset number of first target objects to display to the user.
12. A computing device, comprising:
a memory and a processor;
the memory is to store computer-executable instructions, and the processor is to execute the computer-executable instructions to:
receiving an access request of a user;
calling a third-party interface for providing target object recommendation based on the access request;
determining a first target object cached in a cache queue under the condition that the target object recommendation for the user according to the interface is unsuccessful;
and performing reverse order arrangement on the first target objects cached in the cache queue, and acquiring a preset number of first target objects to display to the user.
13. A computer readable storage medium storing computer instructions which, when executed by a processor, carry out the steps of the data processing method of any one of claims 1 to 10.
CN202010265280.4A 2020-04-07 2020-04-07 Data processing method and device Pending CN111488521A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010265280.4A CN111488521A (en) 2020-04-07 2020-04-07 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010265280.4A CN111488521A (en) 2020-04-07 2020-04-07 Data processing method and device

Publications (1)

Publication Number Publication Date
CN111488521A true CN111488521A (en) 2020-08-04

Family

ID=71794659

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010265280.4A Pending CN111488521A (en) 2020-04-07 2020-04-07 Data processing method and device

Country Status (1)

Country Link
CN (1) CN111488521A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760978A (en) * 2020-10-27 2021-12-07 北京沃东天骏信息技术有限公司 A data disaster recovery method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416006A (en) * 2018-02-28 2018-08-17 百度在线网络技术(北京)有限公司 Information off-line recommends method, apparatus, client, server and storage medium
CN109150983A (en) * 2018-07-27 2019-01-04 腾讯科技(深圳)有限公司 The control method and device of control method and device, data recommendation that front end is shown
CN110334246A (en) * 2019-07-08 2019-10-15 北京字节跳动网络技术有限公司 A kind of data request processing method, apparatus, terminal device and storage medium
US20190364338A1 (en) * 2018-05-25 2019-11-28 Thinkanalytics Ltd. Content Recommendation System and Method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108416006A (en) * 2018-02-28 2018-08-17 百度在线网络技术(北京)有限公司 Information off-line recommends method, apparatus, client, server and storage medium
US20190364338A1 (en) * 2018-05-25 2019-11-28 Thinkanalytics Ltd. Content Recommendation System and Method
CN109150983A (en) * 2018-07-27 2019-01-04 腾讯科技(深圳)有限公司 The control method and device of control method and device, data recommendation that front end is shown
CN110334246A (en) * 2019-07-08 2019-10-15 北京字节跳动网络技术有限公司 A kind of data request processing method, apparatus, terminal device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760978A (en) * 2020-10-27 2021-12-07 北京沃东天骏信息技术有限公司 A data disaster recovery method and device

Similar Documents

Publication Publication Date Title
US11494666B2 (en) Systems and methods for online content recommendation
US9009103B2 (en) Fingerprint-based, intelligent, content pre-fetching
CN109740085B (en) Page content display method, device, equipment and storage medium
US20250131045A1 (en) Snippet information generation method and apparatus, search result display method and apparatus, device, and medium
CN109992715B (en) Information display method, device, medium and computing equipment
CN112769679A (en) Message display method and device
CN116955817A (en) Content recommendation method, device, electronic equipment and storage medium
CN108243219B (en) Information pushing method and device
CN111444356A (en) Search-based recommendation method and device
CN111695960A (en) Object recommendation system, method, electronic device and storage medium
US20190147540A1 (en) Method and apparatus for outputting information
CN112330382A (en) Item recommendation method and device, computing equipment and medium
CN110866040B (en) User portrait generation method, device and system
CN113205189A (en) Prediction model training method, prediction method and prediction device
CN110351581B (en) Data request processing method and device, terminal equipment and storage medium
US20250245420A1 (en) System and method for automatic modification of prompts and content items
CN111262744B (en) Multimedia information transmitting method, backup server and medium
CN116956204A (en) Network structure determining method, data predicting method and device of multi-task model
US20210103953A1 (en) Conversion score determination for trending and non-trending content
CN113515717B (en) Navigation page updating method and device, electronic equipment and storage medium
US9336319B2 (en) Data file and rule driven synchronous or asynchronous document generation
CN110909154A (en) Abstract generation method and device
CN111488521A (en) Data processing method and device
US20210012415A1 (en) Feedback based item selection and transmission
CN111444448B (en) Data processing method, server and system

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200804