CN116132524A - Method and device for pushing resources, electronic equipment and storage medium - Google Patents

Method and device for pushing resources, electronic equipment and storage medium Download PDF

Info

Publication number
CN116132524A
CN116132524A CN202310028084.9A CN202310028084A CN116132524A CN 116132524 A CN116132524 A CN 116132524A CN 202310028084 A CN202310028084 A CN 202310028084A CN 116132524 A CN116132524 A CN 116132524A
Authority
CN
China
Prior art keywords
resource
identifier
resource identifier
list
address
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
CN202310028084.9A
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.)
Amusement Starcraft Beijing Technology Co ltd
Original Assignee
Amusement Starcraft Beijing 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 Amusement Starcraft Beijing Technology Co ltd filed Critical Amusement Starcraft Beijing Technology Co ltd
Priority to CN202310028084.9A priority Critical patent/CN116132524A/en
Publication of CN116132524A publication Critical patent/CN116132524A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure relates to a pushing method, a pushing device, an electronic device and a storage medium of resources, wherein the method comprises the following steps: responding to a resource acquisition request of a target user, determining a first resource identifier of a first resource pushed to the target user, and acquiring a download address according to the first resource identifier; under the condition that the first resource identifier fails to be determined in response to a resource acquisition request of a target user, acquiring a second resource identifier from a pre-generated resource identifier list, and acquiring a downloading address according to the second resource identifier; under the condition that the acquisition of the download address according to the third resource identifier fails, acquiring the download address corresponding to the third resource identifier from a pre-generated identifier-address list, wherein the third resource identifier is the first resource identifier or the second resource identifier; and downloading the resources according to the obtained download address, and pushing the downloaded resources to the target user. The method and the device can ensure the smooth progress of pushing the resources through the resource identification list and the identification-address list.

Description

Method and device for pushing resources, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of computers, and in particular relates to a method and a device for pushing resources, electronic equipment and a storage medium.
Background
When pushing resources to a user in a feed (pushing information of interest to the user) scenario, the resources may not be pushed to the user due to a failure. How to continue pushing resources to users by using limited conditions when faults occur so as to ensure user experience under the fault condition has important significance.
Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a method, an apparatus, an electronic device, and a storage medium for pushing resources. The technical scheme of the present disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided a method for pushing a resource, including:
responding to a resource acquisition request of a target user, determining a first resource identifier of a first resource pushed to the target user, and acquiring a download address according to the first resource identifier;
under the condition that the first resource identifier is determined to fail in response to the resource acquisition request of the target user, acquiring a second resource identifier from a pre-generated resource identifier list, and acquiring a downloading address according to the second resource identifier;
under the condition that the acquisition of the download address according to the third resource identifier fails, acquiring the download address corresponding to the third resource identifier from a pre-generated identifier-address list, wherein the third resource identifier is the first resource identifier or the second resource identifier;
And downloading the resources according to the obtained download address, and pushing the downloaded resources to the target user.
Optionally, the acquiring the second resource identifier from the pre-generated resource identifier list includes:
acquiring a cursor of the target user, wherein the cursor is used for indicating the position of the second resource identifier in the resource identifier list;
and acquiring the second resource identifier from a plurality of resource identifiers stored in the resource identifier list according to the cursor of the target user.
Optionally, before the second resource identifier is obtained from the pre-generated resource identifier list, the method further includes:
scanning a resource table according to a fixed period full quantity to acquire information of each resource;
according to the information of each resource, calculating the heat score of each resource;
and storing the resource identifiers of the plurality of resources with the highest heat scores into the resource identifier list.
Optionally, before the obtaining the download address corresponding to the third resource identifier from the pre-generated identifier-address list, the method further includes:
responding to a resource acquisition request of each user, and determining a resource identifier of each resource pushed to each user;
Acquiring the download address of each resource according to the resource identifier of each resource;
acquiring each resource according to the download address of each resource, and pushing each resource to each user;
and storing the resource identification and the download address of each resource into the identification-address list.
Optionally, the storing the resource identifier and the download address of each resource in the identifier-address list includes:
performing de-duplication treatment on the repeated resource identifiers acquired in the fixed duration;
and storing the resource identification of each resource after the deduplication processing and the download address of each resource into the identification-address list.
Optionally, the method further comprises:
acquiring the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list;
and determining the storage space size of the identification-address list according to the success rate.
Optionally, in the case that the storage space of the identifier-address list is full, storing the resource identifier and the download address of each resource in the identifier-address list includes:
Deleting a plurality of resource identifiers with the lowest queried probability in the identifier-address list and a plurality of corresponding download addresses;
and storing the resource identification and the download address of each resource into the identification-address list.
According to a second aspect of the embodiments of the present disclosure, there is provided a pushing device for a resource, including:
the first acquisition module is configured to respond to a resource acquisition request of a target user, determine a first resource identifier of a first resource pushed to the target user, and acquire a download address according to the first resource identifier;
the second acquisition module is configured to acquire a second resource identifier from a pre-generated resource identifier list and acquire a download address according to the second resource identifier under the condition that the first resource identifier fails in response to the resource acquisition request of the target user;
a third obtaining module, configured to obtain, in a case where obtaining a download address according to a third resource identifier fails, a download address corresponding to the third resource identifier from a pre-generated identifier-address list, where the third resource identifier is the first resource identifier or the second resource identifier;
And the resource pushing module is configured to download the resources according to the acquired download address and push the downloaded resources to the target user.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method for pushing resources according to the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of pushing resources as described in the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of pushing resources according to the first aspect.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
in the method, in the process of pushing the resources to the user, the resource identifier list is utilized to ensure that the second resource identifier can be obtained from the resource identifier list under the condition that the first resource identifier is failed to be obtained; the use of the identifier-address list ensures that in case of failure to obtain a download address from the resource identifier, the download address can also be obtained from the identifier-address list. Thus, smooth pushing of the resources to the target user can be guaranteed to the greatest extent. In addition, the smooth proceeding of pushing resources can be ensured only by generating a resource identification list and an identification-address list in advance, and the consumption cost is low.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow chart illustrating a method of pushing resources according to an example embodiment;
FIG. 2 is a flow diagram of generating a resource identification list in the present disclosure;
FIG. 3 is a flow chart of a method for pushing resources in the present disclosure;
FIG. 4 is a flow diagram of generating an identity-address list in the present disclosure;
FIG. 5 is a block diagram of a pushing device for a resource, shown in accordance with an exemplary embodiment;
FIG. 6 is a block diagram illustrating an apparatus for pushing of resources according to an example embodiment;
FIG. 7 is a block diagram illustrating an apparatus for pushing of resources, according to an example embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Fig. 1 is a flowchart illustrating a method for pushing resources according to an exemplary embodiment, and as shown in fig. 1, the method for pushing resources may be applied to a server, and includes the following steps:
in step S11, in response to a resource acquisition request of a target user, determining a first resource identifier of a first resource pushed to the target user, and acquiring a download address according to the first resource identifier;
in step S12, in response to the resource acquisition request of the target user, if it is determined that the first resource identifier fails, acquiring a second resource identifier from a pre-generated resource identifier list, and acquiring a download address according to the second resource identifier;
In step S13, under the condition that the acquisition of the download address according to the third resource identifier fails, acquiring the download address corresponding to the third resource identifier from a pre-generated identifier-address list, where the third resource identifier is the first resource identifier or the second resource identifier;
in step S14, downloading the resources according to the obtained download address, and pushing the downloaded resources to the target user.
The target user may be any user. The resource acquisition request of the target user can be triggered when the target user opens an application program and the like; the resource acquisition request is not specific to a particular resource, and what resources are to be recommended according to the resource acquisition request is determined by a recommendation (reco) service. The recommendation service may determine a resource identifier of a resource that the user is interested in, which is desired to recommend to the user, according to attribute information of the target user, a behavior log of the target user, and the like. For specific implementation of the recommendation service, reference may be made to the related art. The assets may include video assets, audio assets, image assets, and the like.
The present exemplary embodiment includes the following cases:
the first case is a case where no failure occurs:
In the event of no failure, a first resource identification of a first resource pushed to the target user may be determined using the recommendation service in response to a resource acquisition request by the target user. The first resource is a resource of interest to the target user, and the resource identifier of the resource may be a resource ID or the like. After the first resource identifier of the first resource is obtained, the download address of the first resource can be obtained according to the first resource identifier. And downloading the first resource according to the acquired download address of the first resource, and pushing the downloaded first resource to the target user. Wherein the respective resources may be stored in another server, or other electronic device.
The method for obtaining the corresponding download address according to the resource identifier may refer to related technology, and may be that the server forwards the resource identifier to the back-end server, and the back-end server queries the download address corresponding to the resource identifier.
Therefore, under the condition that no fault occurs, the first resource which is interested by the target user can be successfully obtained, and the first resource is pushed to the target user.
The second case is a case where recommended service fails:
in the case of a failure of the recommendation service, a first resource identification of a first resource pushed to the target user cannot be determined in response to a resource acquisition request of the target user. At this time, the second resource identifier of the second resource may be acquired from a resource identifier list generated in advance. The resource identification list stores a plurality of resource identifications, and the resources corresponding to the plurality of resource identifications in the resource identification list are resources with higher heat, so that the resources corresponding to the plurality of resource identifications in the resource identification list have high probability of being the resources interested by the target user.
After the second resource identifier is obtained, the download address of the second resource may be obtained according to the second resource identifier. And downloading the second resource according to the acquired download address of the second resource, and pushing the downloaded second resource to the target user.
Therefore, under the condition that the recommended service fails, the resource identification list is utilized to ensure that the second resource identification of the second resource which is interested by the target user can be obtained from the resource identification list under the condition that the first resource identification is failed to be obtained, and the smooth progress of pushing the resource to the target user is ensured.
The third case is where address acquisition fails:
the failure of address acquisition refers to that according to the method of the related technology, when the corresponding download address is acquired according to the resource identifier, the server forwards the resource identifier to the back-end server, and the back-end server does not return the download address corresponding to the resource identifier.
Since only the address acquisition is failed and the recommended service is not failed, the first resource identification of the first resource pushed to the target user can be determined in response to the resource acquisition request of the target user, but the download address of the first resource cannot be acquired directly from the first resource identification.
At this time, the download address of the first resource corresponding to the first resource identifier cannot be obtained according to the normal condition, and the download address of the first resource corresponding to the first resource identifier can be obtained from a pre-generated identifier-address list. The identifier-address list stores a plurality of resource identifiers and corresponding download addresses. The list of identification-addresses may be stored locally at the server.
After the download address of the first resource corresponding to the first resource identifier is obtained from the identifier-address list, the first resource can be downloaded according to the obtained download address of the first resource, and the downloaded first resource is pushed to the target user.
Therefore, under the condition that the address acquisition fails, the download address of the first resource can be acquired from the identifier-address list by utilizing the identifier-address list, so that the smooth pushing of the first resource to the target user is ensured.
The fourth case is a case where both recommended service and address acquisition fail:
because the recommended service malfunctions, the first resource identification of the first resource pushed to the target user cannot be determined in response to the resource acquisition request of the target user. At this time, the second resource identifier of the second resource may be acquired from a resource identifier list generated in advance.
Because the address acquisition fails, the corresponding download address cannot be acquired according to the second resource identifier according to the related art method. Thus, the download address of the second resource corresponding to the second resource identifier can be obtained from the pre-generated identifier-address list. After the download address of the second resource corresponding to the second resource identifier is obtained from the identifier-address list, the second resource can be downloaded according to the obtained download address of the second resource, and the downloaded second resource is pushed to the target user.
Therefore, under the condition that both the recommended service and the address acquisition are failed, the resource identification list is utilized to ensure that the second resource identification of the second resource which is interested by the target user can be acquired from the resource identification list, and the identifier-address list is utilized to ensure that the download address of the second resource can be acquired from the identifier-address list, so that the smooth pushing of the second resource to the target user is ensured.
By adopting the technical scheme of the embodiment of the disclosure, in the process of pushing resources to a user, the resource identifier list is utilized to ensure that the second resource identifier can be obtained from the resource identifier list under the condition that the first resource identifier is failed to be obtained; the use of the identifier-address list ensures that in case of failure to obtain a download address from the resource identifier, the download address can also be obtained from the identifier-address list. Therefore, smooth progress of pushing resources to the target user can be guaranteed to the greatest extent, and the user experience is guaranteed under the condition of failure. In addition, the smooth proceeding of pushing resources can be ensured only by generating a resource identification list and an identification-address list in advance, the client is not required to be modified, normal link logic can be reused, and the consumption cost is low.
Optionally, on the basis of the above technical solution, the generating of the resource identifier list may be to scan the resource table in a fixed period in full quantity to obtain information of each resource before obtaining the second resource identifier from the resource identifier list; according to the information of each resource, calculating the heat score of each resource; and storing the resource identifiers of the plurality of resources with the highest heat scores into a resource identifier list.
Fig. 2 is a flow diagram of generating a resource identification list in the present disclosure. The resource table may be scanned in full at fixed cycles by setting up a timed task, for example, a timed task may be started up at 12 pm per day. The resource table may include information for each resource within the platform. The information of a resource may include a resource identification of the resource, an exposure of the resource, a number of times the resource was endorsed, a number of times it was forwarded, a number of times it was reviewed, a heat information of an author of the resource and an author of the resource, and the like.
The heat score of each resource can be calculated according to the configured heat policy and the information of each resource. The popularity score of a resource may reflect the level of interest to most users in the resource, the higher the popularity score, the more interesting the user.
The popularity score of a resource may be weighted and summed based on the number of times the resource was endorsed, the number of times it was forwarded, the number of times it was reviewed, and the quantized popularity information of the author of the resource. The heat score of a resource may also be obtained by weighted summation according to the exposure of the resource, the number of times the resource is praised, the number of times the resource is forwarded, and the number of times the resource is reviewed. The specific heat policy can be adjusted according to actual conditions, so that most users are interested in resources with higher heat scores.
The plurality of resources with the highest heat score are the plurality of resources arranged in the front, and are ranked according to the heat score from high to low. And storing the resource identifiers of the plurality of resources with the highest heat scores into a resource identifier list, so that the resources corresponding to the resource identifiers in the resource identifier list can be ensured to be the resources which are interested by users. The number of the resource identifiers in the resource identifier list can be dynamically configured according to actual requirements.
Alternatively, when the resource identifiers of the plurality of resources with the highest heat scores are stored in the resource identifier list, the resource identifiers of the plurality of resources may be stored in the resource identifier list in the order of the heat scores of the plurality of resources from high to low. The resource identification list may be stored to a configuration center.
The resource identifiers stored in the resource identifier list are updated according to a fixed period, and before a plurality of resource identifiers are stored in the resource identifier list in each period, a plurality of resource identifiers stored in the resource identifier list in the previous period are deleted.
Therefore, when the recommended service fails, the second resource corresponding to the second resource identifier acquired by the resource identifier list is the resource of interest to the target user with high probability, so that the resource of interest can be pushed like the target user even if the recommended service fails, and the user experience is ensured.
Optionally, on the basis of the above technical solution, acquiring the second resource identifier from the pre-generated resource identifier list may include: and acquiring the cursor of the target user, and acquiring a second resource identifier from the plurality of resource identifiers stored in the resource identifier list according to the cursor of the target user.
For the target user, the second resource identifier may be any resource identifier in the resource identifier list, and a cursor (cursor) position may be used to indicate the position of the second resource identifier in the resource identifier list. The cursors are in one-to-one correspondence with the resource identifiers. The server may maintain one cursor for each user, which may be stored in redis (a stored list) for each user.
For each user, the initialization cursor is 0. Therefore, when the second resource identifier is acquired for the target user from the resource identifier list for the first time, the second resource identifier is the resource identifier indicated by the cursor being 1; after the resource identifier indicated by the cursor being 1 is obtained, updating the cursor of the target user to 2, and then obtaining a second resource identifier for the target user from the resource identifier list next time, wherein the second resource identifier is the resource identifier indicated by the cursor being 2. Optionally, a plurality of (for example, 6) second resource identifiers can be acquired for the target user at a time, and when the second resource identifiers are acquired for the target user from the resource identifier list for the first time, the second resource identifiers are the resource identifiers respectively indicated by cursors 1 to 6; after 6 resource identifiers indicated by the cursors from 1 to 6 are obtained, updating the cursor of the target user to 7, and then obtaining a plurality of second resource identifiers for the target user from the resource identifier list next time, wherein the second resource identifiers are the resource identifiers respectively indicated by the cursors from 7 to 12.
In the related art, in order to implement spam when the recommended service fails, a static resource may be directly configured, and a resource is randomly returned every time a user requests, but in this way, a problem that a resource is repeatedly returned to the user may occur. To avoid this problem, in the related art, one cursor is maintained for the user of the client at each client, however, the cursor is maintained for the user at the client, the client is required to be matched and modified, normal link logic cannot be reused, and the cost is high.
Fig. 3 is a flow chart of a method for pushing resources, which is a method used in the case of a failure of a recommended service, in the present disclosure. The target user sends a resource acquisition request to the server, but the recommendation service sends a fault at the moment, so that a spam scheme is adopted to judge whether the cursor of the target user exists, if the cursor of the target user does not exist, the cursor of the target user is initialized to 0, and a resource identifier indicated by the cursor being 1 is acquired from a resource identifier list stored in the configuration center. If the cursor of the target user exists, acquiring the cursor of the target user, and acquiring the resource identifier indicated by the cursor of the target user from the resource identifier list stored in the configuration center. And adding the resource identifier obtained from the resource identifier list into the feed list so as to push the resource corresponding to the obtained resource identifier to the target user. Updating the cursor of the target user and setting an expiration time for the cursor of the target user. The expiration time of the cursor may be the same as the update time of the resource identification list.
By adopting the technical scheme of the embodiment of the disclosure, a plurality of resource identifiers stored in the resource identifier list are updated according to a fixed period, and are the resource identifiers of the resources which most users are interested in. The server can maintain a cursor for each user, can ensure that the second resource identification determined for the user cannot be repeated, does not need to modify the client, and has the advantage of lower cost.
Optionally, on the basis of the above technical solution, the generating of the identifier-address list before acquiring the download address corresponding to the third resource identifier from the pre-generated identifier-address list may specifically include: determining resource identifiers of all resources pushed to all users in response to resource acquisition requests of all users; acquiring the download address of each resource according to the resource identification of each resource; acquiring each resource according to the download address of each resource, and pushing each resource to each user; and storing the resource identification and the download address of each resource into an identification-address list.
When the address acquisition is not failed, the resource identification of each resource pushed to each user can be determined in response to the resource acquisition request of each user, and the download address of each resource is acquired according to the resource identification of each resource. The step of obtaining the download address of each resource according to the resource identifier of each resource refers to obtaining the download address according to a method in related technology, for example, obtaining the download address of each resource according to the resource identifier of each resource by a back-end server. And acquiring each resource according to the download address of each resource, so that each resource can be pushed to each user. Thus, the method of pushing the resource to each user is completed when no failure occurs.
Under the condition that no fault occurs, after the download address of each resource is obtained according to the resource identifier of each resource, an asynchronous thread can be started, and the resource identifier of each resource and the download address of each resource are asynchronously stored into an identifier-address list, wherein the resource identifier and the download address of the same resource correspond. The address-identification list may be a redis list, in which keys (keywords) are resource identifications and values (values) are download addresses.
In this way, the identifier-address list can store the resource identifiers and the corresponding download addresses of a plurality of resources, and when the address acquisition fails, the download addresses corresponding to the resource identifiers can be acquired through the identifier-address list.
Optionally, on the basis of the above technical solution, the resource identifier and the corresponding download address of each resource may be put in the aggregator for batch processing, which may specifically be: and performing de-duplication processing on the repeated resource identifiers acquired in the fixed duration. And then storing the resource identification of each resource after the deduplication processing and the download address of each resource into an identification-address list.
For example, after obtaining the resource identifiers of 100 resource a for 5 seconds, the resource identifiers of 99 resource a may be deleted, and only the resource identifiers of 1 resource a and the corresponding download address store identifier-address list.
Therefore, the resource identifier and the corresponding download address of the resource can be prevented from being repeatedly stored in the identifier-address list, and the resource waste is avoided.
Optionally, on the basis of the above technical solution, a success rate of querying a download address corresponding to the third resource identifier in the identifier-address list may be obtained; and determining the storage space size of the identification-address list according to the success rate.
The resource identifier and the corresponding download address stored in the identifier-address list are the resource identifier and the corresponding download address acquired in response to the resource acquisition request of each user when no fault occurs. Therefore, if the third resource identifier is a resource identifier which is not obtained when the failure does not occur, the third resource identifier does not exist in the identifier-address list, and thus the corresponding download address cannot be obtained.
In order to ensure that the download address corresponding to the third resource identifier can be obtained in the identifier-address list in percentage, the resource identifiers of all the resources need to be stored in the identifier-address list. The higher the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list, the more the resource identifiers and the corresponding addresses stored in the identifier-address list, and the larger the storage space of the identifier-address list. However, considering that some resources may be difficult to access, the resources that are difficult to access may occupy a large amount of memory space. Therefore, in order to save memory space and computing resources, a portion of the success rate may be properly discarded.
Experiments prove that for the A platform, if the size of the storage space of the identifier-address list is 4G, the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list is 60%; if the size of the storage space of the identifier-address list is 5G, the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list is 80%; if the size of the storage space of the identifier-address list is 6G, the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list is 81%; if the size of the storage space of the identifier-address list is 8G, the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list is 99%. Considering that most users consume only 80% of the resources and the remaining 20% of the resources are rarely consumed, for the a-platform, the storage space size of the id-address list may be set to 5G according to the success rate.
According to the actual situation, different success rates can be selected, and different storage space sizes of the identifier-address list can be selected according to the success rates.
Fig. 4 is a flow diagram of generating an identity-address list in the present disclosure. Under the condition that no fault occurs, a resource identifier and a corresponding download address are acquired in response to a resource acquisition request of a user, an asynchronous thread is started, the resource identifier is subjected to duplication removal processing, and the resource identifier after the duplication removal processing and the corresponding download address are stored in an identifier-address list. When the address acquisition fails, a download address corresponding to the third resource identifier can be acquired from the identifier-address list, and the storage space size of the identifier-address list is determined according to the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list.
Therefore, the storage space size of the identification-address list is reasonably estimated by using the success rate, so that most users are kept in the process of being in charge, the balance between the success rate and the storage space size is realized, and the requirements of most users are met under the condition of saving the storage space and the computing resources.
Optionally, on the basis of the above technical solution, because the storage space of the identifier-address list is limited, if the resource identifier and the corresponding download address need to be stored in the identifier-address list if the storage space of the identifier-address list is full, a plurality of resource identifiers with the lowest queried probability in the identifier-address list may be obtained, and a plurality of resource identifiers with the lowest queried probability in the identifier-address list and the download addresses corresponding to the plurality of resource identifiers may be deleted. The resource identification and download address of the plurality of resources to be stored is then stored to an identification-address list.
In this way, the cache eviction policy of the id-address list is LFU ((least frequently used, least frequently using page replacement algorithm), which ensures that the id-address list stores the most recently accessed resource id and download address.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Fig. 5 is a block diagram of a resource pushing apparatus according to an exemplary embodiment, and referring to fig. 5, the apparatus includes a first acquisition module 51, a second acquisition module 52, a third acquisition module 53, and a resource pushing module 54.
A first obtaining module 51, configured to determine a first resource identifier of a first resource pushed to a target user in response to a resource obtaining request of the target user, and obtain a download address according to the first resource identifier;
a second obtaining module 52, configured to obtain a second resource identifier from a pre-generated resource identifier list, and obtain a download address according to the second resource identifier, in a case that it is determined that the first resource identifier fails in response to the resource obtaining request of the target user;
a third obtaining module 53, configured to obtain, in a case where obtaining a download address according to a third resource identifier fails, a download address corresponding to the third resource identifier from a pre-generated identifier-address list, where the third resource identifier is the first resource identifier or the second resource identifier;
the resource pushing module 54 is configured to download the resource according to the obtained download address, and push the downloaded resource to the target user.
Optionally, the second obtaining module 52 includes:
a cursor obtaining unit configured to obtain a cursor of the target user, where the cursor is used to indicate a position of the second resource identifier in the resource identifier list;
and the resource identifier acquisition unit is configured to acquire the second resource identifier from the plurality of resource identifiers stored in the resource identifier list according to the cursor of the target user.
Optionally, before the second resource identifier is obtained from the pre-generated resource identifier list, the method further includes:
an information acquisition unit configured to acquire information of each of the resources by scanning a resource table in a fixed cycle in total;
a score calculating unit configured to calculate a heat score of each of the resources based on the information of each of the resources;
and the identification storage unit is configured to store the resource identifications of the plurality of resources with the highest heat scores into the resource identification list.
Optionally, before the obtaining the download address corresponding to the third resource identifier from the pre-generated identifier-address list, the method further includes:
the identification determining module is configured to respond to the resource acquisition request of each user and determine the resource identification of each resource pushed to each user;
The address acquisition module is configured to acquire the download address of each resource according to the resource identifier of each resource;
the pushing module is configured to acquire each resource according to the download address of each resource and push each resource to each user;
and the identification-address storage module is configured to store the resource identification and the download address of each resource into the identification-address list.
Optionally, the identification-address storage module includes:
the de-duplication unit is configured to perform de-duplication treatment on the repeated resource identifiers acquired in the fixed time length;
and the post-duplication removal storage unit is configured to store the resource identification of each resource after duplication removal and the download address of each resource into the identification-address list.
Optionally, the method further comprises:
the success rate acquisition module is configured to acquire the success rate of the downloading address corresponding to the third resource identifier in the identifier-address list;
and the size determining module is configured to determine the size of the storage space of the identification-address list according to the success rate.
Optionally, in the case that the storage space of the identifier-address list is full, the identifier-address storage module includes:
The deleting unit is configured to delete a plurality of resource identifiers with the lowest queried probability and a plurality of corresponding download addresses in the identifier-address list;
an identification-address storage unit configured to store the resource identification and the download address of the respective resources to the identification-address list.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 6 is a block diagram illustrating an apparatus 600 for pushing of resources, according to an example embodiment. For example, apparatus 600 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, exercise device, personal digital assistant, or the like.
Referring to fig. 6, apparatus 600 may include one or more of the following components: a processing component 602, a memory 604, a power component 606, a multimedia component 608, an audio component 610, an input/output (I/O) interface 612, a sensor component 614, and a communication component 616.
The processing component 602 generally controls overall operation of the apparatus 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or part of the steps of the push method for resources described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support operations at the apparatus 600. Examples of such data include instructions for any application or method operating on the apparatus 600, contact data, phonebook data, messages, pictures, videos, and the like. The memory 604 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk.
The power supply component 606 provides power to the various components of the device 600. The power supply components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 600.
The multimedia component 608 includes a screen between the device 600 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and/or a rear camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 600 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 610 is configured to output and/or input audio signals. For example, the audio component 610 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 and peripheral interface modules, which may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
The sensor assembly 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor assembly 614 may detect the open/closed state of the device 600, the relative positioning of the components, such as the display and keypad of the device 600, the sensor assembly 614 may also detect a change in position of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration/deceleration of the device 600, and a change in temperature of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. The sensor assembly 614 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communication between the apparatus 600 and other devices in a wired or wireless manner. The apparatus 600 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 616 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 616 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for performing the push method for resources described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as memory 604, including instructions executable by processor 620 of apparatus 600 to perform the method of pushing resources described above. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 7 is a block diagram illustrating an apparatus 700 for pushing of resources, according to an example embodiment. For example, the apparatus 700 may be provided as a server. Referring to fig. 7, apparatus 700 includes a processing component 722 that further includes one or more processors, and memory resources represented by memory 732, for storing instructions, such as a computer program product, executable by processing component 722. The computer program product stored in memory 732 may include one or more modules each corresponding to a set of instructions. Further, the processing component 722 is configured to execute instructions to perform the push method of resources described above.
The apparatus 700 may further comprise a power component 726 configured to perform power management of the apparatus 700, a wired or wireless network interface 750 configured to connect the apparatus 700 to a network, and an input output (I/O) interface 758. The apparatus 700 may operate based on an operating system stored in memory 732, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It is to be understood that the invention is not limited to the precise arrangements and instrumentalities shown in the drawings, which have been described above, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. The pushing method of the resource is characterized by comprising the following steps:
responding to a resource acquisition request of a target user, determining a first resource identifier of a first resource pushed to the target user, and acquiring a download address according to the first resource identifier;
under the condition that the first resource identifier is determined to fail in response to the resource acquisition request of the target user, acquiring a second resource identifier from a pre-generated resource identifier list, and acquiring a downloading address according to the second resource identifier;
under the condition that the acquisition of the download address according to the third resource identifier fails, acquiring the download address corresponding to the third resource identifier from a pre-generated identifier-address list, wherein the third resource identifier is the first resource identifier or the second resource identifier;
and downloading the resources according to the obtained download address, and pushing the downloaded resources to the target user.
2. The method of claim 1, wherein the obtaining the second resource identifier from the pre-generated resource identifier list comprises:
acquiring a cursor of the target user, wherein the cursor is used for indicating the position of the second resource identifier in the resource identifier list;
and acquiring the second resource identifier from a plurality of resource identifiers stored in the resource identifier list according to the cursor of the target user.
3. The method of claim 1, further comprising, prior to said obtaining the second resource identifier from the pre-generated list of resource identifiers:
scanning a resource table according to a fixed period full quantity to acquire information of each resource;
according to the information of each resource, calculating the heat score of each resource;
and storing the resource identifiers of the plurality of resources with the highest heat scores into the resource identifier list.
4. The method of claim 1, further comprising, prior to said obtaining a download address corresponding to said third resource identifier from a pre-generated identifier-address list:
responding to a resource acquisition request of each user, and determining a resource identifier of each resource pushed to each user;
Acquiring the download address of each resource according to the resource identifier of each resource;
acquiring each resource according to the download address of each resource, and pushing each resource to each user;
and storing the resource identification and the download address of each resource into the identification-address list.
5. The method of claim 4, wherein storing the resource identification and download address of the respective resource to the identification-address list comprises:
performing de-duplication treatment on the repeated resource identifiers acquired in the fixed duration;
and storing the resource identification of each resource after the deduplication processing and the download address of each resource into the identification-address list.
6. The method as recited in claim 4, further comprising:
acquiring the success rate of inquiring the download address corresponding to the third resource identifier in the identifier-address list;
and determining the storage space size of the identification-address list according to the success rate.
7. The method of claim 4, wherein said storing the resource identification and download address of said respective resource to said identification-address list in the event that the storage space of said identification-address list is full comprises:
Deleting a plurality of resource identifiers with the lowest queried probability in the identifier-address list and a plurality of corresponding download addresses;
and storing the resource identification and the download address of each resource into the identification-address list.
8. A pushing device for a resource, comprising:
the first acquisition module is configured to respond to a resource acquisition request of a target user, determine a first resource identifier of a first resource pushed to the target user, and acquire a download address according to the first resource identifier;
the second acquisition module is configured to acquire a second resource identifier from a pre-generated resource identifier list and acquire a download address according to the second resource identifier under the condition that the first resource identifier fails in response to the resource acquisition request of the target user;
a third obtaining module, configured to obtain, in a case where obtaining a download address according to a third resource identifier fails, a download address corresponding to the third resource identifier from a pre-generated identifier-address list, where the third resource identifier is the first resource identifier or the second resource identifier;
and the resource pushing module is configured to download the resources according to the acquired download address and push the downloaded resources to the target user.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of pushing resources of any of claims 1 to 7.
10. A computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of pushing resources of any of claims 1 to 7.
CN202310028084.9A 2023-01-09 2023-01-09 Method and device for pushing resources, electronic equipment and storage medium Pending CN116132524A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310028084.9A CN116132524A (en) 2023-01-09 2023-01-09 Method and device for pushing resources, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310028084.9A CN116132524A (en) 2023-01-09 2023-01-09 Method and device for pushing resources, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116132524A true CN116132524A (en) 2023-05-16

Family

ID=86311213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310028084.9A Pending CN116132524A (en) 2023-01-09 2023-01-09 Method and device for pushing resources, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116132524A (en)

Similar Documents

Publication Publication Date Title
CN112003893B (en) Resource downloading method and device
CN109388625B (en) Method and device for processing configuration file in multi-distributed file system
CN108804244B (en) Data transmission method, device and storage medium
CN107729098B (en) User interface display method and device
CN111246278B (en) Video playing method and device, electronic equipment and storage medium
CN107396149B (en) Method and device for playing advertisement
CN113190777A (en) Data updating method and device, electronic equipment, storage medium and product
CN109634762B (en) Data recovery method and device, electronic equipment and storage medium
CN107483605B (en) File downloading method and device and storage medium
CN110908814A (en) Message processing method and device, electronic equipment and storage medium
CN107463419B (en) Application restarting method and device and computer readable storage medium
CN111221862B (en) Request processing method and device
CN116132524A (en) Method and device for pushing resources, electronic equipment and storage medium
CN112035246B (en) Method, device and system for acquiring virtual resources, electronic equipment and storage medium
CN110008135B (en) Information processing method and device and electronic equipment
CN110750787B (en) Virus scanning method, device and medium
CN107257384B (en) Service state monitoring method and device
CN112632184A (en) Data processing method and device, electronic equipment and storage medium
CN111736890A (en) Data updating method and device, electronic equipment and storage medium
CN110995767B (en) Request processing method and device
CN111343268B (en) Method and device for downloading multimedia resources, server and electronic equipment
CN113191792B (en) Task processing method, device, electronic equipment, storage medium and program product
CN115794853B (en) Updating method and device of government affair data resource catalog, electronic equipment and medium
CN107463414B (en) Application installation method and device
CN110209775B (en) Text processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination