CN112035246A - 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
CN112035246A
CN112035246A CN202010791061.XA CN202010791061A CN112035246A CN 112035246 A CN112035246 A CN 112035246A CN 202010791061 A CN202010791061 A CN 202010791061A CN 112035246 A CN112035246 A CN 112035246A
Authority
CN
China
Prior art keywords
time point
virtual resource
target service
server
prefetching
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.)
Granted
Application number
CN202010791061.XA
Other languages
Chinese (zh)
Other versions
CN112035246B (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

Images

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 acquiring virtual resources, wherein the method comprises the following steps: receiving configuration information of a target service for acquiring virtual resources from a server side; sending virtual resource request information to a server at different time points; receiving virtual resource data returned by the server according to the virtual resource request information; and displaying the virtual resource acquisition result according to the virtual resource acquisition instruction, and generating and sending virtual resource confirmation information to the server side. According to the method and the device, the receiving processing of the virtual resource request information and the generating processing of the virtual resource data are dispersedly executed at different time points, the system resource occupation amount of the server is reduced, the operating pressure of the server is relieved, extra server hardware is not required to be added, the flow limitation of the virtual resource acquisition request is not required, and the acquisition success rate of the virtual resource is improved.

Description

Method, device and system for acquiring virtual resources, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a system, an electronic device, and a storage medium for acquiring virtual resources.
Background
In the process of acquiring virtual resources, if there are a great number of users participating in the virtual resources and the virtual resources are acquired at a certain time point, a very high amount of concurrent acquisition of the virtual resources may occur, resulting in a huge occupation of system resources at the server side.
In the related art, the problem of a large amount of concurrent acquisition of virtual resources is generally dealt with as follows. In the first mode, the traffic of the user is limited to protect the server, so as to prevent the system resource of the server from being overloaded. And if the flow of the virtual resource request exceeds the flow which can be borne by the server, returning response information of failure in acquiring the virtual resource to the part of the request which exceeds the flow which can be borne. And in the second mode, the hardware of the server is upgraded to improve the flow which can be borne by the server.
However, the method may result in that some users cannot acquire the virtual resources, and the success rate of acquiring the virtual resources is not high; the second method will increase the cost of the server.
Disclosure of Invention
The present disclosure provides a method, an apparatus, a system, an electronic device, and a storage medium for acquiring virtual resources, so as to at least solve the problems in the related art that the success rate of acquiring virtual resources is not high and the hardware cost of a server is high. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for acquiring a virtual resource is provided, which is applied to a client, and the method includes: 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 for prefetching the virtual resource, the starting time point of the target service and a first time period, and the starting time point for 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 the virtual resource prefetching, sending the virtual resource request information to the server end at a time point between the starting time point of the virtual resource prefetching and the starting time point of the target service; when the current time point corresponding to the trigger instruction is after the starting time point of the virtual resource prefetching and before the starting time point of the target service, the virtual resource request information is immediately sent to the server side; 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 end 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 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, and generating and sending virtual resource confirmation information to the server side; and the first time period represents a time period from a current time point corresponding to the virtual resource acquisition instruction to a current time point corresponding to a virtual resource acquisition result.
Optionally, 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 the virtual resource prefetching, randomly selecting a time point between the starting time point of the virtual resource prefetching 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, the 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 and the first time period includes: and when the current time point corresponding to the trigger instruction is equal to or behind the starting time point of the target service, randomly selecting the current time point corresponding to the trigger instruction and the current time point corresponding to the trigger instruction plus the time point obtained by the first time period to obtain the time point, and sending the virtual resource request information to the server side at the randomly selected time point.
Optionally, the virtual resource data includes at least one of: virtual resource theme, virtual resource number, virtual resource quantity.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for acquiring a virtual resource, which is applied to a server side, the method including: issuing configuration information of a target service to a client, wherein the configuration information comprises a starting time point for prefetching the virtual resource, the starting time point of the target service and a first time period, and the starting time point for 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 at a time point 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 the start time point of prefetching the virtual resource or before the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server immediately when the current time point corresponding to the trigger instruction is after the start time point of 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 when the current time point corresponding to the trigger instruction is equal to the start time point of the target service Or when the time point is after the starting time point of the target service, sending the 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 to the server; 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 a virtual resource acquisition instruction received by the client to a current time point corresponding to a virtual resource acquisition result displayed by the client.
Optionally, the returning virtual resource data to the client according to the virtual resource request information includes: allocating the quantity of virtual resources according to the virtual resource request information and preset virtual resource logic; and generating the virtual resource data according to the quantity of the virtual resources, and returning the virtual resource data to the client.
Optionally, after the receiving the virtual resource confirmation information returned by the client according to the virtual resource data, the method further includes: and 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 confirmation 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 virtual resource quantity 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 acquiring a virtual resource, which is applied to a client, the apparatus including: an obtaining module, configured to receive configuration information of a target service from a server, where the target service is used to obtain a virtual resource, and the configuration information includes a start time point for prefetching the virtual resource, a start time point for the target service, and a first time period, where the start time point for prefetching the virtual resource is located before the start time point for 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 a 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 side immediately after the start time point of the prefetching of the virtual resource and before the start time point of the target service at the current time point corresponding to the trigger instruction; 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 obtaining module is further configured to receive virtual resource data returned by the server according to the virtual resource request information; the confirmation module 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; and the first time period represents a time period from a current time point corresponding to the virtual resource acquisition instruction to a current time point corresponding to a virtual resource acquisition result.
Optionally, the sending module is configured to, when a current time point corresponding to the trigger instruction is equal to or before the starting time point of prefetching the virtual resource, randomly select a time point between the starting time point of prefetching the virtual resource and 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 sending module is configured to, when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, randomly select 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 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, virtual resource quantity.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an apparatus for acquiring a virtual resource, which is applied to a server side, the apparatus including: the issuing module is configured to issue configuration information of a target service to a client, wherein the configuration information includes a starting time point for prefetching the virtual resource, the starting time point of the target service and a first time period, and the starting time point for prefetching the virtual resource is located 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 at a time point between a start time point of prefetching the virtual resource and a start time point of the target service when the current time point corresponding to the trigger instruction is equal to the start time point of prefetching the virtual resource or before the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server immediately after the start time point of prefetching the virtual resource and before the start time point of the target service when the current time point corresponding to the trigger instruction is after the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server immediately when the current time point corresponding to the trigger instruction is equal to the target service When the starting time point of the target service is the starting time point of the target service or after the starting time point of the target service, the 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 is sent to the server end; a response module 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 a virtual resource acquisition instruction received by the client to a current time point corresponding to a virtual resource acquisition result displayed by the client.
Optionally, the response module includes: the quantity distribution module is configured to distribute the quantity of the virtual resources according to the virtual resource request information and preset virtual resource logic; and the virtual resource returning 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: and 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 the embodiments 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 includes the apparatus for acquiring virtual resources according to the fourth aspect.
According to a sixth aspect of an embodiment of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method for acquiring a virtual resource according to the first aspect or the second aspect.
According to a seventh aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein instructions of the storage medium, when executed by a processor of an electronic device, enable the electronic device to execute the method for acquiring a virtual resource according to the first aspect or the 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 for acquiring a virtual resource according to the first or second aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the scheme for acquiring virtual resources provided by the embodiment of the present disclosure, a client acquires configuration information of a target service from a server, where the target service is used to acquire virtual resources, and the configuration information may include a start time point of prefetching a 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 can 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 prefetching the virtual resource, sending the virtual resource request information to the server end at a time point between the starting time point of prefetching the virtual resource and the starting time point of the target service. And (II) immediately sending the virtual resource request information to the server side when the current time point corresponding to the trigger instruction is after the starting time point of the virtual resource prefetching 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 behind the starting time point of the target service, sending the virtual resource request information to the server end 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. The server side returns virtual resource data to the client side according to the virtual resource request information, the client side displays a virtual resource obtaining result according to a virtual resource obtaining instruction aiming at the virtual resource data, and virtual resource confirmation information is generated and sent to the server side.
The client can send the virtual resource request information to the server at different time points, correspondingly, the server receives the virtual resource request information at different time points, and further can generate virtual resource data at different time points, thereby avoiding the server from receiving a large amount of virtual resource request information at one time point in a centralized way and also avoiding the server from generating a large amount of virtual resource data at one time point in a centralized way, dispersing the receiving processing of the virtual resource request information and the generating processing of the virtual resource data to be executed at different time points, reducing the system resource occupation amount of the server at the same time point, relieving the operating pressure of the server, not needing to add extra server-end hardware for responding to a large amount of virtual resource acquisition requests, simultaneously, not needing to limit the flow of the large amount of virtual resource acquisition requests and avoiding the failure of partial users to acquire the virtual resources, the success rate of acquiring the virtual resources 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 present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a flowchart illustrating a method for acquiring a virtual resource according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating another method for acquiring virtual resources in accordance with an example embodiment.
FIG. 3 is an interaction flow diagram illustrating a prefetch before acknowledge high concurrency virtual resource acquisition scheme in accordance with an exemplary embodiment.
Fig. 4 is a diagram illustrating a relationship between a point in time when a user enters a red envelope fetch service activity page and a point in time when a prefetch request is sent, according to an example embodiment.
Fig. 5 is a block diagram illustrating an apparatus for acquiring a virtual resource according to an example embodiment.
Fig. 6 is a block diagram illustrating another apparatus for acquiring virtual resources according to an example embodiment.
FIG. 7 is a block diagram illustrating an electronic device for acquiring virtual resources in accordance with an exemplary embodiment.
FIG. 8 is a block diagram illustrating an electronic device for acquiring virtual resources in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a method for acquiring a virtual resource according to an exemplary embodiment, where as shown in fig. 1, the method for acquiring a virtual resource may be applied to a client, and specifically may include the following steps.
In step S11, configuration information of the target service is received from the server side.
In an embodiment of the present disclosure, the target service may be used for the client to acquire the virtual resource. The server may set configuration information in advance for the target service, where the configuration information may include a start time point of prefetching the virtual resource, a start time point and a first time period of the target service, and the like. The starting time point of prefetching the 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 obtaining instruction to a current time point corresponding to 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 start time point T0 of prefetching the virtual resource is earlier than the start time point T1 of the target traffic.
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.
In the embodiment of the disclosure, the user may execute a trigger operation for the target service on the client, where the trigger operation may be understood as a preparation operation before acquiring the virtual resource, for example, an operation of the user entering an operation page of the target service may be the trigger operation. The triggering operation of the user can be responded to generate a triggering instruction, and the virtual resource request information is generated according to the triggering 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.
In the embodiment of the disclosure, the client may send the virtual resource request information to the server at different time points. Specifically, the following time points for sending the virtual resource request information may be included:
and (I) 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 end at a time point between the starting time point of prefetching the virtual resource and the starting time point of the target service.
For example, if the current time point TC corresponding to the trigger command is before the start time point T0 of prefetching the virtual resource, the virtual resource request message is sent to the server at a time point T3 between the start time point T0 of prefetching the virtual resource and the start time point T1 of the target service.
And (II) immediately sending the virtual resource request information to the server side when the current time point corresponding to the trigger instruction is after the starting time point of the virtual resource prefetching 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 start time point T0 of prefetching the virtual resource and the start time point T1 of the target service, the virtual resource request information is immediately sent to the server, which can be understood as sending the virtual resource request information 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 behind the starting time point of the target service, sending the virtual resource request information to the server end 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.
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, the virtual resource data returned by the server 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. The virtual resource data may include at least one of: virtual resource theme, virtual resource number, virtual resource quantity, virtual resource total quantity, and the like.
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.
In an embodiment of the present disclosure, after receiving the virtual resource data, the client may display the virtual resource page according to the virtual resource data. In practical applications, after receiving the virtual resource data, the client may expose the virtual resource page according to 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 specific time point may be determined according to the time point when the client receives the virtual resource data. If the client receives the virtual resource data before the start time point T1 of the target service, the virtual resource page may be displayed according to the virtual resource data at the start 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 may be immediately displayed according to the virtual resource data, that is, the virtual resource page may be 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 with respect to a virtual resource page, at the start time point T1 of the target service or after the start time point T1 of the target service. The client responds to the virtual resource acquisition operation to generate a virtual resource acquisition instruction, displays a virtual resource acquisition result according to the virtual resource acquisition instruction, and generates virtual resource confirmation information, wherein the virtual resource confirmation information can indicate that the user receives virtual resource data, and the virtual resource confirmation information can include identification information of the client, identity information of the user, a current time point corresponding to the virtual resource acquisition instruction, a virtual resource theme, a virtual resource number, a virtual resource total number and the like.
In an exemplary embodiment of the disclosure, in the execution process of (a), 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 client may randomly select a 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. For example, if the current time point TC corresponding to the trigger instruction is before the start time point T0 of prefetching the virtual resource, a time point T3 is randomly selected between the start time point T0 of prefetching the virtual resource and the start time point T1 of the target service, and the virtual resource request information is sent to the server at the time point T3.
In an exemplary embodiment of the disclosure, in the execution process of the above (three), when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, the client may randomly select the obtained 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 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, the virtual resource request information is sent to the server at a time point T5 at a time point T5 randomly selected 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.
Fig. 2 is a flowchart illustrating another method for acquiring a virtual resource according to an exemplary embodiment, where as shown in fig. 2, the method for acquiring a virtual resource may be applied to a server, and specifically may include the following steps.
In step S21, the configuration information of the target service is sent to the client.
In the embodiment of the disclosure, the server may receive the configuration information acquisition request of the client, then issue the configuration information of the target service according to the configuration information acquisition request, and may also actively push the configuration information to the client. The configuration information may include a start time point of prefetching the virtual resource, a start time point and a first time period of the target service, and the like. The starting time point of the virtual resource prefetching 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 virtual resource operation result displayed by the client. 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 start time point T0 of prefetching the virtual resource is earlier than the start time point T1 of the target traffic.
In step S22, receiving virtual resource request information generated by the client according to the trigger instruction for the target service, and returning virtual resource data to the client according to the virtual resource request information.
In the 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 introduction that the client sends the virtual resource request information to the server at different time points, reference may be made to the relevant description in the foregoing embodiments, which is not described herein again.
In the embodiment of the present 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, then generate virtual resource data according to the allocated number of virtual resources, and return the virtual resource data to the client. In practical applications, the virtual resource logic may include, but is not limited to: the number of virtual resources allocated by the client accounts for the proportion range of the total number of virtual resources, the specific numerical range of the number of virtual resources allocated by the client, and the like.
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 confirmation information of the client, the server may generate a cache tag according to the virtual resource confirmation information, where the cache tag is used to record virtual resource data that has been 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. Moreover, after receiving the virtual resource confirmation information of the client, the server may further generate a subscription message and send the subscription message to the database, and the database may record, according to the subscription message, the number of virtual resources acquired in the current target service for the user corresponding to the client. In practical applications, the subscription message may be Kafka (a high throughput distributed publish-subscribe messaging system) message, and the like.
Based on the above description about the embodiment of the method for acquiring virtual resources, a prefetch-first and then acknowledge high-concurrency virtual resource acquisition scheme is described below, as shown in fig. 3, and fig. 3 is an interaction flow diagram illustrating the prefetch-first and then acknowledge high-concurrency virtual resource acquisition scheme. Before the virtual resource acquisition service, the client sends a configuration information acquisition request to the server, and the server issues configuration information to the client according to the configuration information acquisition request. The configuration information may include a start time point T0 of prefetching the virtual resource, a start time point T1 of the target service, a time period R from a current time point corresponding to the virtual resource acquisition instruction to a current time point corresponding to the virtual resource acquisition result.
The embodiment of the present disclosure takes the virtual resource as a red packet as an example for explanation, and when the virtual resource is another service object, the scheme for acquiring the virtual resource may be executed with reference to the relevant content of the embodiment of the present disclosure. In an actual red packet acquiring service scene, most users enter a red packet acquiring service page to wait for a red packet before the red packet acquiring service starts, and the peak flow of the red packet acquiring service is also the peak flow brought by the users. If the request of getting the red packet 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 at a time before the red packet acquisition service starts, so that the server can calculate the number of red packets to be sent to the user in advance at a time, and create a relevant database and cache data.
When the user enters the red packet acquiring service page at the start time point T0 of prefetching the virtual resource or before the start time point T0 of prefetching the virtual resource, the client may randomly generate a time point T3 between the start time point T0 of prefetching the virtual resource and the start time point T1 of the target service, and send a prefetch request to the server when the time point T3 is reached. And after receiving the pre-fetching request, the server generates red packet data and returns the red packet data to the client.
When the user enters the red envelope acquisition service page between the start time point T0 of prefetching the virtual resource and the start time point T1 of the target service, the client may immediately send a prefetch request to the server. And after receiving the pre-fetching request, the server generates red packet data and returns the red packet data to the client.
When the user enters the red envelope acquiring 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 point TC to TC + R, and send a prefetch request to the server when the time point T3 is reached. And after receiving the pre-fetching request, the server generates red packet data and returns the red packet data to the client.
It should be noted that, in practical application, under the influence of various aspects such as the network, the hardware of the client, the resource of the server, and the like, the actual time point T2 at which the red packet obtaining result is shown on the client may be different for different users, and therefore, 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 obtaining service page is displayed on the client, the user can execute the red packet obtaining operation aiming at the red packet obtaining service page, further 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 the number of red packages acquired by each user according to the red package confirmation request.
As shown in fig. 4, fig. 4 is a schematic diagram illustrating a relationship between a time point when a user enters a red envelope acquisition service page and a time point when a prefetch request is sent. A user entering a red envelope acquiring service page before a starting time point T0 of prefetching the virtual resource, wherein the time point of sending the prefetching request is a randomly generated time point between the starting time point T0 of prefetching the virtual resource and the starting time point T1 of the target service; entering a user of a red packet acquisition service page between a starting time point T0 of prefetching the virtual resource and a starting time point T1 of the target service, wherein the time of sending the prefetching request is the current time point of 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 randomly generated start time point T1 of the target service and the actual time point T2 at which the red packet acquisition result is presented.
In the scheme for acquiring virtual resources provided by the embodiment of the present disclosure, a client acquires configuration information of a target service from a server, where the target service is used to acquire virtual resources, and the configuration information may include a start time point of prefetching a 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 can 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 prefetching the virtual resource, sending the virtual resource request information to the server end at a time point between the starting time point of prefetching the virtual resource and the starting time point of the target service. And (II) immediately sending the virtual resource request information to the server side when the current time point corresponding to the trigger instruction is after the starting time point of the virtual resource prefetching 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 behind the starting time point of the target service, sending the virtual resource request information to the server end 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. The server side returns virtual resource data to the client side according to the virtual resource request information, the client side displays a virtual resource obtaining result according to a virtual resource obtaining instruction aiming at the virtual resource data, and virtual resource confirmation information is generated and sent to the server side.
The client can send the virtual resource request information to the server at different time points, correspondingly, the server receives the virtual resource request information at different time points, and further can generate virtual resource data at different time points, thereby avoiding the server from receiving a large amount of virtual resource request information at one time point in a centralized way and also avoiding the server from generating a large amount of virtual resource data at one time point in a centralized way, dispersing the receiving processing of the virtual resource request information and the generating processing of the virtual resource data to be executed at different time points, reducing the system resource occupation amount of the server at the same time point, relieving the operating pressure of the server, not needing to add extra server-end hardware for responding to a large amount of virtual resource acquisition requests, simultaneously, not needing to limit the flow of the large amount of virtual resource acquisition requests and avoiding the failure of partial users to acquire the virtual resources, the success rate of acquiring the virtual resources is improved.
The embodiment of the present disclosure may set a time point T0 before the start time point T1 of one target service, i.e., the start time point T0 of prefetching the virtual resource. Whether a user enters a virtual resource acquisition service page before the starting time point T0 of prefetching the virtual resource, or enters the virtual resource acquisition service page between the starting time point T0 of prefetching the 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, a prefetching request can be sent to the server side, the server side can allocate the number of virtual resources to 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 an apparatus 50 for acquiring a virtual resource according to an exemplary embodiment. The apparatus 50 may be applied to a client, and the apparatus 50 may specifically include the following modules.
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, and the configuration information includes a start time point for prefetching the virtual resource, a start time point for the target service, and a first time period, where the start time point for prefetching the virtual resource is before the start time point for 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 side immediately when the current time point corresponding to the trigger instruction is after the start time point of prefetching the virtual resource and before the start 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 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 obtaining module 51 is further configured to receive virtual resource data returned by the server according to the virtual resource request information;
a confirmation module 54 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;
and the first time period represents a time period from a current time point corresponding to the virtual resource acquisition instruction to a current time point corresponding to a virtual resource acquisition result.
In an exemplary embodiment of the disclosure, the sending module 53 is configured to, when a current time point corresponding to the trigger instruction is equal to or before the starting time point of prefetching the virtual resource, randomly select a time point between the starting time point of prefetching the virtual resource and the starting 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 disclosure, the sending module 53 is configured to, when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service, randomly select 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 send the virtual resource request information to the server at the randomly selected time point.
In an exemplary embodiment of the disclosure, the virtual resource data includes at least one of: virtual resource theme, virtual resource number, virtual resource quantity.
Fig. 6 is a block diagram illustrating another apparatus 60 for acquiring virtual resources according to an example embodiment. The apparatus 60 may be applied to a server side, and the apparatus 60 may specifically include the following modules.
An issuing module 61 configured to issue configuration information of a target service to a client, where the configuration information includes a start time point of prefetching the virtual resource, a start time point of the target service, and a first time period, and the start time point of prefetching the virtual resource is located before the start 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 at a time point 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 the start time point of prefetching the virtual resource or before the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server immediately after the start time point of prefetching the virtual resource and before the start time point of the target service when the current time point corresponding to the trigger instruction is after the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server when the current time point corresponding to the trigger instruction is equal to the current time point corresponding to the trigger instruction When the starting time point of the target service or after the starting time point of the target service, the 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 is sent to the server end;
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 a virtual resource acquisition instruction received by the client to a current time point corresponding to a virtual resource acquisition result displayed by the client.
In an exemplary embodiment of the present disclosure, the response module 63 includes:
the quantity distribution module is configured to distribute the quantity of the virtual resources according to the virtual resource request information and preset virtual resource logic;
and the virtual resource returning 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 includes:
and a marking module 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 includes:
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.
The embodiment of the present disclosure also provides a system for acquiring a virtual resource, which may include a client and a server, where the client may include an apparatus 50 for acquiring a virtual resource as shown in fig. 5, and the server may include an apparatus 60 for acquiring a virtual resource as shown in fig. 6.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 7 is a block diagram illustrating an electronic device 700 for acquiring virtual resources in accordance with an exemplary embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 7, 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 a portion of the steps of the above-described method for acquiring virtual resources. Further, the processing component 702 may 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, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile 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 disks.
The power supply component 706 provides power to the various components of the electronic device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700.
The multimedia component 708 includes a screen that provides an output interface between the electronic device 700 and a user. 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 an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect 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. The front camera and/or the rear camera may receive external multimedia data when the electronic device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
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 signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also 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 keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the electronic device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in the position of the electronic device 700 or a component of the electronic device 700, the presence or absence of user contact with the electronic device 700, orientation or acceleration/deceleration of the electronic device 700, and a change in the temperature of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured to detect the presence of a nearby object 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 gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. The electronic device 700 may access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G, or 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives a broadcast signal 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, micro-controllers, microprocessors or other electronic components for performing the above-described virtual resource acquisition method.
In an exemplary embodiment, a storage medium comprising instructions, such as the memory 704 comprising instructions, executable by the processor 720 of the electronic device 700 to perform the above-described method of acquiring a virtual resource is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, which comprises readable program code executable by the processor 720 of the electronic device 700 to perform the above-mentioned method of acquiring 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, for example, ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.
FIG. 8 is a block diagram illustrating an electronic device 800 for acquiring virtual resources in accordance with an example embodiment. For example, the electronic device 800 may be provided as a server. Referring to fig. 8, electronic device 800 includes a processing component 822, which further includes one or more processors, and memory resources, represented by memory 832, for storing instructions, such as applications, that are executable by processing component 822. The application programs stored in memory 832 may include one or more modules that each correspond to a set of instructions. Further, the processing component 822 is configured to execute instructions to perform the above-described method of acquiring virtual resources.
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 variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for acquiring virtual resources is applied to a client, and the method 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 for prefetching the virtual resource, the starting time point of the target service and a first time period, and the starting time point for 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 the virtual resource prefetching, sending the virtual resource request information to the server end at a time point between the starting time point of the virtual resource prefetching and the starting time point of the target service;
when the current time point corresponding to the trigger instruction is after the starting time point of the virtual resource prefetching and before the starting time point of the target service, the virtual resource request information is immediately sent to the server side;
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 end 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 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, and generating and sending virtual resource confirmation information to the server side;
and the first time period represents a time period from a current time point corresponding to the virtual resource acquisition instruction to a current time point corresponding to a 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 the virtual resource prefetching, sending virtual resource request information to the server at a time point between the start time point of the virtual resource prefetching and the start time point of the target service, comprises:
when the current time point corresponding to the trigger instruction is equal to or before the starting time point of the virtual resource prefetching, randomly selecting a time point between the starting time point of the virtual resource prefetching 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 the sending the virtual resource request message to the server at a time point located 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 when the current time point corresponding to the trigger instruction is equal to or after the starting time point of the target service comprises:
and when the current time point corresponding to the trigger instruction is equal to or behind the starting time point of the target service, randomly selecting the current time point corresponding to the trigger instruction and the current time point corresponding to the trigger instruction plus the time point obtained by the first time period to obtain the time point, and sending the virtual resource request information to the server side at the randomly selected time point.
4. The method according to any of claims 1 to 3, wherein the virtual resource data comprises at least one of: virtual resource theme, virtual resource number, virtual resource quantity.
5. A method for acquiring virtual resources is applied to a server side, and the method comprises the following steps:
issuing configuration information of a target service to a client, wherein the configuration information comprises a starting time point for prefetching the virtual resource, the starting time point of the target service and a first time period, and the starting time point for 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 at a time point 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 the start time point of prefetching the virtual resource or before the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server immediately when the current time point corresponding to the trigger instruction is after the start time point of 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 when the current time point corresponding to the trigger instruction is equal to the start time point of the target service Or when the time point is after the starting time point of the target service, sending the 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 to the server;
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 a virtual resource acquisition instruction received by the client to a current time point corresponding to a virtual resource acquisition result displayed by the client.
6. An apparatus for acquiring a virtual resource, applied to a client, the apparatus comprising:
an obtaining module, configured to receive configuration information of a target service from a server, where the target service is used to obtain a virtual resource, and the configuration information includes a start time point for prefetching the virtual resource, a start time point for the target service, and a first time period, where the start time point for prefetching the virtual resource is located before the start time point for 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 a 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 side immediately after the start time point of the prefetching of the virtual resource and before the start time point of the target service at the current time point corresponding to the trigger instruction;
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 obtaining module is further configured to receive virtual resource data returned by the server according to the virtual resource request information;
the confirmation module 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;
and the first time period represents a time period from a current time point corresponding to the virtual resource acquisition instruction to a current time point corresponding to a virtual resource acquisition result.
7. An apparatus for acquiring virtual resources, applied to a server, the apparatus comprising:
the issuing module is configured to issue configuration information of a target service to a client, wherein the configuration information includes a starting time point for prefetching the virtual resource, the starting time point of the target service and a first time period, and the starting time point for prefetching the virtual resource is located 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 at a time point between a start time point of prefetching the virtual resource and a start time point of the target service when the current time point corresponding to the trigger instruction is equal to the start time point of prefetching the virtual resource or before the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server immediately after the start time point of prefetching the virtual resource and before the start time point of the target service when the current time point corresponding to the trigger instruction is after the start time point of prefetching the virtual resource, or the virtual resource request information is sent to the server immediately when the current time point corresponding to the trigger instruction is equal to the target service When the starting time point of the target service is the starting time point of the target service or after the starting time point of the target service, the 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 is sent to the server end;
a response module 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 a virtual resource acquisition instruction received by the client to a current time point corresponding to a virtual resource acquisition result displayed by the client.
8. A virtual resource acquisition system, comprising a client and a server, wherein the client comprises the virtual resource acquisition apparatus according to claim 6; the server comprises the apparatus for acquiring virtual resources according to claim 7.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of acquiring a virtual resource according to any one of claims 1 to 5.
10. 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 method of acquiring a virtual resource according to any one of claims 1 to 5.
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 true CN112035246A (en) 2020-12-04
CN112035246B 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022028607A1 (en) * 2020-08-07 2022-02-10 北京达佳互联信息技术有限公司 Virtual resource acquisition method and apparatus

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

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022028607A1 (en) * 2020-08-07 2022-02-10 北京达佳互联信息技术有限公司 Virtual resource acquisition method and apparatus

Also Published As

Publication number Publication date
WO2022028607A1 (en) 2022-02-10
CN112035246B (en) 2023-12-19

Similar Documents

Publication Publication Date Title
CN112468833B (en) Live broadcast interactive information processing method, device, terminal, server and storage medium
CN106790043B (en) Method and device for sending message in live broadcast application
CN107094094B (en) Application networking method and device and terminal
CN108600529B (en) Information interaction method and device and computer readable storage medium
CN109413157B (en) Message shielding method and device
CN112270561A (en) Electronic resource distribution method and device, electronic equipment and storage medium
CN112291631A (en) Information acquisition method, device, terminal and storage medium
CN112416219A (en) Target object processing method, device and system, electronic equipment and storage medium
CN110166564B (en) Information communication method, terminal and storage medium
CN111756820A (en) Access processing method and device, electronic equipment and storage medium
CN110045893A (en) Querying method and device is broadcast live
CN112616053B (en) Transcoding method and device for live video and electronic equipment
CN110690979B (en) Group message processing method, device, server, client and storage medium
CN106528247B (en) Data refreshing method and device
CN106506808B (en) Method and device for prompting communication message
CN112035246B (en) Method, device and system for acquiring virtual resources, electronic equipment and storage medium
CN110908814A (en) Message processing method and device, electronic equipment and storage medium
CN112256424A (en) Virtual resource processing method, device and system, electronic equipment and storage medium
CN109245992B (en) Request processing method and device, electronic equipment and storage medium
CN108012258B (en) Data traffic management method and device for virtual SIM card, terminal and server
CN107070816B (en) Application identification method and device and mobile terminal
CN115499438A (en) Task allocation method and device, electronic equipment and storage medium
CN115374383A (en) Page data processing method and device, electronic equipment and storage medium
CN114399306A (en) Virtual resource distribution method and device, electronic equipment and storage medium
CN114567790A (en) Information display method and device, electronic equipment and storage medium

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