CN111611075A - Virtual resource request processing method and device, electronic equipment and storage medium - Google Patents

Virtual resource request processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111611075A
CN111611075A CN202010424539.5A CN202010424539A CN111611075A CN 111611075 A CN111611075 A CN 111611075A CN 202010424539 A CN202010424539 A CN 202010424539A CN 111611075 A CN111611075 A CN 111611075A
Authority
CN
China
Prior art keywords
virtual resource
value
configuration information
server
resource
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
CN202010424539.5A
Other languages
Chinese (zh)
Other versions
CN111611075B (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 CN202010424539.5A priority Critical patent/CN111611075B/en
Publication of CN111611075A publication Critical patent/CN111611075A/en
Application granted granted Critical
Publication of CN111611075B publication Critical patent/CN111611075B/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)
  • Storage Device Security (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The method comprises the steps of responding to a request instruction of virtual resources, obtaining a user identifier in the request instruction and a resource identifier of the requested virtual resources, obtaining configuration information corresponding to the virtual resources, calculating an allocation value of the virtual resources according to the configuration information and the user identifier, and displaying the virtual resources corresponding to the allocation value and corresponding prompt information. According to the method and the device, the client locally processes the request instruction, the allocation value of the virtual resource is calculated and displayed for the user initiating the request instruction according to the configuration information of the requested virtual resource, so that the problem that the service is unavailable due to the fact that the request instruction is sent to the server at high concurrency in the prior art is solved, and the service performance is greatly improved.

Description

Virtual resource request processing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer network technologies, and in particular, to a method and an apparatus for processing a virtual resource request, an electronic device, and a storage medium.
Background
With the development of computer network technology, the functions of various internet Applications (APPs) are becoming more and more rich, and it has become more and more common to request virtual resources (e.g., red envelope) in the internet through APPs.
In the related art, when a user requests a virtual resource in the internet through an APP, the APP usually sends a corresponding request to a server for processing, for example, the server verifies the request, allocates the corresponding virtual resource to the request after the request is verified to be legal, and displays the allocated virtual new source to the user through the APP.
However, in the case of a large number of highly concurrent requests, due to high instantaneous traffic and high peak value, the server may go down due to excessive pressure, so that the service is unavailable, and the APP cannot interact with the server at all.
Disclosure of Invention
The present disclosure provides a virtual resource request processing method, apparatus, electronic device, and storage medium, to at least solve the problem in the related art that a service is unavailable due to an excessive pressure on a server. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for processing a virtual resource request is provided, where the method includes:
responding to a request instruction of virtual resources, and acquiring a user identifier in the request instruction and a resource identifier of the requested virtual resources;
acquiring configuration information corresponding to virtual resources, wherein the virtual resources, resource identifiers and the configuration information have a corresponding relation, and the configuration information is configuration parameters which are pre-stored in the local client and correspond to the virtual resources;
calculating the allocation value of the virtual resource according to the configuration information and the user identification;
and displaying the virtual resources corresponding to the allocation values and the corresponding prompt information.
In one embodiment, after presenting the virtual resource corresponding to the allocation value and the corresponding hint information, the method further comprises: receiving an acquisition instruction of the displayed virtual resources; calling a data reporting interface according to the acquisition instruction, reporting the distribution value to a server, wherein the distribution value is used for indicating the server to verify the acquisition instruction of the virtual resource, when the distribution value is consistent with the distribution value calculated by the server, the server passes the verification of the acquisition instruction of the virtual resource and distributes the distribution value to a user account corresponding to the user identifier, and when the distribution value is inconsistent with the distribution value calculated by the server, the server fails to verify the acquisition instruction of the virtual resource and does not distribute the distribution value to the user account corresponding to the user identifier; if the verification result is that the virtual resource acquisition instruction passes verification, displaying information, returned by the server, of the user account corresponding to the user identifier and to which the distribution value is distributed; and if the verification result is that the verification of the virtual resource acquisition instruction is not passed, displaying information that the virtual resource acquisition instruction returned by the display server is an illegal instruction. .
In one embodiment, before reporting the allocation value to the server, the method further includes: performing first encryption processing on the distribution value to obtain an encrypted distribution value; reporting the allocation value to a server, including: and reporting the distribution value after the encryption processing to a server.
In one embodiment, the configuration information includes a random key corresponding to the resource identifier of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource; calculating the allocation value of the virtual resource according to the configuration information and the user identifier, including: carrying out second encryption processing on the random key and the user identification to obtain an encrypted character string; calculating a difference value between an upper limit value of the virtual resource and a lower limit value of the virtual resource; performing modular operation on the encrypted character string and the difference to obtain a module of the encrypted character string divided by the difference, wherein the module is the offset of the virtual resource; and determining the sum of the offset of the virtual resources and the lower limit value of the virtual resources as the distribution value of the virtual resources.
In one embodiment, performing a second encryption process on the random key and the user identifier to obtain an encrypted string includes: carrying out XOR processing on the random key and the user identification to obtain a processed value; and performing Hash operation on the processed value by adopting cyclic redundancy check to obtain the encrypted character string.
In one embodiment, the request instruction of the virtual resource includes an identifier indicating whether to locally acquire configuration information corresponding to the virtual resource; after responding to the request instruction for the virtual resource, the method further comprises: if the identification is recognized to be that the configuration information corresponding to the virtual resource is acquired locally, acquiring the configuration information corresponding to the virtual resource in the request instruction locally; and if the identifier is identified as not locally acquiring the configuration information corresponding to the virtual resource, sending a request instruction to the server, wherein the request instruction is used for instructing the server to acquire the configuration information corresponding to the virtual resource in the request instruction.
According to a second aspect of the embodiments of the present disclosure, there is provided a virtual resource request verification method, the method including:
receiving a first allocation value of a virtual resource corresponding to a user identifier, wherein the first allocation value is obtained by the client after calculation according to a request instruction of the virtual resource, and the request instruction comprises the user identifier and a resource identifier of the requested virtual resource;
acquiring configuration information corresponding to virtual resources, wherein the virtual resources, resource identifiers and the configuration information have a corresponding relation, and the configuration information is configuration parameters corresponding to the virtual resources;
calculating a second allocation value of the virtual resource according to the configuration information and the user identifier;
if the second distribution value is the same as the first distribution value, distributing the second distribution value to a client account corresponding to the user identifier; and returning the corresponding display information to the client.
In one embodiment, after the second allocation value is allocated to the client account corresponding to the user identifier, the method further includes: updating the total remaining value of the virtual resources of the client account according to the allocated second allocation value.
In one embodiment, after calculating the second allocation value of the virtual resource, the method further comprises: and if the second distribution value is different from the first distribution value, determining that the client account corresponding to the user identifier is an illegal user, and freezing the operation of the client account.
In one embodiment, the first allocation value is the first allocation value after the first encryption processing; after receiving the first allocation value of the virtual resource corresponding to the user identifier reported by the client, the method further includes: and decrypting the first distribution value after the first encryption by adopting a decryption processing method corresponding to the first encryption to obtain the decrypted first distribution value.
In one embodiment, the configuration information includes a random key corresponding to the resource identifier of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource; calculating a second allocation value of the virtual resource according to the configuration information and the user identifier, including: carrying out second encryption processing on the random key and the user identification to obtain an encrypted character string; calculating a difference value between an upper limit value of the virtual resource and a lower limit value of the virtual resource; performing modular operation on the encrypted character string and the difference to obtain a module of the encrypted character string divided by the difference, wherein the module is the offset of the virtual resource; and determining the sum of the offset of the virtual resources and the lower limit value of the virtual resources as a second allocation value of the virtual resources.
In one embodiment, performing a second encryption process on the random key and the user identifier to obtain an encrypted string includes: carrying out XOR processing on the random key and the user identification to obtain a processed value; and performing Hash operation on the processed value by adopting cyclic redundancy check to obtain an encrypted character string.
According to a third aspect of the embodiments of the present disclosure, there is provided a virtual resource request processing apparatus, including:
the information acquisition module is configured to execute a request instruction responding to the virtual resource, and acquire a user identifier in the request instruction and a resource identifier of the requested virtual resource;
the configuration information determining module is configured to execute acquisition of configuration information corresponding to virtual resources, wherein the virtual resources, the resource identifiers and the configuration information have corresponding relations, and the configuration information is configuration parameters which are stored locally at the client in advance and correspond to the virtual resources;
the computing module is configured to calculate the allocation value of the virtual resource according to the configuration information and the user identification;
and the display module is configured to perform display of the virtual resource corresponding to the allocation value and the corresponding prompt message.
In one embodiment, the apparatus further comprises: the instruction receiving module is configured to execute the step of receiving the acquisition instruction of the displayed virtual resource; the reporting module is configured to execute calling of a data reporting interface according to the acquisition instruction, and report a distribution value to the server, wherein the distribution value is used for indicating the server to verify the acquisition instruction of the virtual resource, when the distribution value is consistent with the distribution value calculated by the server, the server passes the verification of the acquisition instruction of the virtual resource and distributes the distribution value to the user account corresponding to the user identifier, and when the distribution value is inconsistent with the distribution value calculated by the server, the server fails to verify the acquisition instruction of the virtual resource and does not distribute the distribution value to the user account corresponding to the user identifier; the display module is configured to display the display information, which is returned by the server and distributes the distribution value to the user account corresponding to the user identifier, if the verification result is that the virtual resource acquisition instruction passes the verification; and if the verification result is that the verification of the virtual resource acquisition instruction is not passed, displaying information that the virtual resource acquisition instruction returned by the display server is an illegal instruction.
In one embodiment, the apparatus further comprises: the encryption module is configured to execute first encryption processing on the distribution value to obtain an encrypted distribution value; the reporting module is configured to perform: and reporting the distribution value after the encryption processing to a server.
In one embodiment, the configuration information includes a random key corresponding to the resource identifier of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource; the calculation module comprises: the encryption processing unit is configured to execute second encryption processing on the random key and the user identification to obtain an encrypted character string; a difference calculation unit configured to perform calculation of a difference between an upper limit value of the virtual resource and a lower limit value of the virtual resource; the offset calculation unit is configured to perform modular operation on the encrypted character string and the difference value to obtain a module of the encrypted character string divided by the difference value, wherein the module is the offset of the virtual resource; and an allocation value calculation unit configured to perform determination of a sum of the offset of the virtual resource and the lower limit value of the virtual resource as an allocation value of the virtual resource.
In one embodiment, the encryption processing unit includes: the XOR processing subunit is configured to perform XOR processing on the random key and the user identifier to obtain a processed value; and the Hash operation subunit is configured to perform Hash operation on the processed value by adopting cyclic redundancy check to obtain an encrypted character string.
In one embodiment, the request instruction of the virtual resource includes an identifier indicating whether to locally acquire configuration information corresponding to the virtual resource; the device further comprises: the identification module is configured to execute local acquisition of the configuration information corresponding to the virtual resource in the request instruction if the identification is identified as local acquisition of the configuration information corresponding to the virtual resource; and if the identifier is identified as not locally acquiring the configuration information corresponding to the virtual resource, sending a request instruction to the server, wherein the request instruction is used for instructing the server to acquire the configuration information corresponding to the virtual resource in the request instruction.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a virtual resource request validation apparatus, including:
the receiving module is configured to execute receiving of a first allocation value of the virtual resource corresponding to the user identifier, wherein the first allocation value is obtained by the client after calculation according to a request instruction of the virtual resource, and the request instruction comprises the user identifier and a resource identifier of the requested virtual resource;
the configuration information acquisition module is configured to execute acquisition of configuration information corresponding to virtual resources, wherein the virtual resources, the resource identifiers and the configuration information have corresponding relations, and the configuration information is configuration parameters corresponding to the virtual resources;
a calculation module configured to perform calculating a second allocation value of the virtual resource according to the configuration information and the user identifier;
an allocation module configured to perform, if a second allocation value is the same as a first allocation value, allocating the second allocation value to a client account corresponding to a user identity;
and the return module is configured to return the corresponding display information to the client.
In one embodiment, the apparatus further includes an update module configured to perform: updating the total remaining value of the virtual resources of the client account according to the allocated second allocation value.
In one embodiment, the apparatus further comprises a freezing module configured to perform: and if the second distribution value is different from the first distribution value, determining that the client account corresponding to the user identifier is an illegal user, and freezing the operation of the client account.
In one embodiment, the first allocation value is the first allocation value after the first encryption processing; the apparatus also includes a decryption module configured to perform: and decrypting the first distribution value after the first encryption by adopting a decryption processing method corresponding to the first encryption to obtain the decrypted first distribution value.
In one embodiment, the configuration information includes a random key corresponding to the resource identifier of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource; the calculation module comprises: the encryption processing unit is configured to execute second encryption processing on the random key and the user identification to obtain an encrypted character string; a difference calculation unit configured to perform calculation of a difference between an upper limit value of the virtual resource and a lower limit value of the virtual resource; the offset calculation unit is configured to perform modular operation on the encrypted character string and the difference value to obtain a module of the encrypted character string divided by the difference value, wherein the module is the offset of the virtual resource; a second allocation value calculation unit configured to perform a determination of a sum of the offset of the virtual resource and the lower limit value of the virtual resource as a second allocation value of the virtual resource.
In one embodiment, the encryption processing unit includes: the XOR processing subunit is configured to perform XOR processing on the random key and the user identifier to obtain a processed value; and the Hash operation subunit is configured to perform Hash operation on the processed value by adopting cyclic redundancy check to obtain an encrypted character string.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to cause the electronic device to perform the virtual resource request processing method described in any embodiment of the first aspect.
According to a sixth aspect of embodiments of the present disclosure, there is provided a server including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to cause the server to perform the virtual resource request validation method described in any embodiment of the second aspect.
According to a seventh aspect of the embodiments of the present disclosure, there is provided a storage medium, wherein instructions, when executed by a processor of an electronic device or a server, enable the electronic device or the server to perform the virtual resource request processing method described in any of the embodiments of the first aspect or perform the virtual resource request validation method described in any of the embodiments of the second aspect.
According to an eighth aspect of embodiments of the present disclosure, there is provided a computer program product, the program product comprising a computer program, the computer program being stored in a readable storage medium, from which the at least one processor of the device reads and executes the computer program, so that the device performs the virtual resource request processing method described in any one of the embodiments of the first aspect or performs the virtual resource request validation method described in any one of the embodiments of the second aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects: by responding to the request instruction of the virtual resource, the user identification in the request instruction and the resource identification of the requested virtual resource are obtained, and the configuration information corresponding to the virtual resource is obtained, so that the allocation value of the virtual resource is calculated according to the configuration information and the user identification, and the virtual resource corresponding to the allocation value and the corresponding prompt information are displayed. According to the method and the device, the client locally processes the request instruction, the allocation value of the virtual resource is calculated and displayed for the user initiating the request instruction according to the configuration information of the requested virtual resource, so that the problem that the service is unavailable due to the fact that the request instruction is sent to the server at high concurrency in the prior art is solved, and the service performance is greatly 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 diagram illustrating an application environment for a method for processing virtual resource requests, in accordance with an illustrative embodiment.
FIG. 2 is a flow diagram illustrating a method for virtual resource request processing in accordance with an exemplary embodiment.
FIG. 3 is a flow diagram illustrating another method of virtual resource request processing in accordance with an illustrative embodiment.
FIG. 4 is a schematic diagram illustrating steps for calculating an allocation value for a virtual resource in accordance with an exemplary embodiment.
FIG. 5 is a flowchart illustrating a virtual resource request validation method in accordance with an exemplary embodiment.
FIG. 6 is a diagram illustrating steps for calculating a second allocation value for a virtual resource, according to an example embodiment.
Fig. 7 is an interaction diagram illustrating a red envelope robbing scenario, according to an example embodiment.
Fig. 8 is a block diagram illustrating a virtual resource request processing apparatus in accordance with an example embodiment.
Fig. 9 is a block diagram illustrating a virtual resource request validation apparatus in accordance with an example embodiment.
Fig. 10 is an internal block diagram of an electronic device shown in accordance with an example embodiment.
FIG. 11 is an internal block diagram of a server, according to an example 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.
The virtual resource request processing method provided by the present disclosure may be applied to an application environment as shown in fig. 1. Specifically, the terminal 110 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 120 may be implemented by an independent server or a server cluster formed by a plurality of servers.
In this embodiment, a client of an application program is installed in the terminal 110, where the application program may be any one of a shopping APP, a short video APP, a live APP, a video playing APP, and a social application APP. Server 120 is a backend server corresponding to a client of the application. The terminal 110 may request a virtual resource (e.g., a red packet) in a client of the installed application, and the client responds to a request instruction of the terminal 110 for the virtual resource, acquires a user identifier in the request instruction and a resource identifier of the requested virtual resource to determine configuration information corresponding to the resource identifier of the virtual resource, calculates an allocation value of the virtual resource according to the configuration information and the user identifier, and displays the virtual resource corresponding to the allocation value and corresponding prompt information; when the client receives an instruction for acquiring the displayed virtual resource from the terminal 110, the client reports the allocation value of the virtual resource corresponding to the user identifier to the server 120, the server 120 recalculates the allocation value in a manner agreed with the client, verifies the allocation value sent by the client according to the recalculated allocation value, processes the distribution value according to the verification result, and returns the verification result to the client of the terminal 110.
Fig. 2 is a flowchart illustrating a virtual resource request processing method according to an exemplary embodiment, and as shown in fig. 2, the method is described as being applied to a client of the terminal in fig. 1, and includes the following steps.
In step S210, in response to the request instruction for the virtual resource, the user identifier in the request instruction and the resource identifier of the requested virtual resource are obtained.
Wherein the request instruction is an indication or command to request the virtual resource from the client. The user identifier refers to a unique identity of the user who initiates the request instruction, and may be, for example, an account number used by the user to log in the client. The resource identifier is a unique identifier corresponding to the requested virtual resource, that is, different virtual resources correspond to different resource identifiers, for example, the resource identifier may be a serial number automatically generated when the virtual resource is generated, or an ID (Identity document) assigned to the virtual resource according to a certain rule. In this embodiment, when a user wants to obtain a virtual resource in a client, a request instruction for the virtual resource is initiated to the client by clicking an entry corresponding to the virtual resource in the client, and the client responds to the request instruction for the virtual resource and obtains a user identifier corresponding to the user initiating the request instruction and a resource identifier of the requested virtual resource based on the request instruction.
In step S220, configuration information corresponding to the virtual resource is acquired.
The virtual resource, the resource identifier and the configuration information have a corresponding relationship, and the virtual resource and the configuration information can be generally associated through the resource identifier. The configuration information is a configuration parameter set for the virtual resource in advance, the configuration parameter is stored locally at the client, and the configuration parameter set for different virtual resources can be different, so that mapping can be performed through the resource identifier of the virtual resource when the configuration information is set. In this embodiment, after the resource identifier of the requested virtual resource is obtained through the above steps, the configuration information having a mapping relationship with the resource identifier of the requested virtual resource may be obtained.
In step S230, an allocation value of the virtual resource is calculated according to the configuration information and the user identifier.
Wherein the allocation value is a partial value in the requested virtual resource for allocation to the user initiating the request instruction. Specifically, the configuration information may include a preset calculation rule, and in this embodiment, the client calculates, according to the configuration information of the requested virtual resource and the user identifier, an allocation value of the virtual resource corresponding to the user identifier by using the preset calculation rule.
In step S240, the virtual resource corresponding to the allocation value and the corresponding prompt information are presented.
The prompt information includes information for prompting the user initiating the request instruction that the virtual resource corresponding to the allocation value will be allocated with a delay, and certainly, the prompt information may also include other information according to the actual situation, which is not limited in this embodiment. Specifically, the client displays the calculated allocation value of the virtual resource corresponding to the user identifier, and simultaneously displays corresponding prompt information to prompt the user initiating the request instruction.
According to the virtual resource request processing method, the user identification in the request instruction and the resource identification of the requested virtual resource are obtained in response to the request instruction of the virtual resource, and the configuration information corresponding to the virtual resource is obtained, so that the allocation value of the virtual resource is calculated according to the configuration information and the user identification, and the virtual resource corresponding to the allocation value and the corresponding prompt information are displayed. According to the method and the device, the client locally processes the request instruction, the allocation value of the virtual resource is calculated and displayed for the user initiating the request instruction according to the configuration information of the requested virtual resource, so that the problem that the service is unavailable due to the fact that the request instruction is sent to the server at high concurrency in the prior art is solved, and the service performance is greatly improved.
In an exemplary embodiment, as shown in fig. 3, after presenting the virtual resource corresponding to the allocation value and the corresponding hint information in step S240, the virtual resource request processing method of the present application further includes the following steps:
in step S250, a fetch instruction for the exposed virtual resource is received.
The obtaining instruction is an instruction or a command sent by the user through the terminal to obtain the virtual resource, and for example, the virtual resource displayed in the client may be clicked to send the obtaining instruction of the virtual resource to the client.
In step S260, the data reporting interface is called according to the acquisition instruction, and the allocation value is reported to the server.
The data reporting interface is an interface for outputting data to the data connecting line when the client transmits data to the server. The allocation value is used for instructing the server to check the acquisition instruction of the virtual resource. In this embodiment, after the client receives the acquisition instruction of the displayed virtual resource, the corresponding data reporting interface is called to report the locally calculated allocation value to the server, and the server checks the acquisition instruction of the virtual resource according to the reported allocation value, that is, checks whether the acquisition instruction of the virtual resource is valid. Specifically, when the reported distribution value is consistent with the distribution value calculated by the server, the acquisition instruction of the virtual resource is considered to be valid, so that the acquisition instruction of the virtual resource is verified by the server, and the distribution value is distributed to the user account corresponding to the user identifier; when the reported allocation value is inconsistent with the allocation value calculated by the server, the corresponding client is possibly maliciously tampered, so that the acquisition instruction for the virtual resource is considered invalid, therefore, the acquisition instruction for the virtual resource is not verified by the server, and the allocation value is not allocated to the user account corresponding to the user identifier.
In step S270, the display information returned by the server according to the verification result is received.
If the verification result is that the virtual resource acquisition instruction passes verification, showing display information returned by the server and used for distributing the distribution value to the user account corresponding to the user identifier, wherein if the distribution value is shown to be in charge, the virtual resource acquisition is successfully acquired; if the verification result is that the virtual resource acquisition instruction cannot be verified, displaying information that the virtual resource acquisition instruction returned by the display server is an illegal instruction, such as displaying an "illegal instruction" and an "illegal user", that is, indicating that the virtual resource acquisition instruction is invalid or indicating that the corresponding client is maliciously tampered and identified as an illegal user.
In the above embodiment, the client receives the acquisition instruction of the displayed virtual resource, calls the data reporting interface according to the acquisition instruction, and reports the allocation value to the server, so that the server can verify the acquisition instruction of the virtual resource according to the reported allocation value, and receive the display information returned by the server according to the verification result, thereby improving the security of the service.
In an exemplary embodiment, before reporting the assigned value to the server, the client may further perform a first encryption process on the assigned value to obtain the assigned value after the encryption process, where the first encryption process is a way of changing original information data by using a special algorithm, so that even if an unauthorized user obtains encrypted information, the unauthorized user still cannot know the content of the information without knowing a decryption method. In the present embodiment, the algorithm used in the first encryption process includes, but is not limited to, a symmetric encryption process. Therefore, the client can report the distribution value after the encryption processing to the server so as to improve the security of data transmission.
In an exemplary embodiment, the configuration information includes a random key corresponding to a resource identification of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource. Wherein the random key may be a random seed, which is a key value generated by a specified random number generation algorithm. The upper limit value of the virtual resource refers to the highest value capable of being allocated in the virtual resource, and the lower limit value of the virtual resource refers to the lowest value allocated in the virtual resource.
As shown in fig. 4, in step S230, the allocation value of the virtual resource is calculated according to the configuration information and the user identifier, which may specifically be implemented by the following steps:
in step S231, a second encryption process is performed on the random key and the user identifier to obtain an encrypted string.
The second encryption process is a mode of changing original information data by a special algorithm, so that even if an unauthorized user obtains encrypted information, the content of the information cannot be known because a decryption method is not known. In the present embodiment, the second encryption process includes, but is not limited to, one or more of symmetric encryption, xor processing, hash operation, and the like. For example, the second encryption processing is performed on the random key and the user identifier, specifically, the second encryption processing may be performed by performing xor processing on the random key and the user identifier to obtain a value after the xor processing, and then performing hash operation on the value after the xor processing by using cyclic redundancy check (a cyclic redundancy check 32, CRC32 for short), so as to obtain the encrypted character string.
In step S232, a difference between the upper limit value of the virtual resource and the lower limit value of the virtual resource is calculated.
Specifically, according to the upper limit value of the virtual resource and the lower limit value of the virtual resource in the configuration information, the upper limit value of the virtual resource is subtracted by the lower limit value of the virtual resource by mathematical operation to obtain a difference value between the upper limit value and the lower limit value of the virtual resource.
In step S233, a modulo operation is performed on the encrypted string and the difference to obtain a modulo of the encrypted string divided by the difference.
Specifically, the encryption string obtained in step S231 is used to perform a modulo operation on the difference value obtained in step S232, so as to obtain a modulo of the encryption string divided by the difference value, where in this embodiment, the obtained modulo represents an offset of the virtual resource. Since the user identification is used in the calculation, the offset is related to the user to which the user identification corresponds.
In step S234, the sum of the offset of the virtual resource and the lower limit value of the virtual resource is determined as the allocation value of the virtual resource.
In the embodiment, the client calculates the allocation value of the virtual resource for the requesting user through the configuration information of the requested virtual resource so as to process the request instruction of the user locally, thereby greatly relieving the pressure of the server and avoiding the problem of service unavailability caused by high-concurrency requests.
In an exemplary embodiment, the request instruction of the virtual resource includes an identifier of whether to locally obtain the configuration information corresponding to the virtual resource, specifically, when the identifier is to locally obtain the configuration information corresponding to the virtual resource, it indicates that the request instruction of the virtual resource can be locally processed at the client, so that, after responding to the request instruction of the virtual resource, the client can locally obtain the configuration information corresponding to the virtual resource in the request instruction so as to facilitate local processing; when the identifier indicates that the configuration information corresponding to the virtual resource is not obtained locally, it indicates that the request instruction of the virtual resource cannot be processed locally at the client and needs to be processed by the server, so that after responding to the request instruction of the virtual resource, the request instruction can be sent to the server and processed by the server, specifically, the request instruction is used for instructing the server to obtain the configuration information corresponding to the virtual resource in the request instruction.
In the above embodiment, by identifying whether the identifier of the configuration information corresponding to the virtual resource is locally obtained in the request instruction of the virtual resource, the client may determine whether to process the request instruction or determine which manner to process the request instruction according to the identified identifier, thereby greatly improving flexibility of service.
Fig. 5 is a flowchart illustrating a virtual resource request authentication method according to an exemplary embodiment, and as shown in fig. 5, the method is described as applied to the server in fig. 1, and includes the following steps.
In step S510, a first allocation value of the virtual resource corresponding to the user identifier reported by the client is received.
The first allocation value is obtained by the client through calculation according to a request instruction of the virtual resource, wherein the request instruction comprises a user identifier and a resource identifier of the requested virtual resource. Specifically, when a user wants to obtain a virtual resource in a client, a request instruction for the virtual resource is initiated to the client by clicking an entry corresponding to the virtual resource in the client, the client responds to the request instruction for the virtual resource, obtains a user identifier corresponding to the user initiating the request instruction and a resource identifier of the requested virtual resource based on the request instruction, and calculates and displays a first allocation value of the virtual resource corresponding to the user identifier by using the method shown in fig. 2, wherein the first allocation value is a value of the virtual resource used for being allocated to the user initiating the request instruction, when the user initiates an obtaining instruction according to the virtual resource displayed by the client, the client calls a data reporting interface to report the first allocation value of the virtual resource corresponding to the user identifier to a server, and the server receives the first allocation value, and verified through subsequent steps.
In step S520, configuration information corresponding to the virtual resource is acquired.
The configuration information is a configuration parameter set for the virtual resource in advance, and the set configuration parameter may be different for different virtual resources, so that mapping may be performed through a resource identifier of the virtual resource when the configuration information is set, so that the virtual resource, the resource identifier, and the configuration information have a corresponding mapping relationship. In this embodiment, the server obtains, according to the resource identifier of the virtual resource, configuration information that the resource identifier has a mapping relationship. The configuration information may be stored locally in the server in advance, or may be shared by an independent configuration server to the server, which is not limited in this embodiment.
In step S530, a second allocation value of the virtual resource is calculated according to the configuration information and the user identifier.
The second allocation value is calculated by the server according to the same calculation rule as the client, and is used for checking the first allocation value calculated by the client, namely checking whether the first allocation value calculated by the client is valid or not, so that loss of the client caused by malicious tampering is avoided.
In step S540, if the second allocation value is the same as the first allocation value, the second allocation value is allocated to the client account corresponding to the user identifier.
Specifically, the server verifies the first allocation value calculated by the client according to the locally calculated second allocation value, and in this embodiment, if the second allocation value is the same as the first allocation value, the verification is passed, so that the second allocation value is allocated to the client account corresponding to the user identifier.
In step S550, the corresponding presentation information is returned to the client.
Specifically, after the second allocation value is allocated to the client account corresponding to the user identifier, the server may further return corresponding display information to the client, where the display information is used to instruct the client to display specific display content. In this embodiment, the presentation information may be information that the assignment value has been assigned to the user account corresponding to the user identifier.
According to the virtual resource request verification method, the first distribution value of the virtual resource corresponding to the user identifier reported by the client is received, the second distribution value of the virtual resource corresponding to the user identifier is calculated by adopting the same calculation rule as the client, the first distribution value calculated by the client is verified according to the locally calculated second distribution value, when the first distribution value and the second distribution value are the same, the second distribution value is distributed to the client account corresponding to the user identifier, and corresponding display information is returned to the client.
In an exemplary embodiment, after the second allocation value is allocated to the client account corresponding to the user identifier, the virtual resource request authentication method of the present application further includes: updating the total remaining value of the virtual resources of the client account according to the allocated second allocation value. Specifically, if the second allocation value is the same as the first allocation value, it indicates that the verification is passed, and therefore, the server allocates the second allocation value to the client account corresponding to the user identifier, and updates the total remaining value of the total virtual resources corresponding to the client according to the allocated second allocation value, thereby implementing completion of the service under the condition that the server and the client are decoupled, and ensuring the security of the service.
In an exemplary embodiment, after the server calculates the second allocation value of the virtual resource, the virtual resource request validation method of the present application further includes: and if the second distribution value is different from the first distribution value, determining that the client account corresponding to the user identifier is an illegal user, and freezing the operation of the client account. Specifically, if the second allocation value is different from the first allocation value, it indicates that the corresponding client is at risk of being maliciously tampered, so that the client account corresponding to the user identifier is determined as an illegal user, and all operations of the client account are frozen, that is, no service is provided for the client account.
In an exemplary embodiment, the first allocation value is the first allocation value after the first encryption processing, that is, the first allocation value received by the server is encrypted information after the first encryption processing is performed by the client, and therefore, in this embodiment, when the server receives the first allocation value after the first encryption processing, the server decrypts the first allocation value after the first encryption processing by using a decryption processing method corresponding to the first encryption processing, so as to obtain the decrypted first allocation value. According to the embodiment, the first distribution value is encrypted and then transmitted, so that the safety of data transmission is improved.
In an exemplary embodiment, the configuration information includes a random key corresponding to a resource identification of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource. Wherein the random key may be a random seed, which is a key value generated by a specified random number generation algorithm. The upper limit value of the virtual resource refers to the highest value capable of being allocated in the virtual resource, and the lower limit value of the virtual resource refers to the lowest value allocated in the virtual resource.
As shown in fig. 6, in step S530, according to the configuration information and the user identifier, the second allocation value of the virtual resource is calculated, which may specifically be implemented by the following steps:
in step S531, a second encryption process is performed on the random key and the user identifier to obtain an encrypted string.
The second encryption process is a mode of changing original information data by a special algorithm, so that even if an unauthorized user obtains encrypted information, the content of the information cannot be known because a decryption method is not known. In the present embodiment, the second encryption process includes, but is not limited to, one or more of symmetric encryption, xor processing, hash operation, and the like. For example, the second encryption processing is performed on the random key and the user identifier, specifically, the second encryption processing may be performed by performing xor processing on the random key and the user identifier to obtain a value after the xor processing, and then performing hash operation on the value after the xor processing by using cyclic redundancy check (a cyclic redundancy check 32, CRC32 for short), so as to obtain the encrypted character string.
In step S532, a difference between the upper limit value of the virtual resource and the lower limit value of the virtual resource is calculated.
Specifically, according to the upper limit value of the virtual resource and the lower limit value of the virtual resource in the configuration information, the upper limit value of the virtual resource is subtracted by the lower limit value of the virtual resource by mathematical operation to obtain a difference value between the upper limit value and the lower limit value of the virtual resource.
In step S533, a modulo operation is performed on the encrypted string and the difference to obtain a modulo of the encrypted string divided by the difference.
Specifically, the difference value obtained in step S532 is subjected to a modulo operation by using the encrypted character string obtained in step S531, so as to obtain a modulo of the encrypted character string divided by the difference value, where in this embodiment, the obtained modulo represents an offset of the virtual resource. Since the user identification is used in the calculation, the offset is related to the user to which the user identification corresponds.
In step S534, the sum of the offset of the virtual resource and the lower limit value of the virtual resource is determined as the second allocation value of the virtual resource.
In the above embodiment, the server calculates the second allocation value of the virtual resource corresponding to the user identifier by using the same calculation rule as that of the client, so as to check the first allocation value calculated locally by the client, thereby ensuring the security of the service.
In an exemplary embodiment, a red envelope robbing scenario is taken as an example to further explain the scheme of the present application, and in this embodiment, a virtual resource corresponding to a resource identifier is a certain red envelope service, as shown in fig. 7, the method specifically includes the following steps:
in step S701, the configuration server issues configuration information of the red packet service.
The configuration server is used for storing and setting configuration information, and can be deployed in an independent machine room and decoupled from the server of the red envelope service in order to ensure the smooth development of the service, so that the configuration server is not influenced by the server of the red envelope service. Specifically, the configuration information includes an identifier indicating whether the request corresponding to the red packet service is processed locally, a random key, an upper limit of the red packet amount, and a lower limit of the red packet amount.
In step S702, the user initiates a request instruction for the red envelope service through the client.
Specifically, the request instruction may be an instruction or a command requesting to enter a page corresponding to the red packet service, for example, an entry of the page corresponding to the red packet service is clicked, and a request instruction is initiated to the client, and the client responds to the request instruction for the virtual resource and obtains a user identifier in the request instruction, a resource identifier of the requested virtual resource, and an identifier of whether the request is processed locally, in this embodiment, the identifier obtained by the client is taken as an example of processing the request locally, and then the subsequent steps are sequentially executed.
In step S703, the client searches for configuration information according to the request instruction, and calculates a first allocation value of the red packet corresponding to the requested user identifier.
In step S704, the client displays the red packet corresponding to the first allocation value and the prompt information to the user.
In step S705, the user sends an acquisition request for the displayed red envelope to the client.
In step S706, the client reports the first allocation value of the red packet to the server.
In step S707, the server calculates a second allocation value of the red packet using the same calculation method as that of the client.
In step S708, the server checks the first allocation value according to the second allocation value of the red packet.
And when the second distribution value is the same as the first distribution value, the verification is passed, so that the second distribution value of the red packet is distributed to the user corresponding to the requested user identification, and the total remaining amount of the red packet corresponding to the user is updated. And when the second distribution value is different from the first distribution value, the verification is not passed, so that all operations of the user corresponding to the requested user identification are frozen.
In step S709, the server returns corresponding display information to the client according to the verification result.
Specifically, if the verification result is that the verification is passed, the server returns display information that the allocation value is allocated to the user account corresponding to the user identifier, so that the client performs corresponding display, and if the display shows that the allocation value is already in charge, the client successfully acquires the virtual resource; if the verification result is that the verification is failed, the server returns display information that the acquisition instruction of the virtual resource is an illegal instruction, such as displaying an "illegal instruction" and an "illegal user", which means that the acquisition instruction of the virtual resource is invalid or that the corresponding client is maliciously tampered and identified as an illegal user.
It should be understood that although the various steps in the flow charts of fig. 1-7 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 1-7 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
FIG. 8 is a block diagram illustrating a virtual resource request processing apparatus in accordance with an illustrative embodiment. Referring to fig. 8, the apparatus includes an information acquisition module 801, a configuration information determination module 802, a calculation module 803, and a presentation module 804.
An information obtaining module 801 configured to execute, in response to a request instruction for a virtual resource, obtaining a user identifier in the request instruction and a resource identifier of the requested virtual resource;
a configuration information determining module 802, configured to perform obtaining configuration information corresponding to a virtual resource, where the virtual resource, a resource identifier, and the configuration information have a corresponding relationship, and the configuration information is a configuration parameter that is pre-stored locally at a client and corresponds to the virtual resource;
a calculating module 803 configured to calculate an allocation value of a virtual resource according to the configuration information and the user identifier;
and the presentation module 804 is configured to perform presentation of the virtual resource corresponding to the allocation value and the corresponding prompt message.
In one embodiment, the apparatus further comprises: the instruction receiving module is configured to execute the step of receiving the acquisition instruction of the displayed virtual resource; the reporting module is configured to execute calling of a data reporting interface according to the acquisition instruction, and report a distribution value to the server, wherein the distribution value is used for indicating the server to verify the acquisition instruction of the virtual resource, when the distribution value is consistent with the distribution value calculated by the server, the server passes the verification of the acquisition instruction of the virtual resource and distributes the distribution value to the user account corresponding to the user identifier, and when the distribution value is inconsistent with the distribution value calculated by the server, the server fails to verify the acquisition instruction of the virtual resource and does not distribute the distribution value to the user account corresponding to the user identifier; the display module is configured to display the display information, which is returned by the server and distributes the distribution value to the user account corresponding to the user identifier, if the verification result is that the virtual resource acquisition instruction passes the verification; and if the verification result is that the verification of the virtual resource acquisition instruction is not passed, displaying information that the virtual resource acquisition instruction returned by the display server is an illegal instruction.
In one embodiment, the apparatus further comprises: the encryption module is configured to execute first encryption processing on the distribution value to obtain an encrypted distribution value; the reporting module is configured to perform: and reporting the distribution value after the encryption processing to a server.
In one embodiment, the configuration information includes a random key corresponding to a resource identifier of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource; the calculation module 803 includes: the encryption processing unit is configured to execute second encryption processing on the random key and the user identification to obtain an encrypted character string; a difference calculation unit configured to perform calculation of a difference between an upper limit value of the virtual resource and a lower limit value of the virtual resource; the offset calculation unit is configured to perform modular operation on the encrypted character string and the difference value to obtain a module of the encrypted character string divided by the difference value, wherein the module is the offset of the virtual resource; and an allocation value calculation unit configured to perform determination of a sum of the offset of the virtual resource and the lower limit value of the virtual resource as an allocation value of the virtual resource.
In one embodiment, the encryption processing unit includes: the XOR processing subunit is configured to perform XOR processing on the random key and the user identifier to obtain a processed value; and the Hash operation subunit is configured to perform Hash operation on the processed value by adopting cyclic redundancy check to obtain an encrypted character string.
In one embodiment, the request instruction of the virtual resource includes an identifier indicating whether to locally acquire configuration information corresponding to the virtual resource; the device further comprises: the identification module is configured to execute local acquisition of the configuration information corresponding to the virtual resource in the request instruction if the identification is identified as local acquisition of the configuration information corresponding to the virtual resource; and if the identifier is identified as not locally acquiring the configuration information corresponding to the virtual resource, sending a request instruction to the server, wherein the request instruction is used for instructing the server to acquire the configuration information corresponding to the virtual resource in the request instruction.
With regard to the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the virtual resource request processing method, and will not be elaborated here.
FIG. 9 is a block diagram illustrating an apparatus for virtual resource request validation in accordance with an illustrative embodiment. Referring to fig. 9, the apparatus includes a receiving module 901, a configuration information acquiring module 902, a calculating module 903, an allocating module 904, and a returning module 905.
A receiving module 901, configured to execute receiving a first allocation value of a virtual resource corresponding to a user identifier, where the first allocation value is obtained by the client through calculation according to a request instruction of the virtual resource, and the request instruction includes the user identifier and a resource identifier of a requested virtual resource;
a configuration information obtaining module 902 configured to perform obtaining configuration information corresponding to a virtual resource, where the virtual resource, a resource identifier, and the configuration information have a corresponding relationship therebetween, and the configuration information is a configuration parameter corresponding to the virtual resource;
a calculating module 903 configured to calculate a second allocation value of the virtual resource according to the configuration information and the user identifier;
an assignment module 904 configured to perform assigning the second assignment value to the client account corresponding to the user identity if the second assignment value is the same as the first assignment value;
a returning module 905 configured to perform returning the corresponding presentation information to the client.
In one embodiment, the apparatus further comprises an update module configured to perform: updating the total remaining value of the virtual resources of the client account according to the allocated second allocation value.
In one embodiment, the apparatus further comprises a freezing module configured to perform: and if the second distribution value is different from the first distribution value, determining that the client account corresponding to the user identifier is an illegal user, and freezing the operation of the client account.
In one embodiment, the first assigned value is the first assigned value after the first encryption process; the apparatus also includes a decryption module configured to perform: and decrypting the first distribution value after the first encryption by adopting a decryption processing method corresponding to the first encryption to obtain the decrypted first distribution value.
In one embodiment, the configuration information includes a random key corresponding to a resource identifier of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource; the calculation module 903 comprises: the encryption processing unit is configured to execute second encryption processing on the random key and the user identification to obtain an encrypted character string; a difference calculation unit configured to perform calculation of a difference between an upper limit value of the virtual resource and a lower limit value of the virtual resource; the offset calculation unit is configured to perform modular operation on the encrypted character string and the difference value to obtain a module of the encrypted character string divided by the difference value, wherein the module is the offset of the virtual resource; a second allocation value calculation unit configured to perform a determination of a sum of the offset of the virtual resource and the lower limit value of the virtual resource as a second allocation value of the virtual resource.
In one embodiment, the encryption processing unit includes: the XOR processing subunit is configured to perform XOR processing on the random key and the user identifier to obtain a processed value; and the Hash operation subunit is configured to perform Hash operation on the processed value by adopting cyclic redundancy check to obtain an encrypted character string.
With regard to the apparatus in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the virtual resource request validation method, and will not be elaborated herein.
Fig. 10 is a block diagram illustrating an apparatus Z00 for a virtual resource request processing method in accordance with an example embodiment. For example, device Z00 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like.
Referring to fig. 10, device Z00 may include one or more of the following components: a processing component Z02, a memory Z04, a power component Z06, a multimedia component Z08, an audio component Z10, an interface to input/output (I/O) Z12, a sensor component Z14 and a communication component Z16.
The processing component Z02 generally controls the overall operation of the device Z00, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component Z02 may include one or more processors Z20 to execute instructions to perform all or part of the steps of the method described above. Further, the processing component Z02 may include one or more modules that facilitate interaction between the processing component Z02 and other components. For example, the processing component Z02 may include a multimedia module to facilitate interaction between the multimedia component Z08 and the processing component Z02.
The memory Z04 is configured to store various types of data to support operations at device Z00. Examples of such data include instructions for any application or method operating on device Z00, contact data, phonebook data, messages, pictures, videos, etc. The memory Z04 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 Z06 provides power to the various components of the device Z00. The power component Z06 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device Z00.
The multimedia component Z08 comprises a screen between the device Z00 and the user providing 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 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 Z08 includes a front facing camera and/or a rear facing camera. When device Z00 is in an operating mode, such as a capture mode or a video mode, the front-facing camera and/or the rear-facing camera may receive external multimedia data. 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 Z10 is configured to output and/or input an audio signal. For example, the audio component Z10 includes a Microphone (MIC) configured to receive external audio signals when the device Z00 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 Z04 or transmitted via the communication component Z16. In some embodiments, the audio component Z10 further includes a speaker for outputting audio signals.
The I/O interface Z12 provides an interface between the processing component Z02 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 Z14 includes one or more sensors for providing status assessment of various aspects to the device Z00. For example, sensor assembly Z14 may detect the open/closed state of device Z00, the relative positioning of the components, such as the display and keypad of device Z00, sensor assembly Z14 may also detect a change in the position of one component of device Z00 or device Z00, the presence or absence of user contact with device Z00, the orientation or acceleration/deceleration of device Z00, and a change in the temperature of device Z00. The sensor assembly Z14 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly Z14 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 Z14 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component Z16 is configured to facilitate wired or wireless communication between device Z00 and other devices. Device Z00 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 Z16 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 Z16 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 device Z00 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 methods.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such as the memory Z04, comprising instructions executable by the processor Z20 of the device Z00 to perform the above method. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 11 is a block diagram illustrating an apparatus S00 for a virtual resource request validation method, according to an example embodiment. For example, the device S00 may be a server. Referring to FIG. 11, device S00 includes a processing component S20 that further includes one or more processors and memory resources represented by memory S22 for storing instructions, e.g., applications, that are executable by processing component S20. The application program stored in the memory S22 may include one or more modules each corresponding to a set of instructions. Further, the processing component S20 is configured to execute instructions to perform the method of virtual resource request validation described above.
The device S00 may also include a power supply component S24 configured to perform power management of the device S00, a wired or wireless network interface S26 configured to connect the device S00 to a network, and an input-output (I/O) interface S28. The device S00 may operate based on an operating system stored in the memory S22, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or the like.
In an exemplary embodiment, there is also provided a storage medium comprising instructions, such as the memory S22 comprising instructions, executable by the processor of the device S00 to perform the above method. 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.
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 virtual resource request processing method is applied to a client, and comprises the following steps:
responding to a request instruction of virtual resources, and acquiring a user identifier in the request instruction and a resource identifier of the requested virtual resources;
acquiring configuration information corresponding to the virtual resource, wherein the virtual resource, the resource identifier and the configuration information have a corresponding relation, and the configuration information is a configuration parameter which is pre-stored in the local part of the client and corresponds to the virtual resource;
calculating the allocation value of the virtual resource according to the configuration information and the user identifier;
and displaying the virtual resources corresponding to the allocation values and the corresponding prompt information.
2. The method of claim 1, wherein after presenting the virtual resource corresponding to the allocation value and the corresponding hint information, the method further comprises:
receiving an acquisition instruction of the displayed virtual resource;
calling a data reporting interface according to the acquisition instruction, reporting the distribution value to a server, wherein the distribution value is used for indicating the server to verify the acquisition instruction of the virtual resource, when the distribution value is consistent with the distribution value calculated by the server, the server passes the verification of the acquisition instruction of the virtual resource and distributes the distribution value to the user account corresponding to the user identifier, and when the distribution value is inconsistent with the distribution value calculated by the server, the server fails to verify the acquisition instruction of the virtual resource and does not distribute the distribution value to the user account corresponding to the user identifier;
if the verification result is that the virtual resource acquisition instruction is verified, displaying the display information which is returned by the server and distributes the distribution value to the user account corresponding to the user identifier; and if the verification result is that the verification of the acquisition instruction of the virtual resource is failed, displaying the display information that the acquisition instruction of the virtual resource returned by the server is an illegal instruction.
3. The method of claim 2, wherein prior to reporting the allocation value to the server, the method further comprises:
performing first encryption processing on the distribution value to obtain an encrypted distribution value;
the reporting the allocation value to a server includes:
and reporting the distribution value after the encryption processing to the server.
4. The method of claim 1, wherein the configuration information comprises a random key corresponding to a resource identifier of the virtual resource, an upper limit value of the virtual resource, and a lower limit value of the virtual resource; the calculating the allocation value of the virtual resource according to the configuration information and the user identifier includes:
performing second encryption processing on the random key and the user identifier to obtain an encrypted character string;
calculating a difference value between an upper limit value of the virtual resource and a lower limit value of the virtual resource;
performing a modular operation on the encrypted character string and the difference to obtain a module of the encrypted character string divided by the difference, wherein the module is the offset of the virtual resource;
and determining the sum of the offset of the virtual resource and the lower limit value of the virtual resource as the distribution value of the virtual resource.
5. The method according to claim 4, wherein said second encryption processing on the random key and the user identifier to obtain an encrypted string comprises:
carrying out XOR processing on the random key and the user identification to obtain a processed value;
and performing Hash operation on the processed value by adopting cyclic redundancy check to obtain the encrypted character string.
6. The method according to any one of claims 1 to 5, wherein the request instruction of the virtual resource includes an identifier of whether to locally obtain configuration information corresponding to the virtual resource; after responding to the request instruction for the virtual resource, the method further comprises:
if the identification is recognized to be that the configuration information corresponding to the virtual resource is acquired locally, acquiring the configuration information corresponding to the virtual resource in the request instruction locally;
and if the identifier is identified as not locally acquiring the configuration information corresponding to the virtual resource, sending the request instruction to a server, wherein the request instruction is used for indicating the server to acquire the configuration information corresponding to the virtual resource in the request instruction.
7. A virtual resource request verification method is applied to a server and comprises the following steps:
receiving a first allocation value of a virtual resource corresponding to a user identifier, which is reported by a client, wherein the first allocation value is obtained by the client after calculation according to a request instruction of the virtual resource, and the request instruction comprises the user identifier and a resource identifier of the virtual resource requested by the user identifier;
acquiring configuration information corresponding to the virtual resource, wherein the virtual resource, the resource identifier and the configuration information have a corresponding relation, and the configuration information is a configuration parameter corresponding to the virtual resource;
calculating a second allocation value of the virtual resource according to the configuration information and the user identifier;
if the second allocation value is the same as the first allocation value, allocating the second allocation value to a client account corresponding to the user identifier;
and returning corresponding display information to the client.
8. A virtual resource request processing apparatus, comprising:
the information acquisition module is configured to execute a request instruction responding to a virtual resource, and acquire a user identifier in the request instruction and a resource identifier of the virtual resource requested by the request instruction;
the configuration information determining module is configured to execute acquisition of configuration information corresponding to the virtual resource, wherein the virtual resource, the resource identifier and the configuration information have a corresponding relationship, and the configuration information is a configuration parameter which is pre-stored locally at the client and corresponds to the virtual resource;
a calculation module configured to calculate an allocation value of the virtual resource according to the configuration information and the user identifier;
and the display module is configured to perform display of the virtual resource corresponding to the allocation value and the corresponding prompt message.
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 virtual resource request processing method of any of claims 1 to 6.
10. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the virtual resource request processing method of any one of claims 1 to 6.
CN202010424539.5A 2020-05-19 2020-05-19 Virtual resource request processing method and device, electronic equipment and storage medium Active CN111611075B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010424539.5A CN111611075B (en) 2020-05-19 2020-05-19 Virtual resource request processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010424539.5A CN111611075B (en) 2020-05-19 2020-05-19 Virtual resource request processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111611075A true CN111611075A (en) 2020-09-01
CN111611075B CN111611075B (en) 2024-03-05

Family

ID=72203358

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010424539.5A Active CN111611075B (en) 2020-05-19 2020-05-19 Virtual resource request processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111611075B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256424A (en) * 2020-09-22 2021-01-22 北京达佳互联信息技术有限公司 Virtual resource processing method, device and system, electronic equipment and storage medium
CN112769715A (en) * 2020-12-31 2021-05-07 北京达佳互联信息技术有限公司 Resource allocation method, device, electronic equipment and storage medium
CN113077280A (en) * 2021-02-05 2021-07-06 北京达佳互联信息技术有限公司 Electronic resource allocation method and device, electronic equipment and storage medium
CN113691587A (en) * 2021-07-20 2021-11-23 北京达佳互联信息技术有限公司 Virtual resource processing method and device, electronic equipment and storage medium
CN114596117A (en) * 2022-03-10 2022-06-07 百果园技术(新加坡)有限公司 Virtual gift package issuing method, system, device, storage medium and product

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106802A1 (en) * 2004-11-18 2006-05-18 International Business Machines Corporation Stateless methods for resource hiding and access control support based on URI encryption
CN104796380A (en) * 2014-01-16 2015-07-22 腾讯科技(深圳)有限公司 Safety verification method, safety verification system, terminal and verification server
RU2626664C1 (en) * 2016-06-15 2017-07-31 Федеральное государственное автономное образовательное учреждение высшего образования "Белгородский государственный национальный исследовательский университет" (НИУ "БелГУ") Method of access granting to distributed data and computational resources as corporate portals via protected virtual environment
CN107038619A (en) * 2017-02-09 2017-08-11 阿里巴巴集团控股有限公司 Virtual resource management method and device
CN107329834A (en) * 2017-07-04 2017-11-07 北京百度网讯科技有限公司 Method and apparatus for performing calculating task
CN107480980A (en) * 2016-06-08 2017-12-15 阿里巴巴集团控股有限公司 A kind of method of virtual resource allocation, server and system
CN108984266A (en) * 2018-06-15 2018-12-11 华为技术有限公司 A kind of management method of virtual machine, apparatus and system
CN109146437A (en) * 2018-07-25 2019-01-04 腾讯科技(深圳)有限公司 Processing method, client and the storage medium of virtual resource
CN109997345A (en) * 2017-10-25 2019-07-09 深圳市互盟科技股份有限公司 Virtual machine control system and its method based on cloud computing
CN110585698A (en) * 2019-09-29 2019-12-20 腾讯科技(深圳)有限公司 Virtual asset transaction method and related device
CN110688215A (en) * 2019-08-23 2020-01-14 咪咕文化科技有限公司 Virtual resource allocation method, server, and computer-readable storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060106802A1 (en) * 2004-11-18 2006-05-18 International Business Machines Corporation Stateless methods for resource hiding and access control support based on URI encryption
CN104796380A (en) * 2014-01-16 2015-07-22 腾讯科技(深圳)有限公司 Safety verification method, safety verification system, terminal and verification server
CN107480980A (en) * 2016-06-08 2017-12-15 阿里巴巴集团控股有限公司 A kind of method of virtual resource allocation, server and system
RU2626664C1 (en) * 2016-06-15 2017-07-31 Федеральное государственное автономное образовательное учреждение высшего образования "Белгородский государственный национальный исследовательский университет" (НИУ "БелГУ") Method of access granting to distributed data and computational resources as corporate portals via protected virtual environment
CN107038619A (en) * 2017-02-09 2017-08-11 阿里巴巴集团控股有限公司 Virtual resource management method and device
CN107329834A (en) * 2017-07-04 2017-11-07 北京百度网讯科技有限公司 Method and apparatus for performing calculating task
CN109997345A (en) * 2017-10-25 2019-07-09 深圳市互盟科技股份有限公司 Virtual machine control system and its method based on cloud computing
CN108984266A (en) * 2018-06-15 2018-12-11 华为技术有限公司 A kind of management method of virtual machine, apparatus and system
CN109146437A (en) * 2018-07-25 2019-01-04 腾讯科技(深圳)有限公司 Processing method, client and the storage medium of virtual resource
CN110688215A (en) * 2019-08-23 2020-01-14 咪咕文化科技有限公司 Virtual resource allocation method, server, and computer-readable storage medium
CN110585698A (en) * 2019-09-29 2019-12-20 腾讯科技(深圳)有限公司 Virtual asset transaction method and related device

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112256424A (en) * 2020-09-22 2021-01-22 北京达佳互联信息技术有限公司 Virtual resource processing method, device and system, electronic equipment and storage medium
CN112769715A (en) * 2020-12-31 2021-05-07 北京达佳互联信息技术有限公司 Resource allocation method, device, electronic equipment and storage medium
CN112769715B (en) * 2020-12-31 2023-04-07 北京达佳互联信息技术有限公司 Resource allocation method, device, electronic equipment and storage medium
CN113077280A (en) * 2021-02-05 2021-07-06 北京达佳互联信息技术有限公司 Electronic resource allocation method and device, electronic equipment and storage medium
CN113691587A (en) * 2021-07-20 2021-11-23 北京达佳互联信息技术有限公司 Virtual resource processing method and device, electronic equipment and storage medium
CN114596117A (en) * 2022-03-10 2022-06-07 百果园技术(新加坡)有限公司 Virtual gift package issuing method, system, device, storage medium and product

Also Published As

Publication number Publication date
CN111611075B (en) 2024-03-05

Similar Documents

Publication Publication Date Title
CN111611075B (en) Virtual resource request processing method and device, electronic equipment and storage medium
CN109146470B (en) Method and device for generating payment code
WO2020215568A1 (en) Communication number changing method, apparatus and system, computer device and storage medium
CN109039990B (en) Behavior verification method and device based on verification code
CN103914520B (en) Data query method, terminal device and server
CN108811179B (en) Wireless network connection method, device and storage medium
US9426130B2 (en) Methods, devices and systems for anti-counterfeiting authentication
CN111368232A (en) Password sharing reflux method and device, electronic equipment and storage medium
CN107230060B (en) Account loss reporting method and device
US20200067715A1 (en) Security verification method for vehicle-mounted device, electronic apparatus, and readable storage medium
CN110598386B (en) Block chain-based data processing method, device, equipment and storage medium
CN110826103A (en) Block chain-based document authority processing method, device, equipment and storage medium
CN111756820A (en) Access processing method and device, electronic equipment and storage medium
CN113055169B (en) Data encryption method and device, electronic equipment and storage medium
CN110532324B (en) Block chain-based bulletin information display method, device, equipment and storage medium
CN112784243A (en) Authorization management method and device, electronic equipment and storage medium
CN112434339A (en) Information processing method and device
CN109885360B (en) Data processing method, device and storage medium
CN112256424A (en) Virtual resource processing method, device and system, electronic equipment and storage medium
CN113468606A (en) Application program access method and electronic equipment
US10091236B2 (en) Methods apparatuses, and storage mediums for acquiring legitimate installation packages
CN114386008A (en) Information processing method and device, equipment and storage medium
CN108924136B (en) Authorization authentication method, device and storage medium
CN110008668B (en) Data processing method, device and storage medium
CN116208350A (en) Digital car key registration method, device 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