CN112035246B - Method, device and system for acquiring virtual resources, electronic equipment and storage medium - Google Patents

Method, device and system for acquiring virtual resources, electronic equipment and storage medium Download PDF

Info

Publication number
CN112035246B
CN112035246B CN202010791061.XA CN202010791061A CN112035246B CN 112035246 B CN112035246 B CN 112035246B CN 202010791061 A CN202010791061 A CN 202010791061A CN 112035246 B CN112035246 B CN 112035246B
Authority
CN
China
Prior art keywords
virtual resource
time point
target service
client
trigger instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010791061.XA
Other languages
Chinese (zh)
Other versions
CN112035246A (en
Inventor
刘正阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010791061.XA priority Critical patent/CN112035246B/en
Publication of CN112035246A publication Critical patent/CN112035246A/en
Priority to PCT/CN2021/111305 priority patent/WO2022028607A1/en
Application granted granted Critical
Publication of CN112035246B publication Critical patent/CN112035246B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure relates to a method, a device, a system, an electronic device and a storage medium for obtaining a virtual resource, wherein the method comprises the following steps: receiving configuration information of a target service for obtaining virtual resources from a server; sending virtual resource request information to a server at different time points; receiving virtual resource data returned by a server side according to the virtual resource request information; and displaying a virtual resource acquisition result according to the virtual resource acquisition instruction, and generating and sending virtual resource confirmation information to the server side. The method and the device for generating the virtual resource request information scatter the receiving processing of the virtual resource request information and the generating processing of the virtual resource data at different time points, reduce the system resource occupation amount of the server side, relieve the operation pressure of the server side, do not need to increase extra server side hardware, do not need to limit the flow of the virtual resource acquisition request, and improve the acquisition success rate of the virtual resource.

Description

Method, device and system for acquiring virtual resources, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of computer technologies, and in particular, to a method, a device, a system, an electronic device and a storage medium for obtaining virtual resources.
Background
In the process of obtaining the virtual resource, if many users participate in the virtual resource and the virtual resource is obtained in a certain time point, a very high concurrency of the virtual resource obtaining occurs, so that the system resource occupation of the server side is huge.
In the related art, the problem of large concurrency of virtual resource acquisition is generally solved as follows. In one mode, the server is protected by limiting the flow of the user, so that the overload of system resources of the server is prevented. If the flow of the virtual resource request exceeds the flow which can be borne by the server side, returning response information of failure in virtual resource acquisition to partial requests exceeding the flow which can be borne. In the second mode, the hardware of the server side is upgraded to improve the flow which can be borne by the server side.
However, the mode for a while causes that part of users cannot acquire virtual resources, and the success rate of acquiring the virtual resources is not high; the second way increases the cost of the server.
Disclosure of Invention
The disclosure provides a method, a device, a system, an electronic device and a storage medium for obtaining virtual resources, so as to at least solve the problems of low success rate of obtaining the virtual resources and high hardware cost of a server side in the related technology. 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 obtaining a virtual resource, applied to a client, the method including: receiving configuration information of a target service from a server, wherein the target service is used for acquiring a virtual resource, the configuration information comprises a starting time point of prefetching the virtual resource, a starting time point of the target service and a first time period, and the starting time point of prefetching the virtual resource is positioned before the starting time point of the target service; receiving a trigger instruction aiming at the target service, and generating virtual resource request information according to the trigger instruction; when the current time point corresponding to the trigger instruction is equal to or before the starting time point of prefetching the virtual resource, sending the virtual resource request information to the server side at a time point between the starting time point of prefetching the virtual resource and the starting time point of the target service; immediately sending the virtual resource request information to the server after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching of the virtual resource and before the starting time point of the target service; when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, sending the virtual resource request information to the server side at a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the first time period to the current time point corresponding to the trigger instruction; receiving virtual resource data returned by the server side according to the virtual resource request information; receiving a virtual resource acquisition instruction aiming at the virtual resource data, displaying a virtual resource acquisition result according to the virtual resource acquisition instruction, generating and sending virtual resource confirmation information to the server side; the first time period represents a time period between a current time point corresponding to the virtual resource acquisition instruction and a current time point corresponding to the display virtual resource acquisition result.
Optionally, when the current time point corresponding to the trigger instruction is equal to the starting time point of prefetching the virtual resource or is before the starting time point of prefetching the virtual resource, sending virtual resource request information to the server at a time point between the starting time point of prefetching the virtual resource and the starting time point of the target service, where the method includes: when the current time point corresponding to the trigger instruction is equal to or before the starting time point of prefetching the virtual resource, randomly selecting an obtained time point between the starting time point of prefetching the virtual resource and the starting time point of the target service, and sending the virtual resource request information to the server side at the randomly selected time point.
Optionally, when the current time point corresponding to the trigger instruction is equal to the starting time point of the target service or after the starting time point of the target service, sending the virtual resource request information to the server at a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the current time point corresponding to the trigger instruction to the first time period, where the sending includes: and when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, randomly selecting a time point between the current time point corresponding to the trigger instruction and the time point obtained by adding the first time period to the current time point corresponding to the trigger instruction, and sending the virtual resource request information to the server side at the time point obtained by random selection.
Optionally, the virtual resource data includes at least one of: virtual resource theme, virtual resource number.
According to a second aspect of an embodiment of the present disclosure, there is provided a method for obtaining a virtual resource, applied to a server, where the method includes: the method comprises the steps of issuing configuration information of a target service to a client, wherein the configuration information comprises a starting time point of prefetching the virtual resource, a starting time point of the target service and a first time period, and the starting time point of prefetching the virtual resource is positioned before the starting time point of the target service; receiving virtual resource request information generated by the client according to a trigger instruction for the target service, wherein the virtual resource request information is sent to the server end by the client when the current time point corresponding to the trigger instruction is equal to the starting time point of the prefetching of the virtual resource or before the starting time point of the prefetching of the virtual resource, and is sent to the server end at the time point between the starting time point of the prefetching of the virtual resource and the starting time point of the target service, or the virtual resource request information is sent to the server end by the client when the current time point corresponding to the trigger instruction is after the starting time point of the prefetching of the virtual resource and before the starting time point of the target service, or the virtual resource request information is sent to the server end by the client when the current time point corresponding to the trigger instruction is equal to the starting time point of the target service or after the starting time point of the target service, and is added with the first time period between the current time point corresponding to the trigger instruction and the first time point corresponding to the current time point of the trigger instruction; returning virtual resource data to the client according to the virtual resource request information; receiving virtual resource confirmation information returned by the client according to the virtual resource data; the first time period represents a time period from a current time point corresponding to the virtual resource obtaining instruction received by the client to a current time point corresponding to the display virtual resource obtaining result of the client.
Optionally, the returning virtual resource data to the client according to the virtual resource request information includes: distributing virtual resource quantity according to the virtual resource request information and preset virtual resource logic; and generating the virtual resource data according to the number of the virtual resources, and returning the virtual resource data to the client.
Optionally, after receiving the virtual resource acknowledgement information returned by the client according to the virtual resource data, the method further includes: generating a cache mark according to the virtual resource confirmation information, and recording that the client side has acquired the virtual resource data according to the cache mark.
Optionally, after the generating a cache tag according to the virtual resource acknowledgement information, the method further includes: and generating a subscription message, and sending the subscription message to a database, wherein the database is used for recording the number of virtual resources of the client according to the subscription message.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for obtaining a virtual resource, applied to a client, the apparatus including: an acquisition module configured to receive configuration information of a target service from a server, the target service being used for acquiring a virtual resource, the configuration information including a start time point of prefetching the virtual resource, a start time point of the target service, and a first time period, the start time point of prefetching the virtual resource being located before the start time point of the target service; the request module is configured to receive a trigger instruction aiming at the target service and generate virtual resource request information according to the trigger instruction; a sending module, configured to send the virtual resource request information to the server at a time point located between the start time point of prefetching the virtual resource and the start time point of the target service when the current time point corresponding to the trigger instruction is equal to or before the start time point of prefetching the virtual resource; the sending module is further configured to send the virtual resource request information to the server immediately after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching of the virtual resource and before the starting time point of the target service; the sending module is further configured to send the virtual resource request information to the server at a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the first time period to the current time point corresponding to the trigger instruction when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service; the acquisition module is further configured to receive virtual resource data returned by the server side according to the virtual resource request information; the confirmation module is configured to receive a virtual resource acquisition instruction aiming at the virtual resource data, display a virtual resource acquisition result according to the virtual resource acquisition instruction, and generate and send virtual resource confirmation information to the server side; the first time period represents a time period between a current time point corresponding to the virtual resource acquisition instruction and a current time point corresponding to the display virtual resource acquisition result.
Optionally, the sending module is configured to randomly select an obtained time point between the starting time point of prefetching the virtual resource and the starting time point of the target service when the current time point corresponding to the trigger instruction is equal to or before the starting time point of prefetching the virtual resource, and send the virtual resource request information to the server at the randomly selected time point.
Optionally, the sending module is configured to randomly select a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the first time period to the current time point corresponding to the trigger instruction when the current time point corresponding to the trigger instruction is equal to the starting time point of the target service or after the starting time point of the target service, and send the virtual resource request information to the server at the randomly selected time point.
Optionally, the virtual resource data includes at least one of: virtual resource theme, virtual resource number.
According to a fourth aspect of an embodiment of the present disclosure, there is provided an apparatus for obtaining a virtual resource, applied to a server, where the apparatus includes: the system comprises a delivery module, a target service and a client, wherein the delivery module is configured to deliver configuration information of the target service to the client, the configuration information comprises a starting time point of prefetching the virtual resource, a starting time point of the target service and a first time period, and the starting time point of prefetching the virtual resource is positioned before the starting time point of the target service; a receiving module, configured to receive virtual resource request information generated by the client according to a trigger instruction for the target service, where the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is equal to a start time point of the prefetching of the virtual resource or before the start time point of the prefetching of the virtual resource, and is sent to the server end at a time point between the start time point of the prefetching of the virtual resource and the start time point of the target service, or the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is after the start time point of the prefetching of the virtual resource and before the start time point of the target service, or the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is equal to a start time point of the target service or after the start time point of the target service, and is added with the first time period corresponding to the trigger instruction; the response module is configured to return virtual resource data to the client according to the virtual resource request information; the receiving module is further configured to receive virtual resource confirmation information returned by the client according to the virtual resource data; the first time period represents a time period from a current time point corresponding to the virtual resource obtaining instruction received by the client to a current time point corresponding to the display virtual resource obtaining result of the client.
Optionally, the response module includes: the quantity allocation module is configured to allocate virtual resource quantity according to the virtual resource request information and preset virtual resource logic; and the virtual resource return module is configured to generate the virtual resource data according to the number of the virtual resources and return the virtual resource data to the client.
Optionally, the apparatus further comprises: the marking module is configured to generate a cache mark according to the virtual resource confirmation information after the receiving module receives the virtual resource confirmation information returned by the client according to the virtual resource data, and record that the client has acquired the virtual resource data according to the cache mark.
Optionally, the apparatus further comprises: and the subscription module is configured to generate a subscription message after the marking module generates a cache mark according to the virtual resource confirmation information, and send the subscription message to a database, wherein the database is used for recording the number of the virtual resources of the client according to the subscription message.
According to a fifth aspect of an embodiment of the present disclosure, there is provided a system for acquiring a virtual resource, including a client and a server, where the client includes an apparatus for acquiring a virtual resource according to the third aspect; the server side comprises the virtual resource acquisition device according to the fourth aspect.
According to a sixth 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 obtaining a virtual resource according to the first aspect or the second aspect.
According to a seventh aspect of embodiments of the present disclosure, there is provided a storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method for acquiring virtual resources according to the first or second aspect.
According to an eighth aspect of embodiments of the present disclosure, there is provided a computer program product comprising readable program code executable by a processor of an electronic device to perform the method of obtaining a virtual resource according to the first or second aspect above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the virtual resource obtaining scheme provided by the embodiment of the present disclosure, the client obtains, from the server, configuration information of a target service, where the target service is used to obtain the virtual resource, where the configuration information may include a start time point of prefetching the virtual resource, a start time point of the target service, and a first time period. And receiving a trigger instruction aiming at the target service, and generating virtual resource request information according to the trigger instruction. The client may send the virtual resource request information to the server at any one of the following three types of time points. And (I) when the current time point corresponding to the trigger instruction is equal to or before the starting time point of the prefetching virtual resource, sending virtual resource request information to the server at a time point between the starting time point of the prefetching virtual resource and the starting time point of the target service. And secondly, immediately sending virtual resource request information to the server after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching virtual resource and before the starting time point of the target service. And thirdly, when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, sending virtual resource request information to the server side at a time point between the current time point corresponding to the trigger instruction and the time point obtained by adding the first time period to the current time point corresponding to the trigger instruction. The server side returns virtual resource data to the client side according to the virtual resource request information, and the client side displays a virtual resource acquisition result according to a virtual resource acquisition instruction aiming at the virtual resource data, generates and sends virtual resource confirmation information to the server side.
The client can send virtual resource request information to the server at different time points, correspondingly, the server can receive the virtual resource request information at different time points, further virtual resource data can be generated at different time points, the server is prevented from being concentrated to receive a large amount of virtual resource request information at one time point, the server is prevented from being concentrated to generate a large amount of virtual resource data at one time point, the receiving processing of the virtual resource request information and the generating processing of the virtual resource data are performed at different time points, the system resource occupation amount of the server at the same time point is reduced, the operation pressure of the server is relieved, additional server hardware is not required to be added for coping with a large amount of virtual resource acquisition requests, meanwhile, the limitation of a large amount of virtual resource acquisition requests is not required, the failure of partial users in acquiring the virtual resource is avoided, and the success rate of acquiring the virtual resource is improved.
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 disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 is a flow chart illustrating a method of virtual resource acquisition according to an exemplary embodiment.
FIG. 2 is a flow chart illustrating another method of virtual resource acquisition, according to an example embodiment.
FIG. 3 is a schematic diagram illustrating an interactive flow diagram of a prefetch-followed by-acknowledge high concurrency virtual resource acquisition scheme, according to an example embodiment.
Fig. 4 is a diagram illustrating a relationship between a point in time when a user enters a red packet acquisition business activity page and a point in time when a prefetch request is sent, according to an exemplary embodiment.
Fig. 5 is a block diagram illustrating an apparatus for acquiring virtual resources according to an exemplary embodiment.
Fig. 6 is a block diagram illustrating another virtual resource acquisition apparatus according to an exemplary embodiment.
FIG. 7 is a block diagram of an electronic device for acquiring virtual resources, according to an example embodiment.
FIG. 8 is a block diagram of an electronic device for acquiring virtual 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 acquiring a virtual resource according to an exemplary embodiment, and as shown in fig. 1, the method for acquiring a virtual resource may be applied to a client, and may specifically include the following steps.
In step S11, configuration information of the target service is received from the server.
In embodiments of the present disclosure, a target service may be used for a client to acquire virtual resources. The server side may set configuration information for the target service in advance, where the configuration information may include a start time point of the prefetching virtual resource, a start time point of the target service, a first time period, and the like. The starting time point of the prefetching virtual resource may be a time point before the starting time point of the target service, and the first time period may be a time period between a current time point corresponding to the virtual resource obtaining instruction and a current time point corresponding to the display virtual resource operation result. For example, the starting time point of the prefetching virtual resource is T0, the starting time point of the target service is T1, and the first time period is R. The starting time point T0 of the prefetch virtual resource is earlier than the starting time point T1 of the target service.
In step S12, a trigger instruction for the target service is received, virtual resource request information is generated according to the trigger instruction, and the virtual resource request information is sent to the server side.
In an embodiment of the present disclosure, a user may perform a trigger operation for a target service on a client, which may be understood as a preparation operation before a virtual resource is acquired, for example, an operation of a user entering an operation page of the target service may be a trigger operation. And generating a trigger instruction in response to the trigger operation of the user, and generating virtual resource request information according to the trigger instruction. The virtual resource request information may include identification information of the client, identity information of the user, a current time point corresponding to the trigger instruction, and the like, and the content, the format, and the like in the virtual resource request information are not particularly limited in the embodiment of the present disclosure.
In an embodiment of the present disclosure, the client may send the virtual resource request information to the server at different time points. The method specifically comprises the following time points for sending the virtual resource request information:
and (I) when the current time point corresponding to the trigger instruction is equal to or before the starting time point of the prefetching virtual resource, sending virtual resource request information to the server at a time point between the starting time point of the prefetching virtual resource and the starting time point of the target service.
For example, if the current time point TC corresponding to the trigger instruction is before the start time point T0 of the prefetching virtual resource, the virtual resource request information is sent to the server at a time point T3 between the start time point T0 of the prefetching virtual resource and the start time point T1 of the target service.
And secondly, immediately sending virtual resource request information to the server after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching virtual resource and before the starting time point of the target service.
For example, if the current time point TC corresponding to the trigger instruction is between the starting time point T0 of the prefetching virtual resource and the starting time point T1 of the target service, the virtual resource request information is immediately sent to the server, which can be understood as that the virtual resource request information is sent to the server at the current time point TC corresponding to the trigger instruction.
And thirdly, when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, sending virtual resource request information to the server side at a time point between the current time point corresponding to the trigger instruction and the time point obtained by adding the first time period to the current time point corresponding to the trigger instruction.
For example, if the current time point TC corresponding to the trigger instruction is located after the start time point T1 of the target service, the virtual resource request information is sent to the server at a time point located between the current time point TC corresponding to the trigger instruction and the time point T4, where the time point T4 is equal to the current time point TC corresponding to the trigger instruction plus the first time period R.
In step S13, virtual resource data returned by the server side according to the virtual resource request information is received.
In the embodiment of the disclosure, after receiving the virtual resource request information sent by the client, the server may generate virtual resource data according to the virtual resource request information and return the virtual resource data to the client. Wherein the virtual resource data may comprise at least one of: virtual resource topics, virtual resource numbers, number of virtual resources, total number of virtual resources, etc.
In step S14, a virtual resource acquisition instruction for the virtual resource data is received, a virtual resource acquisition result is displayed according to the virtual resource acquisition instruction, and virtual resource confirmation information is generated and sent to the server side.
In an embodiment of the present disclosure, after receiving the virtual resource data, the client may present the virtual resource page according to the virtual resource data. In practical applications, after receiving the virtual resource data, the client may display the virtual resource page according to the virtual resource data at the start time point T1 of the target service or after the start time point T1 of the target service. Specifically, the determination may be made according to the time point when the client receives the virtual resource data. If the client receives the virtual resource data before the starting time point T1 of the target service, the virtual resource page can be displayed according to the virtual resource data at the starting time point T1 of the target service; if the client receives the virtual resource data at the starting time point T1 of the target service or after the starting time point T1 of the target service, the virtual resource page can be immediately displayed according to the virtual resource data, that is, the virtual resource page is displayed according to the virtual resource data after the starting time point T1 of the target service.
The user performs a virtual resource acquisition operation on the virtual resource data, for example, a click operation on a virtual resource page, at or after the start time point T1 of the target service. The client side responds to the virtual resource obtaining operation to generate a virtual resource obtaining instruction, then displays a virtual resource obtaining result according to the virtual resource obtaining instruction, and generates virtual resource confirmation information, wherein the virtual resource confirmation information can indicate that a user receives virtual resource data, and the virtual resource confirmation information can comprise identification information of the client side, identity information of the user, a current time point corresponding to the virtual resource obtaining instruction, a virtual resource theme, a virtual resource number, the number of virtual resources, the total number of virtual resources and the like.
In an exemplary embodiment of the present disclosure, in the performing of the step (a), the client may randomly select, when the current time point corresponding to the trigger instruction is equal to or before the start time point of the prefetched virtual resource, a time point between the start time point of the prefetched virtual resource and the start time point of the target service, and send the virtual resource request information to the server at the randomly selected time point. For example, if the current time point TC corresponding to the trigger instruction is before the start time point T0 of the prefetched virtual resource, a time point T3 is randomly selected between the start time point T0 of the prefetched virtual resource and the start time point T1 of the target service, and virtual resource request information is sent to the server at the time point T3.
In an exemplary embodiment of the present disclosure, in the performing of the step (iii), the client may randomly select the time point between the current time point corresponding to the trigger instruction and the time point obtained by adding the first period to the current time point corresponding to the trigger instruction when the current time point corresponding to the trigger instruction is equal to or after the start time point of the target service, and send the virtual resource request information to the server at the randomly selected time point. For example, if the current time point TC corresponding to the trigger instruction is located after the start time point T1 of the target service, a time point T5 is randomly selected between the current time point TC corresponding to the trigger instruction and a time point T4, and virtual resource request information is sent to the server at the time point T5, where the time point T4 is equal to the current time point TC corresponding to the trigger instruction plus the first time period R.
Fig. 2 is a flowchart illustrating another method for obtaining a virtual resource according to an exemplary embodiment, and as shown in fig. 2, the method for obtaining a virtual resource may be applied to a server side, and may specifically include the following steps.
In step S21, the configuration information of the target service is issued to the client.
In the embodiment of the disclosure, the server side may first receive the configuration information acquisition request of the client side, and then issue the configuration information of the target service according to the configuration information acquisition request, or may actively push the configuration information to the client side. The configuration information may include a starting time point of the prefetching virtual resource, a starting time point of the target service, a first time period, and the like. The starting time point of the prefetching virtual resource may be a time point before the starting time point of the target service, and the first time period may be a time period from a current time point corresponding to the virtual resource acquisition instruction received by the client to a current time point corresponding to the client displaying the virtual resource operation result. For example, the starting time point of the prefetching virtual resource is T0, the starting time point of the target service is T1, and the first time period is R. The starting time point T0 of the prefetch virtual resource is earlier than the starting time point T1 of the target service.
In step S22, virtual resource request information generated by the client according to the trigger instruction for the target service is received, and virtual resource data is returned to the client according to the virtual resource request information.
In an embodiment of the present disclosure, the virtual resource request information generated by the client may be sent to the server at different time points. For the description that the client transmits the virtual resource request information to the server at different time points, reference may be made to the description related to the above embodiment, which is not repeated herein.
In the embodiment of the disclosure, after receiving the virtual resource request information of the client, the server may allocate the number of virtual resources to the client according to the virtual resource request information and a preset virtual resource logic, and then generate virtual resource data according to the allocated number of virtual resources and return the virtual resource data to the client. In actual practice, virtual resource logic may include, but is not limited to: the proportion range of the number of virtual resources allocated by the client to the total number of virtual resources, the specific numerical range of the number of virtual resources allocated by the client, and the like, and the embodiments of the present disclosure do not specifically limit the content, the requirements, and the like of the virtual resource logic.
In step S23, virtual resource confirmation information returned by the client according to the virtual resource data is received.
In the embodiment of the present disclosure, after receiving the virtual resource acknowledgement information of the client, the server may generate a cache flag according to the virtual resource acknowledgement information, where the cache flag is used to record virtual resource data that is acquired by a user corresponding to the client in the current target service. Therefore, the server side can record the virtual resource data acquired by the client side according to the cache mark. After receiving the virtual resource confirmation information of the client, the server side can also generate a subscription message and send the subscription message to the database, and the database can record the number of virtual resources acquired in the current target service for the user corresponding to the client according to the subscription message. In practical applications, the subscription message may be a Kafka (a high throughput distributed publish-subscribe messaging system) message, or the like.
Based on the above description about the embodiments of the virtual resource acquisition method, a scheme for acquiring a high concurrency virtual resource with pre-fetching and then confirmation is described below, as shown in fig. 3, and fig. 3 is a schematic interaction flow diagram of the scheme for acquiring a high concurrency virtual resource with pre-fetching and then confirmation. Before the virtual resource obtains the service, the client sends a configuration information obtaining request to the server, and the server sends configuration information to the client according to the configuration information obtaining request. The configuration information may include a starting time point T0 of the prefetching virtual resource, a starting time point T1 of the target service, a time period R between a current time point corresponding to the virtual resource acquisition instruction and a current time point corresponding to the display virtual resource acquisition result, and the like.
The embodiments of the present disclosure will be described with reference to the case where a virtual resource is a red packet, and when the virtual resource is another service object, the acquisition scheme of the virtual resource may be executed with reference to the related content of the embodiments of the present disclosure. In an actual red packet acquisition service scene, most users enter a red packet acquisition service page to wait for red packets before the red packet acquisition service starts, and the peak flow of the red packet acquisition service is also the peak flow brought by the batch of users. If the request for obtaining the red packets of the batch of users can be scattered, the request peak value of the server side can be greatly reduced. Therefore, the client in the scheme can send the pre-fetching request (virtual resource request information) to the server side for a period of time before the red packet acquisition service starts, so that the server side can calculate how many red packets should be sent to the user for a period of time in advance, and create related databases and cache data.
When the user enters the packet acquisition service page at or before the start time T0 of the prefetched virtual resource, the client may randomly generate a time T3 between the start time T0 of the prefetched virtual resource and the start time T1 of the target service, and send a prefetch request to the server when reaching the time T3. After receiving the prefetch request, the server generates red packet data and returns the red packet data to the client.
When the user enters the red packet acquisition service page between the starting time point T0 of the prefetching virtual resource and the starting time point T1 of the target service, the client can immediately send a prefetching request to the server. After receiving the prefetch request, the server generates red packet data and returns the red packet data to the client.
When the user enters the red packet acquisition service page at the starting time point T1 of the target service or after the starting time point T1 of the target service, the client may randomly generate a time point T3 between the time points obtained from the current time points TC to tc+r, and when reaching the time point T3, send a prefetch request to the server. After receiving the prefetch request, the server generates red packet data and returns the red packet data to the client.
It should be noted that, in practical application, the actual time point T2 of displaying the red packet acquisition result on the client may be different for different users, which is affected by various aspects such as the network, the hardware of the client, and the resource of the server, so the following relationship exists: t0< T1< (T2-R) < T2. Wherein T2-R represents the current time point corresponding to the red packet acquisition instruction.
After the red packet acquisition service page is displayed on the client, the user can execute red packet acquisition operation on the red packet acquisition service page, so as to generate a red packet confirmation request (virtual resource confirmation information), and send the red packet confirmation request to the server. The server side can record how many red packets are acquired by each user according to the red packet confirmation request.
As shown in fig. 4, fig. 4 is a schematic diagram showing a relationship between a point of time when a user enters a red packet acquisition service page and a point of time when a prefetch request is transmitted. A user entering a red packet acquisition service page before a starting time point T0 of the prefetched virtual resource, wherein the time point of sending the prefetching request is a time point which is randomly generated and is positioned between the starting time point T0 of the prefetched virtual resource and a starting time point T1 of a target service; a user entering a red packet acquisition service page between a starting time point T0 of the prefetched virtual resource and a starting time point T1 of the target service, wherein the time for sending the prefetching request is the current time point entering the red packet acquisition service page; the user who enters the red packet acquisition service page after the start time point T1 of the target service sends the prefetch request at a time point between the start time point T1 of the target service, which is randomly generated, and the actual time point T2 at which the red packet acquisition result is displayed.
In the virtual resource obtaining scheme provided by the embodiment of the present disclosure, the client obtains, from the server, configuration information of a target service, where the target service is used to obtain the virtual resource, where the configuration information may include a start time point of prefetching the virtual resource, a start time point of the target service, and a first time period. And receiving a trigger instruction aiming at the target service, and generating virtual resource request information according to the trigger instruction. The client may send the virtual resource request information to the server at any one of the following three types of time points. And (I) when the current time point corresponding to the trigger instruction is equal to or before the starting time point of the prefetching virtual resource, sending virtual resource request information to the server at a time point between the starting time point of the prefetching virtual resource and the starting time point of the target service. And secondly, immediately sending virtual resource request information to the server after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching virtual resource and before the starting time point of the target service. And thirdly, when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, sending virtual resource request information to the server side at a time point between the current time point corresponding to the trigger instruction and the time point obtained by adding the first time period to the current time point corresponding to the trigger instruction. The server side returns virtual resource data to the client side according to the virtual resource request information, and the client side displays a virtual resource acquisition result according to a virtual resource acquisition instruction aiming at the virtual resource data, generates and sends virtual resource confirmation information to the server side.
The client can send virtual resource request information to the server at different time points, correspondingly, the server can receive the virtual resource request information at different time points, further virtual resource data can be generated at different time points, the server is prevented from being concentrated to receive a large amount of virtual resource request information at one time point, the server is prevented from being concentrated to generate a large amount of virtual resource data at one time point, the receiving processing of the virtual resource request information and the generating processing of the virtual resource data are performed at different time points, the system resource occupation amount of the server at the same time point is reduced, the operation pressure of the server is relieved, additional server hardware is not required to be added for coping with a large amount of virtual resource acquisition requests, meanwhile, the limitation of a large amount of virtual resource acquisition requests is not required, the failure of partial users in acquiring the virtual resource is avoided, and the success rate of acquiring the virtual resource is improved.
Embodiments of the present disclosure may set a time point T0 before a start time point T1 of a target service, that is, a start time point T0 of a prefetch virtual resource. Whether the user enters the virtual resource acquisition service page before the starting time point T0 of the prefetching virtual resource or enters the virtual resource acquisition service page between the starting time point T0 of the prefetching virtual resource and the starting time point T1 of the target service, or enters the virtual resource acquisition service page after the starting time point T1 of the target service, the prefetching request can be sent to the server, the server can allocate the number of virtual resources for the user entering the virtual resource acquisition service page at any time, and the problem that the virtual resource cannot be acquired due to the fact that the user enters the virtual resource acquisition service page too early or too late is avoided.
Fig. 5 is a block diagram illustrating a virtual resource acquisition apparatus 50 according to an exemplary embodiment. The apparatus 50 may be applied to a client, and the apparatus 50 may include the following modules in particular.
An obtaining module 51, configured to receive configuration information of a target service from a server, where the target service is used to obtain a virtual resource, where the configuration information includes a starting time point of prefetching the virtual resource, a starting time point of the target service, and a first time period, and the starting time point of prefetching the virtual resource is located before the starting time point of the target service;
a request module 52 configured to receive a trigger instruction for the target service and generate virtual resource request information according to the trigger instruction;
a sending module 53, configured to send the virtual resource request information to the server at a time point located between the start time point of prefetching the virtual resource and the start time point of the target service when the current time point corresponding to the trigger instruction is equal to or before the start time point of prefetching the virtual resource;
The sending module 53 is further configured to send the virtual resource request information to the server immediately after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching of the virtual resource and before the starting time point of the target service;
the sending module 53 is further configured to send the virtual resource request information to the server at a time point located between the current time point corresponding to the trigger instruction and a time point obtained by adding the first time period to the current time point corresponding to the trigger instruction when the current time point corresponding to the trigger instruction is equal to or after the start time point of the target service;
the obtaining module 51 is further configured to receive virtual resource data returned by the server according to the virtual resource request information;
the confirmation module 54 is configured to receive a virtual resource acquisition instruction for the virtual resource data, display a virtual resource acquisition result according to the virtual resource acquisition instruction, and generate and send virtual resource confirmation information to the server side;
The first time period represents a time period between a current time point corresponding to the virtual resource acquisition instruction and a current time point corresponding to the display virtual resource acquisition result.
In an exemplary embodiment of the present disclosure, the sending module 53 is configured to, when the current time point corresponding to the trigger instruction is equal to or before the start time point of prefetching the virtual resource, randomly select an obtained time point between the start time point of prefetching the virtual resource and the start time point of the target service, and send the virtual resource request information to the server at the randomly selected time point.
In an exemplary embodiment of the present disclosure, the sending module 53 is configured to, when the current time point corresponding to the trigger instruction is equal to or after the start time point of the target service, randomly select a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the current time point corresponding to the trigger instruction to the first period, and send the virtual resource request information to the server at the randomly selected time point.
In an exemplary embodiment of the present disclosure, the virtual resource data includes at least one of: virtual resource theme, virtual resource number.
Fig. 6 is a block diagram illustrating another virtual resource acquisition apparatus 60 according to an exemplary embodiment. The apparatus 60 may be applied to a server side, and the apparatus 60 may include the following modules.
A delivering module 61, configured to deliver configuration information of a target service to a client, where the configuration information includes a starting time point of prefetching the virtual resource, a starting time point of the target service, and a first time period, and the starting time point of prefetching the virtual resource is located before the starting time point of the target service;
a receiving module 62, configured to receive virtual resource request information generated by the client according to a trigger instruction for the target service, where the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is equal to or before a start time point of the prefetching the virtual resource, and is sent to the server end at a time point between the start time point of the prefetching the virtual resource and a start time point of the target service, or the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is after the start time point of the prefetching the virtual resource and before the start time point of the target service, or the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is equal to or after the start time point of the target service, and is added to the first time period between the current time point corresponding to the trigger instruction and the start time point of the target service;
A response module 63 configured to return virtual resource data to the client according to the virtual resource request information;
the receiving module 62 is further configured to receive virtual resource confirmation information returned by the client according to the virtual resource data;
the first time period represents a time period from a current time point corresponding to the virtual resource obtaining instruction received by the client to a current time point corresponding to the display virtual resource obtaining result of the client.
In an exemplary embodiment of the present disclosure, the response module 63 includes:
the quantity allocation module is configured to allocate virtual resource quantity according to the virtual resource request information and preset virtual resource logic;
and the virtual resource return module is configured to generate the virtual resource data according to the number of the virtual resources and return the virtual resource data to the client.
In an exemplary embodiment of the present disclosure, the apparatus further comprises:
and the marking module is configured to generate a cache mark according to the virtual resource confirmation information after the receiving module 62 receives the virtual resource confirmation information returned by the client according to the virtual resource data, and record that the client has acquired the virtual resource data according to the cache mark.
In an exemplary embodiment of the present disclosure, the apparatus further comprises:
and the subscription module is configured to generate a subscription message after the marking module generates a cache mark according to the virtual resource confirmation information, and send the subscription message to a database, wherein the database is used for recording the number of the virtual resources of the client according to the subscription message.
Embodiments of the present disclosure also provide a system for obtaining a virtual resource, where the system may include a client and a server, where the client may include a device for obtaining a virtual resource 50 as shown in fig. 5, and the server may include a device for obtaining a virtual resource 60 as shown in fig. 6.
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. 7 is a block diagram of an electronic device 700 for virtual resource acquisition, according to an example embodiment. For example, the electronic device 700 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. 7, an electronic device 700 may include one or more of the following components: a processing component 702, a memory 704, a power component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and a communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or part of the steps of the virtual resource acquisition method described above. Further, the processing component 702 can include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, images, video, and so forth. The memory 704 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 706 provides power to the various components of the electronic device 700. Power supply components 706 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for electronic device 700.
The multimedia component 708 includes a screen between the electronic device 700 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 708 includes a front-facing camera and/or a rear-facing camera. When the electronic device 700 is in an operational mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 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 704 or transmitted via the communication component 716. In some embodiments, the audio component 710 further includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 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 714 includes one or more sensors for providing status assessment of various aspects of the electronic device 700. For example, the sensor assembly 714 may detect an on/off state of the electronic device 700, a relative positioning of the components, such as a display and keypad of the electronic device 700, a change in position of the electronic device 700 or a component of the electronic device 700, the presence or absence of a user's contact with the electronic device 700, an orientation or acceleration/deceleration of the electronic device 700, and a change in temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 714 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 714 may also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate communication between the electronic device 700 and other devices, either wired or wireless. The electronic device 700 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 716 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 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 electronic device 700 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 above-described method of obtaining virtual resources.
In an exemplary embodiment, a storage medium is also provided, such as a memory 704 including instructions executable by the processor 720 of the electronic device 700 to perform the virtual resource acquisition method described above. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising readable program code executable by the processor 720 of the electronic device 700 to perform the above-described method of obtaining virtual resources. Alternatively, the program code may be stored in a storage medium of the electronic device 700, which may be a non-transitory computer readable storage medium, such as ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Fig. 8 is a block diagram illustrating an electronic device 800 for acquiring virtual resources, according to an example embodiment. For example, the electronic device 800 may be provided as a server. Referring to fig. 8, the electronic device 800 includes a processing component 822 that further includes one or more processors and memory resources, represented by memory 832, for storing instructions, such as application programs, executable by the processing component 822. The application programs stored in memory 832 may include one or more modules each corresponding to a set of instructions. Further, the processing component 822 is configured to execute instructions to perform the virtual resource acquisition method described above.
The electronic device 800 may also include a power component 826 configured to perform power management of the electronic device 800, a wired or wireless network interface 850 configured to connect the electronic device 800 to a network, and an input-output (I/O) interface 858. The electronic device 800 may operate based on an operating system stored in the memory 832, such as Windows Server, mac OS XTM, unixTM, linuxTM, freeBSDTM, or the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (19)

1. The method for obtaining the virtual resource is characterized by being applied to a client, and comprises the following steps:
receiving configuration information of a target service from a server, wherein the target service is used for acquiring a virtual resource, the configuration information comprises a starting time point of prefetching the virtual resource, a starting time point of the target service and a first time period, and the starting time point of prefetching the virtual resource is positioned before the starting time point of the target service;
receiving a trigger instruction aiming at the target service, and generating virtual resource request information according to the trigger instruction;
when the current time point corresponding to the trigger instruction is equal to or before the starting time point of prefetching the virtual resource, sending the virtual resource request information to the server side at a time point between the starting time point of prefetching the virtual resource and the starting time point of the target service;
immediately sending the virtual resource request information to the server after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching of the virtual resource and before the starting time point of the target service;
When the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, sending the virtual resource request information to the server side at a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the first time period to the current time point corresponding to the trigger instruction;
receiving virtual resource data returned by the server side according to the virtual resource request information;
receiving a virtual resource acquisition instruction aiming at the virtual resource data, displaying a virtual resource acquisition result according to the virtual resource acquisition instruction, generating and sending virtual resource confirmation information to the server side;
the first time period represents a time period between a current time point corresponding to the virtual resource acquisition instruction and a current time point corresponding to the display virtual resource acquisition result.
2. The method according to claim 1, wherein when the current time point corresponding to the trigger instruction is equal to or before the start time point of prefetching the virtual resource, sending virtual resource request information to the server at a time point between the start time point of prefetching the virtual resource and the start time point of the target service, includes:
When the current time point corresponding to the trigger instruction is equal to or before the starting time point of prefetching the virtual resource, randomly selecting an obtained time point between the starting time point of prefetching the virtual resource and the starting time point of the target service, and sending the virtual resource request information to the server side at the randomly selected time point.
3. The method according to claim 1, wherein when the current time point corresponding to the trigger instruction is equal to or after the start time point of the target service, sending the virtual resource request information to the server at a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the first time period to the current time point corresponding to the trigger instruction, includes:
and when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, randomly selecting a time point between the current time point corresponding to the trigger instruction and the time point obtained by adding the first time period to the current time point corresponding to the trigger instruction, and sending the virtual resource request information to the server side at the time point obtained by random selection.
4. A method according to any one of claims 1 to 3, wherein the virtual resource data comprises at least one of: virtual resource theme, virtual resource number.
5. The method for obtaining the virtual resource is characterized by being applied to a server side, and comprises the following steps:
the method comprises the steps of issuing configuration information of a target service to a client, wherein the configuration information comprises a starting time point of prefetching the virtual resource, a starting time point of the target service and a first time period, and the starting time point of prefetching the virtual resource is positioned before the starting time point of the target service;
receiving virtual resource request information generated by the client according to a trigger instruction for the target service, wherein the virtual resource request information is sent to the server end by the client when the current time point corresponding to the trigger instruction is equal to the starting time point of the prefetching of the virtual resource or before the starting time point of the prefetching of the virtual resource, and is sent to the server end at the time point between the starting time point of the prefetching of the virtual resource and the starting time point of the target service, or the virtual resource request information is sent to the server end by the client when the current time point corresponding to the trigger instruction is after the starting time point of the prefetching of the virtual resource and before the starting time point of the target service, or the virtual resource request information is sent to the server end by the client when the current time point corresponding to the trigger instruction is equal to the starting time point of the target service or after the starting time point of the target service, and is added with the first time period between the current time point corresponding to the trigger instruction and the first time point corresponding to the current time point of the trigger instruction;
Returning virtual resource data to the client according to the virtual resource request information;
receiving virtual resource confirmation information returned by the client according to the virtual resource data;
the first time period represents a time period from a current time point corresponding to the virtual resource obtaining instruction received by the client to a current time point corresponding to the display virtual resource obtaining result of the client.
6. The method of claim 5, wherein the returning virtual resource data to the client according to the virtual resource request information comprises:
distributing virtual resource quantity according to the virtual resource request information and preset virtual resource logic;
and generating the virtual resource data according to the number of the virtual resources, and returning the virtual resource data to the client.
7. The method of claim 5, wherein after receiving virtual resource confirmation information returned by the client according to the virtual resource data, the method further comprises:
generating a cache mark according to the virtual resource confirmation information, and recording that the client side has acquired the virtual resource data according to the cache mark.
8. The method of claim 7, wherein after the generating a cache tag from the virtual resource confirmation information, the method further comprises:
and generating a subscription message, and sending the subscription message to a database, wherein the database is used for recording the number of virtual resources of the client according to the subscription message.
9. An apparatus for obtaining a virtual resource, applied to a client, the apparatus comprising:
an acquisition module configured to receive configuration information of a target service from a server, the target service being used for acquiring a virtual resource, the configuration information including a start time point of prefetching the virtual resource, a start time point of the target service, and a first time period, the start time point of prefetching the virtual resource being located before the start time point of the target service;
the request module is configured to receive a trigger instruction aiming at the target service and generate virtual resource request information according to the trigger instruction;
a sending module, configured to send the virtual resource request information to the server at a time point located between the start time point of prefetching the virtual resource and the start time point of the target service when the current time point corresponding to the trigger instruction is equal to or before the start time point of prefetching the virtual resource;
The sending module is further configured to send the virtual resource request information to the server immediately after the current time point corresponding to the trigger instruction is at the starting time point of the prefetching of the virtual resource and before the starting time point of the target service;
the sending module is further configured to send the virtual resource request information to the server at a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the first time period to the current time point corresponding to the trigger instruction when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service;
the acquisition module is further configured to receive virtual resource data returned by the server side according to the virtual resource request information;
the confirmation module is configured to receive a virtual resource acquisition instruction aiming at the virtual resource data, display a virtual resource acquisition result according to the virtual resource acquisition instruction, and generate and send virtual resource confirmation information to the server side;
the first time period represents a time period between a current time point corresponding to the virtual resource acquisition instruction and a current time point corresponding to the display virtual resource acquisition result.
10. The apparatus according to claim 9, wherein the sending module is configured to, when a current time point corresponding to the trigger instruction is equal to or before a start time point of the prefetching of the virtual resource, randomly select an obtained time point between the start time point of the prefetching of the virtual resource and the start time point of the target service, and send the virtual resource request information to the server at the randomly selected time point.
11. The apparatus according to claim 9, wherein the sending module is configured to, when the current time point corresponding to the trigger instruction is equal to or after the start time point of the target service, randomly select a time point between the current time point corresponding to the trigger instruction and a time point obtained by adding the first period to the current time point corresponding to the trigger instruction, and send the virtual resource request information to the server at the randomly selected time point.
12. The apparatus according to any one of claims 9 to 11, wherein the virtual resource data comprises at least one of: virtual resource theme, virtual resource number.
13. The device for acquiring the virtual resource is characterized by being applied to a server side, and comprises:
the system comprises a delivery module, a target service and a client, wherein the delivery module is configured to deliver configuration information of the target service to the client, the configuration information comprises a starting time point of prefetching the virtual resource, a starting time point of the target service and a first time period, and the starting time point of prefetching the virtual resource is positioned before the starting time point of the target service;
a receiving module, configured to receive virtual resource request information generated by the client according to a trigger instruction for the target service, where the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is equal to a start time point of the prefetching of the virtual resource or before the start time point of the prefetching of the virtual resource, and is sent to the server end at a time point between the start time point of the prefetching of the virtual resource and the start time point of the target service, or the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is after the start time point of the prefetching of the virtual resource and before the start time point of the target service, or the virtual resource request information is sent to the server end by the client when a current time point corresponding to the trigger instruction is equal to a start time point of the target service or after the start time point of the target service, and is added with the first time period corresponding to the trigger instruction;
The response module is configured to return virtual resource data to the client according to the virtual resource request information;
the receiving module is further configured to receive virtual resource confirmation information returned by the client according to the virtual resource data;
the first time period represents a time period from a current time point corresponding to the virtual resource obtaining instruction received by the client to a current time point corresponding to the display virtual resource obtaining result of the client.
14. The apparatus of claim 13, wherein the response module comprises:
the quantity allocation module is configured to allocate virtual resource quantity according to the virtual resource request information and preset virtual resource logic;
and the virtual resource return module is configured to generate the virtual resource data according to the number of the virtual resources and return the virtual resource data to the client.
15. The apparatus of claim 13, wherein the apparatus further comprises:
the marking module is configured to generate a cache mark according to the virtual resource confirmation information after the receiving module receives the virtual resource confirmation information returned by the client according to the virtual resource data, and record that the client has acquired the virtual resource data according to the cache mark.
16. The apparatus of claim 15, wherein the apparatus further comprises:
and the subscription module is configured to generate a subscription message after the marking module generates a cache mark according to the virtual resource confirmation information, and send the subscription message to a database, wherein the database is used for recording the number of the virtual resources of the client according to the subscription message.
17. A virtual resource acquisition system, comprising a client and a server, wherein the client comprises the virtual resource acquisition device according to any one of claims 9 to 12; the server side comprises the virtual resource acquisition device according to any one of claims 13 to 16.
18. 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 virtual resource acquisition of any one of claims 1 to 8.
19. A storage medium, characterized in that instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the virtual resource acquisition method of any one of claims 1 to 8.
CN202010791061.XA 2020-08-07 2020-08-07 Method, device and system for acquiring virtual resources, electronic equipment and storage medium Active CN112035246B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010791061.XA CN112035246B (en) 2020-08-07 2020-08-07 Method, device and system for acquiring virtual resources, electronic equipment and storage medium
PCT/CN2021/111305 WO2022028607A1 (en) 2020-08-07 2021-08-06 Virtual resource acquisition method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010791061.XA CN112035246B (en) 2020-08-07 2020-08-07 Method, device and system for acquiring virtual resources, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112035246A CN112035246A (en) 2020-12-04
CN112035246B true CN112035246B (en) 2023-12-19

Family

ID=73582815

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010791061.XA Active CN112035246B (en) 2020-08-07 2020-08-07 Method, device and system for acquiring virtual resources, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN112035246B (en)
WO (1) WO2022028607A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112035246B (en) * 2020-08-07 2023-12-19 北京达佳互联信息技术有限公司 Method, device and system for acquiring virtual resources, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107657471A (en) * 2016-09-22 2018-02-02 腾讯科技(北京)有限公司 A kind of methods of exhibiting of virtual resource, client and plug-in unit
US9992139B1 (en) * 2013-09-27 2018-06-05 Amazon Technologies, Inc. Virtualized computing resource scheduler
CN110704190A (en) * 2019-09-29 2020-01-17 腾讯科技(深圳)有限公司 Virtual resource processing method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120232974A1 (en) * 2011-03-10 2012-09-13 Tony Castiglione System and Method of Distributing a Coupon
CN108804133B (en) * 2018-06-12 2022-04-08 深圳华讯网络科技有限公司 Method, system, computer device and storage medium for acquiring virtual resources
CN112035246B (en) * 2020-08-07 2023-12-19 北京达佳互联信息技术有限公司 Method, device and system for acquiring virtual resources, electronic equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9992139B1 (en) * 2013-09-27 2018-06-05 Amazon Technologies, Inc. Virtualized computing resource scheduler
CN107657471A (en) * 2016-09-22 2018-02-02 腾讯科技(北京)有限公司 A kind of methods of exhibiting of virtual resource, client and plug-in unit
CN110704190A (en) * 2019-09-29 2020-01-17 腾讯科技(深圳)有限公司 Virtual resource processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112035246A (en) 2020-12-04
WO2022028607A1 (en) 2022-02-10

Similar Documents

Publication Publication Date Title
CN113099249B (en) Live broadcasting room object recommendation method and device, server and electronic equipment
CN112416219B (en) Target object processing method, device and system, electronic equipment and storage medium
CN109413157B (en) Message shielding method and device
CN108153832B (en) Push information display method and device
CN112291631A (en) Information acquisition method, device, terminal and storage medium
CN111756820A (en) Access processing method and device, electronic equipment and storage medium
CN112035246B (en) Method, device and system for acquiring virtual resources, electronic equipment and storage medium
CN110690979B (en) Group message processing method, device, server, client and storage medium
CN110908814A (en) Message processing method and device, electronic equipment and storage medium
CN109245992B (en) Request processing method and device, electronic equipment and storage medium
CN114339320B (en) Virtual resource processing method, device, equipment and storage medium
CN113099307B (en) Data interaction method and device, electronic equipment and storage medium
CN112291581B (en) Server, terminal equipment, information processing method and device
CN115499438A (en) Task allocation method and device, electronic equipment and storage medium
EP3001660B1 (en) Method, device and system for telephone interaction
CN113709572A (en) Content promotion method and device, electronic equipment and storage medium
CN112102009A (en) Advertisement display method, device, equipment and storage medium
CN107257384B (en) Service state monitoring method and device
CN107241432B (en) Message receiving method and device, electronic equipment and computer storage medium
CN111724398A (en) Image display method and device
CN112462996B (en) Service information optimizing method, service information optimizing device and storage medium
CN112685061B (en) Access method and device
CN111262882B (en) User type limiting application method, device and storage medium in instant messaging
CN112182027B (en) Information query method, device, electronic equipment and storage medium
CN111625536B (en) Data access method and device

Legal Events

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