Virtual resource exchange method and device, equipment, medium and program product
By using resource redemption event identifiers during virtual resource redemption process, the amount of recorded data is reduced, and the problem of computer burden and low reissue efficiency in virtual resource redemption process is solved, and more efficient resource management and reissue are achieved.
Patent Information
- Application Number
- CN202310798390.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-29
- Publication Date
- 2024-12-31
AI Technical Summary
In the process of virtual resource redemption, excessive recording data leads to a high burden on the computer, affecting the working speed and performance, and low reissue efficiency.
By generating resource redemption event identifiers, only deductions and distribution situations are recorded in the resource data table, and reissue tasks are determined based on the identification, reducing the amount of recorded data and improving efficiency.
It reduces the computer burden, improves the work efficiency of virtual resource redemption, reissue resources in a timely manner, avoids repeated resource distribution, and improves the stability and accuracy of the redemption process.
Smart Images

Figure CN119228438A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computers, and in particular to a method, apparatus, device, medium and program product for exchanging virtual resources. Background Art
[0002] In various applications, the master account can exchange various virtual resources in the application store through virtual exchange resources. Each exchange is implemented by the exchange resource module and the resource module of the application. The exchange resource module deducts the virtual exchange resources of the master account, and the resource module issues the corresponding virtual resources to the master account. The resource exchange process can only be realized when the above steps are successfully executed.
[0003] In the related art, in order to timely determine whether it is necessary to reissue virtual resources to the master account, the relevant information of the master account and each operation step are usually recorded, including the following record data: the virtual exchange resource balance and existing virtual resources of the master account before exchanging resources, the number of virtual exchange resources that need to be deducted when exchanging resources, the deduction of virtual exchange resources after exchanging resources, the resource information of the virtual resources to be issued (such as resource name, resource quantity), and the issuance of virtual resources after exchanging resources. According to the above record content, the virtual exchange resource balance and existing virtual resources before and after exchanging resources are compared one by one to determine whether to reissue virtual resources to the master account.
[0004] However, the above method records a lot of data, which is a heavy burden on the computer and affects the computer's working speed and performance. There are few cases where virtual resources need to be reissued, and the above recorded data has a low utilization rate, resulting in low efficiency in reissuing virtual resources. Summary of the invention
[0005] The embodiments of the present application provide a virtual resource exchange method, device, equipment, medium and program product, which can reduce the computing burden, improve the work efficiency of the computer, and timely reissue the resources to the account when problems occur during the resource exchange process or the resources are not successfully issued. The technical solution is as follows:
[0006] In one aspect, a method for exchanging virtual resources is provided, the method comprising:
[0007] receiving a resource exchange request sent by a first account, wherein the resource exchange request is used to request to exchange a first resource owned by the first account for a second resource, wherein the second resource is a virtual resource to be issued to the first account;
[0008] generating a resource exchange event identifier based on the resource exchange request, wherein the resource exchange event identifier is used to uniquely indicate the resource exchange event requested by the first account through the resource exchange request;
[0009] When the first resource of the first account is successfully deducted, adding the resource exchange event identifier to the first resource data table corresponding to the first resource;
[0010] In response to the lack of the resource exchange event identifier in the second resource data table corresponding to the second resource, generating a resource reissue task, wherein the resource reissue task is used to instruct the reissue of the second resource to the first account;
[0011] When the second resource is successfully issued to the first account, the resource exchange event identifier is added to the second resource data table.
[0012] In another aspect, a virtual resource exchange device is provided, the device comprising:
[0013] A receiving module, configured to receive a resource exchange request sent by a first account, wherein the resource exchange request is used to request to exchange a first resource owned by the first account for a second resource, wherein the second resource is a virtual resource to be issued to the first account;
[0014] A generating module, configured to generate a resource exchange event identifier based on the resource exchange request, wherein the resource exchange event identifier is used to uniquely indicate the resource exchange event requested by the first account through the resource exchange request;
[0015] an adding module, configured to add the resource exchange event identifier to a first resource data table corresponding to the first resource when the first resource of the first account is successfully deducted;
[0016] The generating module is further configured to generate a resource reissue task in response to the lack of the resource exchange event identifier in the second resource data table corresponding to the second resource, wherein the resource reissue task is used to instruct the reissue of the second resource to the first account;
[0017] The adding module is further configured to add the resource exchange event identifier to the second resource data table when the second resource is successfully issued to the first account.
[0018] On the other hand, a computer device is provided, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement a method for redeeming virtual resources as described in any of the above-mentioned embodiments of the present application.
[0019] On the other hand, a computer-readable storage medium is provided, in which at least one instruction, at least one program, a code set or an instruction set is stored, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement a method for redeeming virtual resources as described in any of the above-mentioned embodiments of the present application.
[0020] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the virtual resource exchange method described in any of the above embodiments.
[0021] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0022] A resource exchange event identifier is generated based on a resource exchange request sent by a first account. The deduction of the first resource can be determined based only on the existence of the resource exchange event identifier in the first resource data table, and the issuance of the second resource can be determined based on the existence of the resource exchange event identifier in the second resource data table. The amount of data required to be recorded is relatively small, which can reduce the computing burden and improve the work efficiency of the computer. When problems occur during the resource exchange process or resources are not successfully issued, the resources are reissued to the account in a timely manner; when the second resource is successfully issued to the first account, the resource exchange event identifier is added to the second resource data table, which effectively avoids repeated issuance of resources and improves the stability and accuracy of the resource exchange process. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0024] Figure 1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;
[0025] Figure 2 is a flow chart of a method for exchanging virtual resources provided by an exemplary embodiment of the present application;
[0026] Figure 3 is a flow chart of a method for exchanging virtual resources provided by another exemplary embodiment of the present application;
[0027] Figure 4is a schematic diagram of a first sub-data table provided by an exemplary embodiment of the present application;
[0028] Figure 5 is a schematic diagram of an updated first sub-data table provided by an exemplary embodiment of the present application;
[0029] Figure 6 is a schematic diagram of a second sub-data table provided by an exemplary embodiment of the present application;
[0030] Figure 7 is a schematic diagram of a resource reissue task provided by an exemplary embodiment of the present application;
[0031] Figure 8 is a flow chart of a method for exchanging virtual resources provided by another exemplary embodiment provided by an exemplary embodiment of the present application;
[0032] Fig. 9 is a flow chart of a method for establishing a resource reissue task provided by an exemplary embodiment of the present application;
[0033] Fig.10 is a flow chart of a method for executing a resource reissue task provided by an exemplary embodiment of the present application;
[0034] Fig.11 is a structural block diagram of a virtual resource exchange device provided by an exemplary embodiment of the present application;
[0035] Fig.12 is a structural block diagram of a virtual resource exchange device provided by another exemplary embodiment of the present application;
[0036] Fig.13 It is a structural block diagram of a computer device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0038] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0039] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0040] It should be noted that the information (including but not limited to the information of the first resource owned by the first account, exchange relationship information, etc.) and data (including but not limited to the first resource data table, the second resource data table, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.
[0041] It should be understood that, although the terms first, second, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first parameter may also be referred to as the second parameter, and similarly, the second parameter may also be referred to as the first parameter. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0042] The implementation environment involved in the embodiments of the present application is described, for illustration, please refer to Figure 1 The implementation environment involves a terminal 110 and a server 120, and the terminal 110 and the server 120 are connected via a communication network 130, wherein the terminal 110 is installed with a target application supporting resource exchange, and a first account is logged in to the target application.
[0043] Optionally, the types of target applications include, but are not limited to: game applications, shopping applications, lottery applications, and other applications that support resource redemption.
[0044] Functional modules for implementing different functions of the target application are deployed in the server 120:
[0045] Resource selection list module 121: The first account can determine the type and quantity of virtual resources to be exchanged in a preset resource selection list, such as: using 1000 first resources to exchange 2 second resources;
[0046] Resource deduction module 122: used to deduct the first resource owned by the first account when the first account redeems the resource. The first database of this module also stores a first resource data table corresponding to the first resource. The first resource data table is used to record relevant information of the first resource, including type, quantity, etc.;
[0047] Resource issuing module 123: used to issue the exchanged second resource to the first account. The second database of this module also stores a second resource data table corresponding to the second resource. The second resource data table is used to record relevant information of the second resource, including type, quantity, etc.;
[0048] Task creation module 124: used to create a resource reissue task when a first resource of a first account has been deducted but a second resource has not been issued to the first account during the resource exchange process. The resource reissue task is used to reissue the second resource to the first account;
[0049] Resource reissue module 125: used to execute the resource reissue task and notify the first account of the resource reissue status after the resource reissue task is completed.
[0050] After the first account sends a resource exchange request to the server 120, the server 120 first generates a resource exchange event identifier based on the resource exchange request. The resource exchange event identifier is used to uniquely indicate the resource exchange event requested by the first account through the resource exchange request. The server 120 deducts the first resource of the first account and issues the second resource to the first account. In this process, if the first resource is successfully deducted, the server 120 will add the resource exchange event identifier to the first resource data table, indicating that the deduction is successful; if the second resource is successfully issued, the server 120 will add the resource exchange event identifier to the second resource data table, indicating that the issuance is successful. The server 120 can determine whether it is necessary to reissue the resource based on the appearance of the resource exchange event identifier in the first resource data table and the second resource data table.
[0051] When the resource exchange event identifier exists in the first resource data table and does not exist in the second resource data table, it means that the second resource has not been issued to the first account. At this time, the server 120 generates a resource reissue task to reissue the second resource to the first account. If the second resource is reissued successfully, the server 120 will add the resource exchange event identifier to the second resource data table to prevent repeated reissue.
[0052] It is worth noting that both the first resource and the second resource are virtual resources. The first resource is a virtual resource owned by the first account and can be exchanged for other types of resources, such as virtual points. The second resource is a virtual resource that the first account can obtain through exchange, such as virtual props. The exchange relationship between the first resource and the second resource can be arbitrary, the type and quantity of the first resource can be arbitrary, and the type and quantity of the second resource can be arbitrary.
[0053] The terminal 110 may be a mobile phone, a tablet computer, a desktop computer, a portable laptop computer, a smart TV, a vehicle-mounted terminal, a smart home device, or other terminal devices in various forms, which is not limited in the embodiments of the present application.
[0054] It is worth noting that the above-mentioned server 120 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.
[0055] Among them, cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to realize data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which is used on demand and flexible and convenient. Cloud computing technology will become an important support. The background services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, each item may have its own identification mark, which needs to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0056] In some embodiments, the above server can also be implemented as a node in a blockchain system.
[0057] In combination with the above-mentioned noun introduction and application scenarios, the virtual resource exchange method provided by the present application is described. The method can be executed by a server or a terminal, or can be executed by a server and a terminal together. In the embodiment of the present application, the method is described by taking the execution of the server as an example. Figure 2 As shown, Figure 2The flowchart of a virtual resource exchange method provided by an exemplary embodiment of the present application includes the following steps.
[0058] Step 210: Receive a resource exchange request sent by a first account.
[0059] The resource exchange request is used to request to exchange a first resource owned by a first account for a second resource, where the second resource is a virtual resource to be issued to the first account.
[0060] Illustratively, the first account has two types of first resources: first resource A and first resource B, with quantities of 100,000 and 99,999 respectively. The first account can exchange the first resources for the following types of resources: second resource C, second resource D, and second resource E.
[0061] The resource exchange request includes an exchange relationship between the first resource and the second resource.
[0062] Optionally, the first account requests to exchange 100 first resources A for 1 second resource C. The type and quantity of the first resources owned by the first account meet the conditions of the resource exchange request. After receiving the resource exchange request, the server will deduct 100 first resources A from the virtual resources owned by the first account.
[0063] Optionally, the methods of exchanging the first resource for the second resource include but are not limited to the following: (1) exchanging one first resource for one second resource; (2) exchanging multiple first resources for one second resource; (3) exchanging one first resource for multiple second resources; (4) exchanging multiple first resources for multiple second resources, wherein the quantities of the first resource and the second resource can be arbitrary.
[0064] It is worth noting that in the above example, a resource exchange request includes a resource exchange relationship. In some embodiments, a resource exchange request may also include multiple resource exchange relationships, such as: (1) the first account requests to exchange 100 first resources A for 1 second resource C, (2) the first account requests to exchange 100 first resources B for 1 second resource D. This embodiment does not limit this.
[0065] Step 220: Generate a resource exchange event identifier based on the resource exchange request.
[0066] The resource exchange event identifier is used to uniquely indicate the resource exchange event requested by the first account through the resource exchange request.
[0067] Optionally, types of resource redemption event identifiers include but are not limited to: (1) a string of characters consisting of multiple digits or at least one of letters, where the number of bits in the string is arbitrary; (2) a string of digital codes in binary form, where the number of bits in the digital codes is arbitrary; (3) image identifiers, etc.
[0068] Optionally, the server generates a resource exchange event identifier based on a resource exchange request, including but not limited to: (1) the server randomly generates a resource exchange event identifier after receiving the resource exchange request; (2) the resource exchange event identifier is generated based on the generation time of the resource exchange request, such as: a serial number; (3) the resource exchange event identifier is generated based on the account information of the first account, the account information of the first account includes the account name of the first account, the account registration time, the account ID (Identity), etc.; (4) the resource exchange event identifier is generated based on the account information of the first account and the generation time of the resource exchange request.
[0069] Taking the resource exchange event identifier as an example, which is a serial number generated based on the generation time of the resource exchange request, the resource exchange event identifier is 202305081213000002, indicating that the time when the first account created the resource exchange request is 12:13 on May 8, 2023, and the last six digits are used to indicate that this is the second resource exchange request created by the first account with account ID "0000".
[0070] Step 230: When the first resource of the first account is successfully deducted, a resource exchange event identifier is added to the first resource data table corresponding to the first resource.
[0071] Since there is atomicity between the operation result of successfully deducting the first resource from the first account and the operation result of successfully adding the resource exchange event identifier in the first resource data table, that is, the execution status of these two operations is the same, the following two situations are included: (1) the first resource is successfully deducted from the first account and the resource exchange event identifier exists in the first resource data table; (2) the first resource is not successfully deducted from the first account and the resource exchange event identifier does not exist in the first resource data table.
[0072] Optionally, the server includes the following multiple functional modules to jointly implement the resource exchange process:
[0073] Resource selection list module: The first account can determine the type and quantity of virtual resources to be exchanged in a preset resource selection list;
[0074] Resource deduction module: used to deduct the first resource owned by the first account when the first account redeems the resource. The first database of the module also stores a first resource data table corresponding to the first resource. The first resource data table is used to record relevant information of the first resource, including type, quantity, etc.;
[0075] Resource distribution module: used to distribute the exchanged second resource to the first account. The second database of this module also stores a second resource data table corresponding to the second resource. The second resource data table is used to record relevant information of the second resource, including type, quantity, etc.
[0076] The server determines the first resource owned by the first account based on the resource exchange request, deducts the first resource used for exchange from the first account when the type and quantity of the first resource owned by the first account meet the resource exchange condition, and adds the resource exchange event identifier to the first resource data table when the deduction is successful.
[0077] Optionally, the number of first resources A owned by the first account is 100,000, and the number of second resources C that the first account expects to exchange in the resource exchange request is 1, and the resource exchange relationship is: 1 second resource C requires 100 first resources A to exchange. Then, after deducting the number of first resources A in the first account, which is 100, the first resources owned by the first account are sufficient to exchange for the second resource, that is, the resource exchange condition is met.
[0078] In some embodiments, there are at least two types of first resources, and there may be different equivalent relationships between the first resources, such as: 100 first resources A are equivalent to 5 first resources B. When exchanging resources, the first account can use one or more types of first resources for exchange. For example: the first account has 100 first resources A and 5 first resources B, and the first account expects to exchange 2 second resources C. Then the first account can use 100 first resources A to exchange 1 second resource C, and use 5 first resources B to exchange 1 second resource C. At this time, the first resources owned by the first account also meet the resource exchange conditions.
[0079] During the process of deducting the first resource from the first account, the server may fail to deduct the first resource. In this case, it is necessary to promptly determine whether there is a resource exchange event identifier in the first resource data table. If the resource exchange event identifier is missing in the first resource data table corresponding to the first resource, it means that the first resource has not been deducted successfully. In this case, it is necessary to deduct the first resource again and send a prompt message to the first account. The prompt message is used to inform the first account of the deduction of the first resource.
[0080] Step 240: In response to the lack of a resource exchange event identifier in the second resource data table corresponding to the second resource, a resource reissue task is generated.
[0081] The resource reissue task is used to instruct to reissue the second resource to the first account.
[0082] Optionally, the server also includes the following multiple functional modules to jointly implement the resource exchange process:
[0083] Task creation module: used to create a resource reissue task when the first resource of the first account has been deducted but the second resource has not been issued to the first account during the resource exchange process. The resource reissue task is used to reissue the second resource to the first account;
[0084] Resource reissue module: used to execute resource reissue tasks and notify the first account of the resource reissue status after the resource reissue tasks are completed.
[0085] The server determines the type and quantity of the second resource that the first account expects to exchange based on the resource exchange request, issues the second resource to the first account, and adds a resource exchange event identifier in the second resource data table.
[0086] When the server issues the second resource to the first account, the issuance may fail. In this case, it is necessary to promptly determine whether there is a resource exchange event identifier in the second resource data table. If the resource exchange event identifier is missing in the second resource data table corresponding to the second resource, it means that the second resource has not been issued to the first account, and the first account needs to be reissued.
[0087] It is worth noting that the above example only takes the case where the first resource is successfully deducted but the second resource is not issued to the first account as an example. The resource exchange process also includes the following cases:
[0088] 1. Failure to deduct the first resource: There are two situations. The first account may cancel the resource exchange request, or the type and quantity of the first resource owned by the first account cannot meet the resource exchange conditions, that is, the first resource owned by the first account is not enough to support its exchange for the second resource. In this case, there is no need to create a resource reissue task;
[0089] 2. The first resource is deducted successfully, but the second resource fails to be issued: In this case, you need to create a resource reissue task to reissue the second resource to the first account;
[0090] 3. The first resource is deducted successfully and the second resource is issued successfully: At this point, there is no need to establish a resource reissue task, and the resource exchange process is completed.
[0091] Step 250: When the second resource is successfully issued to the first account, a resource exchange event identifier is added to the second resource data table.
[0092] If there is a resource exchange event identifier in the second resource data table, it means that the resource reissue task has been completed. The resource exchange event identifier is used to prompt that there is no need to continue reissue, so as to avoid issuing resources to the first account that exceed the second resource requested in the resource exchange request.
[0093] In some embodiments, the server takes a long time to execute the resource reissue task. In order to improve the user experience of the user corresponding to the first account, resource compensation can be performed on the first account. The first time when the first account generates a resource exchange request and the second time when the resource exchange event identifier is added to the second resource data table are obtained; the execution time of the resource reissue task is determined based on the time between the first time and the second time; when the execution time reaches the resource exchange time threshold, a resource compensation task is generated, and the resource compensation task is used to indicate the issuance of compensation virtual resources to the first account, and the types of compensation virtual resources include at least one of the first resource and the second resource.
[0094] In some embodiments, after the first account performs resource exchange, there may be a situation where the first account expects to return the resource. The process of the server returning the virtual resource is as follows: receiving a resource return request sent by the first account, the resource return request is used to request the return of the first resource deducted from the first account and the second resource exchanged by the first account, and the resource return request includes a resource return event identifier for indexing the resource exchange event identifier; indexing the resource exchange event identifier from the first resource data table and the second resource data table based on the resource return event identifier; in response to indexing the resource exchange event identifier in the first resource data table and the first resource is successfully returned, deleting the resource exchange event identifier in the first resource data table; in response to indexing the resource exchange event identifier in the second resource data table and the second resource is successfully returned, deleting the resource exchange event identifier in the second resource data table.
[0095] Optionally, the time between the first moment and the second moment is 20 minutes, and the resource exchange time threshold is 15 minutes, then the server generates a resource compensation task. The way of issuing the compensation virtual resources to the first account can be: (1) refunding a preset amount of the first resource based on the deducted first resource, such as refunding 10% of the first resource; (2) continuing to issue a preset amount of the second resource to the first account based on the issued second resource, such as compensating 10% of the second resource, which is not limited in this embodiment.
[0096] If the execution time does not reach the resource exchange time threshold, a resource reissue prompt message is sent to the first account, and the resource reissue prompt message is used to indicate that the second resource is successfully reissued. At this time, the server will not issue virtual resources to the first account to compensate for the resource exchange timeout.
[0097] To sum up, the method provided in this embodiment generates a resource exchange event identifier based on a resource exchange request sent by a first account. The deduction of the first resource can be determined only according to the existence of the resource exchange event identifier in the first resource data table, and the issuance of the second resource can be determined according to the existence of the resource exchange event identifier in the second resource data table. The amount of data required to be recorded is relatively small, which can reduce the computing burden and improve the work efficiency of the computer. When problems occur during the resource exchange process or resources are not successfully issued, the resources are reissued to the account in a timely manner; when the second resource is successfully issued to the first account, the resource exchange event identifier is added to the second resource data table, which effectively avoids repeated issuance of resources and improves the stability and accuracy of the resource exchange process.
[0098] Figure 3 FIG. 1 is a flowchart of a method for exchanging virtual resources provided by another exemplary embodiment of the present application. Figure 3 As shown, step 230 in the above embodiment can also be implemented as the following steps 231 and 232.
[0099] Step 231, when the first resource of the first account is successfully deducted, a first sub-data table corresponding to the first account in the first resource data table is obtained.
[0100] The first sub-data table includes a first exchange event list of the first account for the first resource. Figure 4 As shown, Figure 4 This is a schematic diagram of the first sub-data table.
[0101] The first sub-data table 400 includes a first resource list 410 and a first exchange event list 420, wherein the first resource list 410 includes the types and corresponding quantities of the first resources owned by the first account. For example, the first resource list 410 includes two first resources, namely, a first resource of type A 411 and a first resource of type B 412, and the corresponding quantities are 999999 and 2000000 respectively.
[0102] The first exchange event list 420 includes resource exchange event identifiers generated by the server when the first account applies for resource exchange within a historical time period.
[0103] like, Figure 4 The historical resource exchange event identifier corresponding to a resource exchange application made by the first account within the historical time period is shown: 202305081213000001.
[0104] It is worth noting that the start and end time of the above historical time period can be arbitrary, for example, the start time of the historical time period is the time point when the first account is created, and the end time of the historical time period is the current time point, which is not limited in this embodiment.
[0105] Step 232: Add a resource exchange event identifier to the first exchange event list.
[0106] Optionally, the resource exchange event ID corresponding to this resource exchange application is a multi-digit number: 202305081213000002. Add the resource exchange event ID to Figure 4 In the first redemption event list 420 shown.
[0107] Optionally, when the first account redeems the second resource, the type and quantity of the first resource deducted are: 100 Class A first resources 411, then the number of Class A first resources 411 in the first sub-data table needs to be reduced by 100 accordingly, and the following is obtained: Figure 5 A schematic diagram of the updated first sub-data table is shown.
[0108] The updated first sub-data table 500 includes an updated first resource list 510 and an updated first redemption event list 520, wherein the updated first resource list 510 includes the types and corresponding quantities of the first resources owned by the first account. The updated first resource list 510 includes two types of first resources, namely, a type A first resource 511 and a type B first resource 512, and the corresponding quantities are 999899 and 2000000 respectively.
[0109] At this time, the update includes the following event identifiers in the first redemption event list 520:
[0110] 1. When the first account applies for resource exchange within the historical time period, the historical resource exchange event identifier generated by the server is: 202305081213000001;
[0111] 2. When the first account applies for resource exchange this time, the resource exchange event identifier generated by the server is: 202305081213000002.
[0112] In some embodiments, the number of event identifiers that can be stored in the first redemption event list is limited. When the number of event identifiers in the first redemption event list reaches an identifier number threshold, the first event identifier is deleted from the first redemption event list, and the first event identifier is the identifier with the longest generation time in the first redemption event list. After the first event identifier is deleted, a resource redemption event identifier is added to the first redemption event list.
[0113] Exemplarily, each event identifier is sorted in the order of the time when it was generated by the server, such as: the generation time of the first event identifier is October 10, 2022, the generation time of the second event identifier is January 1, 2023, the generation time of the third event identifier is January 2, 2023... the generation time of the Nth event identifier is May 1, 2023, then they are arranged in order: the first event identifier, the second event identifier, the third event identifier...the Nth event identifier, where N is a positive integer.
[0114] Optionally, the identifier number threshold of the number of event identifiers in the first redemption event list is N, and the number of event identifiers that can be stored in the first redemption event list has reached the upper limit. At this time, the first event identifier is deleted. After the first event identifier is deleted, the resource redemption event identifier corresponding to this resource redemption application is added to the first redemption event list.
[0115] In some embodiments, before step 240 , step 310 is further included.
[0116] Step 310: When the second resource fails to be issued to the first account, cancel adding the resource exchange event identifier in the second resource data table.
[0117] Since there is atomicity between the operation result of successfully issuing the second resource to the first account and the operation result of successfully adding the resource exchange event identifier in the second resource data table, that is, the execution status of these two operations is the same, the following two situations are included: (1) the second resource is successfully issued to the first account and the resource exchange event identifier exists in the second resource data table; (2) the second resource is not successfully issued to the first account and the resource exchange event identifier does not exist in the second resource data table.
[0118] In the above embodiment, step 240 may also be implemented as the following steps 241 to 243.
[0119] Step 241: Obtain a second sub-data table corresponding to the first account in the second resource data table.
[0120] The second sub-data table includes a second exchange event list of the first account for the second resource. Figure 6 As shown, Figure 6 This is a schematic diagram of the second sub-data table.
[0121] The second sub-data table 600 includes a second resource list 610 and a second exchange event list 620, wherein the second resource list 610 includes the types and corresponding quantities of the second resources exchanged by the first account. For example, the second resource list 610 includes three types of second resources, namely, a C-type second resource 611, a D-type second resource 612, and an E-type second resource 613, and the corresponding quantities are 1, 2, and 3, respectively.
[0122] The second exchange event list 620 includes resource exchange event identifiers generated by the server when the first account applies for resource exchange within a historical time period.
[0123] like, Figure 6 The historical resource exchange event identifier corresponding to a resource exchange application made by the first account within the historical time period is shown: 202305081213000001.
[0124] It is worth noting that the start and end time of the above historical time period can be arbitrary, for example, the start time of the historical time period is the time point when the second account is created, and the end time of the historical time period is the current time point, which is not limited in this embodiment.
[0125] Optionally, the resource exchange event identifier corresponding to this resource exchange application is a multi-digit number: 202305081213000002.
[0126] If the second resource is successfully issued to the first account, the server adds the resource exchange event identifier to Figure 6 In the second exchange event list 620 shown in FIG. 1 , at this time, the second exchange event list 620 includes: 202305081213000001 and 202305081213000002; if the second resource is successfully issued to the first account, the server cancels adding the resource exchange event identifier to the first account. Figure 6 In the second redemption event list 620 shown, at this time, the second redemption event list 620 only includes: 202305081213000001.
[0127] Step 242, traverse the event identifiers in the second redemption event list.
[0128] Among them, the event identifiers in the second redemption event list are sorted according to the time when they were generated by the server, and the order of traversing the event identifiers can be arbitrary, such as: (1) traversing in chronological order; (2) traversing in reverse chronological order, etc. This embodiment does not limit this.
[0129] Step 243: if the event identifier in the second exchange event list fails to match the resource exchange event identifier, a resource reissue task is generated.
[0130] Optionally, the resource exchange event identifier is 202305081213000002, and the event identifiers in the second exchange event list only include 202305081213000001. The two are different and the matching fails, indicating that the resource exchange event identifier does not exist in the second exchange event list and the second resource issuance fails.
[0131] At this time, the server generates a resource reissue task to reissue the second resource to the first account.
[0132] Exemplarily, the process of creating a reissue task is as follows:
[0133] (1) In response to the lack of a resource exchange event identifier in a second resource data table corresponding to the second resource, exchange relationship information corresponding to the resource exchange event identifier is obtained.
[0134] The exchange relationship information includes the exchange quantity of the first resource and the exchange quantity of the second resource;
[0135] Optionally, the first resource includes Class A first resources and Class B first resources, the second resource includes Class A second resources, Class D second resources and Class E second resources, and the exchange relationship information in this resource exchange event is: exchange out 100 Class A first resources and exchange in 1 Class C second resource.
[0136] (2) Create a resource reissue task based on the resource exchange event identifier and exchange relationship information.
[0137] The resource reissue task includes the corresponding relationship between the resource exchange event identifier and the exchange relationship information. Figure 7 As shown, Figure 7 This is a schematic diagram of a resource reissue task.
[0138] The resource reissue task 700 includes: a resource exchange event identifier 710 , exchange-out first resource information 720 , and exchange-in second resource information 730 .
[0139] Optionally, the resource exchange event identifier 710 is 202305081213000002, the first resource exchange information 720 is: deducting 100 Class A first resources from the first account, and the second resource exchange information 730 is: issuing 1 Class C second resource to the first account.
[0140] When the second resource is reissued to the first account according to the resource reissue task, the second resource of corresponding quantity and type may be issued to the first account based on the redeemed second resource information in the resource reissue task.
[0141] To sum up, the method provided in this embodiment generates a resource exchange event identifier based on a resource exchange request sent by a first account. The deduction of the first resource can be determined only according to the existence of the resource exchange event identifier in the first resource data table, and the issuance of the second resource can be determined according to the existence of the resource exchange event identifier in the second resource data table. The amount of data required to be recorded is relatively small, which can reduce the computing burden and improve the work efficiency of the computer. When problems occur during the resource exchange process or resources are not successfully issued, the resources are reissued to the account in a timely manner; when the second resource is successfully issued to the first account, the resource exchange event identifier is added to the second resource data table, which effectively avoids repeated issuance of resources and improves the stability and accuracy of the resource exchange process.
[0142] The method provided in this embodiment obtains a first sub-data table corresponding to the first account in the first resource data table, wherein the first sub-data table includes a first redemption event list of the first account for the first resource. When the first resource of the first account is successfully deducted, a resource redemption event identifier is added to the first redemption event list. When the server determines whether it is necessary to reissue the resource to the first account, it can be determined only based on the resource redemption event identifier, and the amount of recorded data is small, which can improve the computing efficiency of the computer.
[0143] The method provided in this embodiment deletes the first event identifier from the first redemption event list when the number of event identifiers in the first redemption event list reaches the identifier quantity threshold. The first event identifier is the identifier with the longest generation time in the first redemption event list, and can promptly delete data stored for too long to improve the utilization rate of space resources. After the first event identifier is deleted, a resource redemption event identifier is added to the first redemption event list to ensure that the number of event identifiers in the first redemption event list does not exceed the quantity threshold.
[0144] The method provided in this embodiment obtains a second sub-data table corresponding to the first account in the second resource data table, wherein the second sub-data table includes a second redemption event list of the first account for the second resource; traverses the event identifiers in the second redemption event list; and generates a resource reissue task when the event identifier in the second redemption event list fails to match the resource redemption event identifier. The method can determine the issuance of the second resource to the first account based only on the resource redemption event identifier, thereby improving the work efficiency of the computer and timely reissuing the second resource to the first account.
[0145] The method provided in this embodiment cancels the addition of the resource exchange event identifier in the second resource data table when the second resource fails to be issued to the first account, thereby ensuring the atomicity between the operation of issuing the second resource to the first account and the operation of adding the resource exchange event identifier in the second resource data table, facilitating the subsequent determination of whether the second resource needs to be reissued to the first account based on the appearance of the resource exchange event identifier in the second resource data table, thereby improving the work efficiency of the computer.
[0146] The method provided in this embodiment obtains exchange relationship information corresponding to the resource exchange event identifier in response to the lack of a resource exchange event identifier in the second resource data table corresponding to the second resource, the exchange relationship information including the exchanged quantity of the first resource and the exchanged quantity of the second resource; creates a resource reissue task based on the resource exchange event identifier and the exchange relationship information, the resource reissue task including the correspondence between the resource exchange event identifier and the exchange relationship information, and when the server reissues the resource to the first account, it can reissue it according to the exchanged quantity of the second resource recorded in the resource reissue task, thereby reducing the amount of calculation and improving the work efficiency of the computer.
[0147] The virtual resource exchange method provided in the present application can also be executed by a terminal, and a first account is logged in to the terminal, such as Figure 8 As shown, Figure 8 FIG. 1 is a flowchart of a virtual resource exchange method provided by another exemplary embodiment of the present application. The method includes the following steps.
[0148] Step 810, display the resource exchange interface.
[0149] The resource exchange interface is used to enable the first account to exchange virtual resources. The resource exchange interface includes a resource selection list, which includes the types and quantities of second resources that can be exchanged by the first account, as well as the conditions required for exchanging the second resources.
[0150] Optionally, the resource selection list includes three types of second resources: type C second resources, type D second resources, and type E second resources, as well as exchange conditions for the above three types of second resources. The number of the above three types of second resources can be arbitrary, and the exchange condition can be expressed as an equal relationship between the first resource and the second resource, such as: 100 type A first resources can be exchanged for 1 type C second resource.
[0151] In some embodiments, the exchangeable time / exchangeable quantity of the second resource is limited, and a prompt message will be displayed accordingly in the resource selection list, and the prompt message is used to prompt the first account when exchanging resources.
[0152] Step 820: In response to receiving a resource exchange operation in the resource exchange interface, generate a resource exchange request and send the resource exchange request to the server.
[0153] Optionally, the resource exchange operation includes the following:
[0154] (1) Select the type and quantity of the second resource you wish to exchange in the resource selection list. For example:
[0155] Select the second resource of category C, the quantity is 1;
[0156] (2) Displaying exchange condition information on the resource exchange interface, such as: 1. To exchange 1 Class C second resource, 100 Class A first resources must be deducted; 2. The first resources owned by the first account are 10,000 Class A first resources and 9,999 Class B first resources;
[0157] (3) When the first resource owned by the first account meets the exchange condition, the exchange confirmation target control is displayed on the resource exchange interface, the exchange confirmation target control is triggered, the resource exchange request is determined to be generated, and the resource exchange request is sent to the server.
[0158] Step 830: When the first resource is successfully deducted, display a first prompt message.
[0159] After receiving the resource exchange request, the server will deduct the first resource corresponding to the second resource from the first account. If the first resource is successfully deducted, a first prompt message is displayed, wherein the first prompt message is used to prompt the first account: the first resource deduction failed, and the first prompt message also includes the remaining first resource owned by the first account.
[0160] Optionally, the first prompt information is: after deducting 100 Class A first resources, the first account still has 9900 Class A first resources and 9999 Class B first resources.
[0161] In some embodiments, if the deduction of the first resource fails, a prompt message will be displayed to prompt the first account to deduct the first resource again, or the first account can also choose to cancel the resource exchange.
[0162] Step 840: When the second resource provisioning fails, display a second prompt message.
[0163] After receiving the resource exchange request, the server will issue the second resource that the first account expects to exchange based on the first resource to the first account. In the case of failure to issue the second resource, a second prompt message is displayed, wherein the second prompt message is used to prompt the first account: the second resource issuance has failed, and the first prompt message also includes resource reissue information: used to prompt the first account that the server is establishing a resource reissue task.
[0164] Optionally, the second prompt information is: the issuance of one Class C second resource failed, and the server is establishing a resource reissue task.
[0165] In some embodiments, if the second resource is issued successfully, a prompt message will be displayed to prompt the first account that the resource has been issued successfully. Alternatively, the first account can also choose to cancel the resource exchange, return the second resource and recover the deducted first resource.
[0166] Step 850: When the second resource is reissued successfully, display the third prompt information.
[0167] The third prompt information is used to prompt the first account: the second resource is reissued successfully.
[0168] To sum up, the method provided in this embodiment generates a resource exchange event identifier based on a resource exchange request sent by a first account. The deduction of the first resource can be determined only according to the existence of the resource exchange event identifier in the first resource data table, and the issuance of the second resource can be determined according to the existence of the resource exchange event identifier in the second resource data table. The amount of data required to be recorded is relatively small, which can reduce the computing burden and improve the work efficiency of the computer. When problems occur during the resource exchange process or resources are not successfully issued, the resources are reissued to the account in a timely manner; when the second resource is successfully issued to the first account, the resource exchange event identifier is added to the second resource data table, which effectively avoids repeated issuance of resources and improves the stability and accuracy of the resource exchange process.
[0169] Fig. 9 This is a flow chart of a method for establishing a resource reissue task provided by an embodiment of the present application, which is jointly executed by a terminal and a server, and a first account is logged in to the terminal. It includes the following steps:
[0170] Step 910: The first account initiates a resource exchange request.
[0171] The resource exchange request includes an exchange relationship between the first resource and the second resource.
[0172] Optionally, the first account expects to exchange 100 first resources of type A for 1 second resource of type C.
[0173] Step 920: The server deducts the first resource from the first account.
[0174] After receiving the resource exchange request sent by the first account, the server deducts the corresponding first resource from the first resource owned by the first account.
[0175] Optionally, the server deducts 100 first resources of category A from the first account.
[0176] Step 930: The server determines the deduction status of the first resource.
[0177] If the first resource deduction is successful, execute step 940 ; if the first resource deduction fails, execute step 970 .
[0178] Step 940: The server issues the second resource to the first account.
[0179] After receiving the resource exchange request sent by the first account, the server issues the corresponding second resource to the first account.
[0180] Optionally, the server issues one C-type second resource to the first account.
[0181] Step 950: The server determines the distribution status of the second resource.
[0182] If the second resource provisioning fails, execute step 960 ; if the second resource provisioning succeeds, execute step 970 .
[0183] Step 960: The server creates a resource reissue task.
[0184] Step 970: The server sends an end message to the first account.
[0185] When jumping from step 930 to step 970, the end information is used to indicate that the first account failed to successfully deduct the first resource and the resource exchange request failed; when jumping from step 950 to step 970, the end information is used to indicate that the resource exchange request of the first account is successful.
[0186] In summary, the method for establishing a resource reissue task provided in this embodiment is jointly executed by the terminal and the server, which can timely determine the execution status of the resource exchange request and reissue the second resource to the first account when the second resource is not successfully issued, thereby improving the user experience.
[0187] Fig.10 This is a flowchart of a method for executing a resource reissue task provided by an embodiment of the present application, which is executed by a server and a first account is logged in on a terminal. It includes the following steps:
[0188] Step 1010: The server reads the first resource data table.
[0189] The first resource data table includes a plurality of event identifiers, which are respectively used to indicate historical resource exchange events performed by the first account within a historical time period.
[0190] Step 1020: The server determines the deduction status of the first resource.
[0191] The resource exchange event identifier is retrieved from the first resource data table. If it exists, it means that the first resource deduction is successful; if it does not exist, it means that the first resource deduction fails.
[0192] If the first resource deduction is successful, execute step 1030 ; if the first resource deduction fails, execute step 1060 .
[0193] Step 1030: The server reads the second resource data table.
[0194] After receiving the resource exchange request sent by the first account, the server issues the corresponding second resource to the first account.
[0195] Optionally, the server issues one second resource of type C to the first account.
[0196] Step 1040: The server determines the distribution status of the second resource.
[0197] If the second resource is issued unsuccessfully, step 1050 is executed; if the second resource is issued successfully, step 1060 is executed.
[0198] Step 1050: The server reissues the second resource and notifies the first account.
[0199] Step 1060: The server sends an end message to the first account.
[0200] When jumping from step 1030 to step 1060, the end information is used to indicate that the first account failed to successfully deduct the first resource and no reissue of the second resource is required; when jumping from step 1040 to step 1060, the end information is used to indicate that the second resource is successfully reissued.
[0201] In summary, the execution method of the resource reissue task provided in this embodiment can be jointly executed, and can timely determine the execution status of the resource exchange request and reissue the second resource to the first account when the second resource is not successfully issued, thereby improving the user experience.
[0202] Fig.11 is a structural block diagram of a virtual resource exchange device provided by an exemplary embodiment of the present application, such as Fig.11 As shown, the device includes the following parts.
[0203] The receiving module 1110 is used to receive a resource exchange request sent by a first account, wherein the resource exchange request is used to request to exchange a first resource owned by the first account for a second resource, wherein the second resource is a virtual resource to be issued to the first account;
[0204] A generating module 1120, configured to generate a resource exchange event identifier based on the resource exchange request, wherein the resource exchange event identifier is used to uniquely indicate the resource exchange event requested by the first account through the resource exchange request;
[0205] An adding module 1130 is configured to add the resource exchange event identifier to a first resource data table corresponding to the first resource when the first resource of the first account is successfully deducted;
[0206] The generating module 1120 is further configured to generate a resource reissue task in response to the lack of the resource exchange event identifier in the second resource data table corresponding to the second resource, wherein the resource reissue task is used to instruct the reissue of the second resource to the first account;
[0207] The adding module 1130 is further configured to add the resource exchange event identifier to the second resource data table when the second resource is successfully issued to the first account.
[0208] In an optional embodiment, the adding module 1130 is further used to obtain a first sub-data table corresponding to the first account in the first resource data table when the first resource of the first account is successfully deducted, the first sub-data table including a first redemption event list of the first account for the first resource; and add the resource redemption event identifier to the first redemption event list.
[0209] In an optional embodiment, the adding module 1130 is also used to delete a first event identifier from the first redemption event list when the number of event identifiers in the first redemption event list reaches an identifier number threshold, the first event identifier being the identifier with the longest generation time in the first redemption event list; after the first event identifier is deleted, add the resource redemption event identifier to the first redemption event list.
[0210] In an optional embodiment, the generation module 1120 is further used to obtain a second sub-data table corresponding to the first account in the second resource data table, the second sub-data table including a second redemption event list of the first account for the second resource; traverse the event identifiers in the second redemption event list; and generate the resource reissue task when the event identifier in the second redemption event list fails to match the resource redemption event identifier.
[0211] In an optional embodiment, before the generating module 1120, as Fig.12 As shown, the device also includes:
[0212] The canceling module 1140 is configured to cancel adding the resource exchange event identifier to the second resource data table when the second resource fails to be issued to the first account.
[0213] In an optional embodiment, the generation module 1120 is also used to obtain the exchange relationship information corresponding to the resource exchange event identifier in response to the absence of the resource exchange event identifier in the second resource data table corresponding to the second resource, the exchange relationship information including the exchange quantity of the first resource and the exchange quantity of the second resource; and create the resource reissue task based on the resource exchange event identifier and the exchange relationship information, the resource reissue task including the correspondence between the resource exchange event identifier and the exchange relationship information.
[0214] In an optional embodiment, the device further comprises:
[0215] An acquisition module 1150 is used to acquire a first time when the first account generates the resource exchange request and a second time when the resource exchange event identifier is added to the second resource data table;
[0216] A determination module 1160, configured to determine the execution duration of the resource reissue task based on the duration between the first moment and the second moment;
[0217] The generating module 1120 is further configured to generate a resource compensation task when the execution time reaches a resource exchange time threshold, wherein the resource compensation task is configured to instruct the issuance of a compensatory virtual resource to the first account.
[0218] In an optional embodiment, the generating module 1120 is further used to send a resource reissue prompt message to the first account when the execution time does not reach the resource exchange time threshold, and the resource reissue prompt message is used to indicate that the second resource is reissued successfully.
[0219] In an optional embodiment, the device further comprises:
[0220] The receiving module 1110 is further configured to receive a resource return request sent by the first account, wherein the resource return request is used to request a return of the first resource deducted from the first account and the second resource exchanged with the first account, and the resource return request includes a resource return event identifier for indexing the resource exchange event identifier;
[0221] An indexing module 1170, configured to index the resource redemption event identifier from the first resource data table and the second resource data table based on the resource refund event identifier;
[0222] A deleting module 1180, configured to delete the resource exchange event identifier in the first resource data table in response to the resource exchange event identifier being indexed in the first resource data table and the first resource being returned successfully;
[0223] The deleting module 1180 is further configured to delete the resource exchange event identifier in the second resource data table in response to the resource exchange event identifier being indexed in the second resource data table and the second resource being returned successfully.
[0224] To summarize, the virtual resource exchange device provided in the present application generates a resource exchange event identifier based on a resource exchange request sent by a first account, and can determine the deduction of the first resource based only on the existence of the resource exchange event identifier in the first resource data table, and determine the issuance of the second resource based on the existence of the resource exchange event identifier in the second resource data table. The amount of data required to be recorded is relatively small, which can reduce the computing burden and improve the work efficiency of the computer. When problems occur during the resource exchange process or resources are not successfully issued, the resources are reissued to the account in a timely manner; when the second resource is successfully issued to the first account, the resource exchange event identifier is added to the second resource data table, which effectively avoids repeated issuance of resources and improves the stability and accuracy of the resource exchange process.
[0225] It should be noted that the virtual resource exchange device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the virtual resource exchange device provided in the above embodiment and the virtual resource exchange method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0226] Fig.13 The block diagram of the structure of a computer device 1300 provided by an exemplary embodiment of the present application is shown. The computer device 1300 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer IV) player, a laptop computer or a desktop computer. The computer device 1300 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.
[0227] Typically, the computer device 1300 includes a processor 1301 and a memory 1302 .
[0228] The processor 1301 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0229] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, which is used to be executed by the processor 1301 to implement the virtual resource exchange method provided in the method embodiment of the present application.
[0230] In some embodiments, the computer device 1300 also includes other components, which can be understood by those skilled in the art. Fig.13 The structure shown in the figure does not constitute a limitation on the terminal 1300, and the terminal 1300 may include more or less components than those shown in the figure, or combine some components, or adopt a different component arrangement.
[0231] Optionally, the computer readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a solid state drive (SSD), or an optical disk. Among them, the random access memory may include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM). The serial numbers of the above embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0232] An embodiment of the present application also provides a computer device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement a method for redeeming virtual resources as described in any of the above embodiments of the present application.
[0233] An embodiment of the present application also provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement a method for redeeming virtual resources as described in any of the above embodiments of the present application.
[0234] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the virtual resource exchange method described in any of the above embodiments.
[0235] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0236] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for exchanging virtual resources, characterized in that: The method comprises: receiving a resource exchange request sent by a first account, wherein the resource exchange request is used to request to exchange a first resource owned by the first account for a second resource, wherein the second resource is a virtual resource to be issued to the first account; generating a resource exchange event identifier based on the resource exchange request, wherein the resource exchange event identifier is used to uniquely indicate the resource exchange event requested by the first account through the resource exchange request; When the first resource of the first account is successfully deducted, adding the resource exchange event identifier to the first resource data table corresponding to the first resource; In response to the lack of the resource exchange event identifier in the second resource data table corresponding to the second resource, generating a resource reissue task, wherein the resource reissue task is used to instruct the reissue of the second resource to the first account; When the second resource is successfully issued to the first account, the resource exchange event identifier is added to the second resource data table.
2. The method according to claim 1, characterized in that: When the first resource of the first account is successfully deducted, adding the resource exchange event identifier in a first resource data table corresponding to the first resource includes: When the first resource of the first account is successfully deducted, obtaining a first sub-data table corresponding to the first account in the first resource data table, wherein the first sub-data table includes a first redemption event list of the first account for the first resource; Add the resource exchange event identifier to the first exchange event list.
3. The method according to claim 2, characterized in that The adding the resource exchange event identifier to the first exchange event list includes: When the number of event identifiers in the first exchange event list reaches an identifier number threshold, deleting a first event identifier from the first exchange event list, the first event identifier being the identifier with the longest generation time in the first exchange event list; After the first event identifier is deleted, the resource exchange event identifier is added to the first exchange event list.
4. The method according to any one of claims 1 to 3, characterized in that: In response to the second resource data table corresponding to the second resource lacking the resource exchange event identifier, generating a resource reissue task includes: Acquire a second sub-data table corresponding to the first account in the second resource data table, wherein the second sub-data table includes a second redemption event list of the first account for the second resource; Traversing the event identifiers in the second redemption event list; When the event identifier in the second exchange event list fails to match the resource exchange event identifier, the resource reissue task is generated.
5. The method according to any one of claims 1 to 3, characterized in that: In response to the second resource data table corresponding to the second resource lacking the resource exchange event identifier, before generating the resource reissue task, the method further includes: In the case where the second resource fails to be issued to the first account, the resource exchange event identifier added to the second resource data table is cancelled.
6. The method according to any one of claims 1 to 3, characterized in that: In response to the second resource data table corresponding to the second resource lacking the resource exchange event identifier, generating a resource reissue task includes: In response to the lack of the resource exchange event identifier in the second resource data table corresponding to the second resource, acquiring exchange relationship information corresponding to the resource exchange event identifier, wherein the exchange relationship information includes the exchanged quantity of the first resource and the exchanged quantity of the second resource; The resource reissue task is created based on the resource exchange event identifier and the exchange relationship information, and the resource reissue task includes a corresponding relationship between the resource exchange event identifier and the exchange relationship information.
7. The method according to any one of claims 1 to 3, characterized in that: In the case where the second resource is successfully issued to the first account, after adding the resource exchange event identifier in the second resource data table, the method further includes: Obtaining a first time when the first account generates the resource exchange request and a second time when the resource exchange event identifier is added to the second resource data table; Determining the execution duration of the resource reissue task based on the duration between the first moment and the second moment; When the execution time reaches the resource exchange time threshold, a resource compensation task is generated, where the resource compensation task is used to instruct the issuance of a compensatory virtual resource to the first account.
8. The method according to claim 7, characterized in that The method further comprises: When the execution time does not reach the resource exchange time threshold, a resource reissue prompt message is sent to the first account, where the resource reissue prompt message is used to indicate that the second resource is successfully reissued.
9. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: receiving a resource return request sent by the first account, wherein the resource return request is used to request a return of the first resource deducted from the first account and the second resource exchanged with the first account, and the resource return request includes a resource return event identifier used to index the resource exchange event identifier; Indexing the resource redemption event identifier from the first resource data table and the second resource data table based on the resource refund event identifier; In response to the resource exchange event identifier being indexed in the first resource data table and the first resource being returned successfully, deleting the resource exchange event identifier in the first resource data table; In response to the resource exchange event identifier being indexed in the second resource data table and the second resource being returned successfully, the resource exchange event identifier in the second resource data table is deleted.
10. A virtual resource exchange device, characterized in that: The device comprises: A receiving module, configured to receive a resource exchange request sent by a first account, wherein the resource exchange request is used to request to exchange a first resource owned by the first account for a second resource, wherein the second resource is a virtual resource to be issued to the first account; A generating module, configured to generate a resource exchange event identifier based on the resource exchange request, wherein the resource exchange event identifier is used to uniquely indicate the resource exchange event requested by the first account through the resource exchange request; an adding module, configured to add the resource exchange event identifier to a first resource data table corresponding to the first resource when the first resource of the first account is successfully deducted; The generating module is further configured to generate a resource reissue task in response to the lack of the resource exchange event identifier in the second resource data table corresponding to the second resource, wherein the resource reissue task is used to instruct the reissue of the second resource to the first account; The adding module is further configured to add the resource exchange event identifier to the second resource data table when the second resource is successfully issued to the first account.
11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one program, and the at least one program is loaded and executed by the processor to implement the virtual resource exchange method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the virtual resource exchange method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the virtual resource exchange method as claimed in any one of claims 1 to 9.
