Virtual resource allocation method, equipment and medium
By dynamically allocating virtual resources based on the duration of user behavior and using blockchain for secure storage, the problem of lack of flexibility and security in traditional virtual resource allocation methods is solved, which significantly improves user stickiness.
Patent Information
- Application Number
- CN202411395898.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-07
AI Technical Summary
The traditional virtual resource allocation method based on fixed allocation methods lacks flexibility and security, resulting in poor improvement of overall user stickiness to the platform.
By receiving user behavior data, the amount of virtual resources is determined based on the duration of user behavior, and the encrypted virtual resources are written to the blockchain for storage, real-time dynamic allocation of virtual resources is realized.
It improves the flexibility and security of user stickiness, avoids data forgery and tampering, and effectively improves the overall user stickiness of the platform.
Smart Images

Figure CN119398842A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a virtual resource allocation method, device and medium. Background Art
[0002] At present, the platform usually allocates virtual resources to user accounts based on a fixed allocation method. For example, after a user account reaches a certain level, a fixed number of virtual resources such as electronic coupons are written to the storage area related to the user account, thereby allocating virtual resources to the user account based on a fixed allocation method to improve the user stickiness of related users.
[0003] However, the above-mentioned traditional virtual resource allocation method based on fixed allocation method lacks flexibility and security (for example, there are risks such as data forgery and tampering), resulting in poor effect on improving the overall user stickiness of the platform. Summary of the invention
[0004] In view of the above problems, embodiments of the present application provide a virtual resource allocation method, device and medium to overcome the above problems or at least partially solve the above problems.
[0005] In a first aspect of an embodiment of the present application, a virtual resource allocation method is provided, the method comprising: Receiving user behavior data from user-side devices; Determine the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, wherein the duration of the user behavior is positively correlated with the amount of virtual resources required to be allocated; A virtual resource that matches the virtual resource amount is obtained, and the virtual resource is encrypted and written into the blockchain for storage.
[0006] As a possible implementation manner, determining the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data includes: According to the target mapping relationship, the duration of the user behavior represented by the user behavior data is mapped to the target actual physical resource amount, wherein the target mapping relationship is: a preset mapping relationship between the duration of the user behavior and the actual physical resource amount; The amount of virtual resources required to be allocated to the target user account is determined by taking the target actual amount of physical resources as the actual amount of physical resources allowed to be consumed for obtaining the virtual resources.
[0007] As a possible implementation manner, before mapping the duration of the user behavior represented by the user behavior data to the target actual physical resource amount according to the target mapping relationship, the method further includes: Determining a target mapping relationship from different preset mapping relationships between the duration of the user behavior and the actual amount of physical resources according to the target information represented by the user behavior data; The target information includes at least one of the type of user behavior, the importance of the user behavior, the level of the corresponding user account, and the time period of the user behavior.
[0008] As a possible implementation manner, before determining the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, the method further includes: Checking whether the user behavior data includes a set required data field, wherein the set required data field at least includes: relevant characterization information of the duration of the user behavior; In a case where the user behavior data does not include the set required data fields, the user behavior data is deleted.
[0009] As a possible implementation manner, the duration of the user behavior is represented by the start time and end time of the user behavior in the user behavior data; In the case where the user behavior data includes the set required data fields, the method further includes: Checking whether the start time and the end time of the user behavior meet the set conditions, wherein the set conditions include: a time sequence in which the start time is earlier and the end time is later, and at least one of a time interval threshold corresponding to the start time and the end time; When the start time and the end time of the user behavior do not meet the set conditions, the user behavior data is deleted.
[0010] As a possible implementation manner, the user behavior data further includes: identification information of the user behavior; In the case where the user behavior data includes the set required data fields, the method further includes: According to the identification information of the user behavior, checking whether there is historical user behavior data associated with the user behavior data and having not been deleted; If there is historical user behavior data associated with the user behavior data and having the same user behavior as the user behavior data and has not been deleted, the user behavior data is deleted.
[0011] As a possible implementation manner, when the user behavior represented by the user behavior data belongs to video viewing behavior, the method further includes: According to the relevant information of the set operation in the user behavior data, shortening the duration of the video viewing behavior represented by the user behavior data; The setting operation includes at least one of a pause operation, a skip operation and a play rate setting operation on the video stream.
[0012] As a possible implementation, the method further includes: After each increase or decrease of the virtual resources associated with the target user account stored in the blockchain according to the user behavior data or resource usage request from the user-side device, updating the record of the remaining amount of the virtual resources of the target user account; In response to receiving the resource query request from the user-side device, returning the most recently updated record of the remaining amount of virtual resources of the target user account to the user-side device.
[0013] According to a second aspect of an embodiment of the present application, a virtual resource allocation device is provided, the device comprising: A data receiving module, used to receive user behavior data from a user-side device; A resource allocation module, configured to determine the amount of virtual resources to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, wherein the duration of the user behavior is positively correlated with the amount of virtual resources to be allocated; The resource storage module is used to obtain virtual resources that meet the virtual resource quantity, and encrypt the virtual resources and write them into the blockchain for storage.
[0014] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor is used to implement the virtual resource allocation method as described in the first aspect of the embodiment of the present application when executing the program stored in the memory.
[0015] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the virtual resource allocation method as described in the first aspect disclosed in the embodiment of the present application is implemented.
[0016] According to a fifth aspect of an embodiment of the present application, a computer program product is provided, including a computer program / instruction, which, when executed by a processor, implements the virtual resource allocation method as described in the first aspect disclosed in the embodiment of the present application.
[0017] The embodiments of the present application include the following advantages: virtual resources are allocated to the target user account based on the duration of the user behavior, thereby quantifying the current user stickiness of the relevant users by means of the duration of the user behavior, so that the amount of virtual resources allocated to the target user account each time can be flexibly changed with the current user stickiness, thereby realizing real-time dynamic allocation of virtual resources to the target user account, which is conducive to maintaining or further improving the user stickiness of relevant users with higher user stickiness on the platform; and the allocated virtual resources are securely stored in combination with blockchain technology and data encryption technology, which can avoid the adverse effects of data security risks such as data forgery and tampering on user stickiness; thus, the present application achieves an effective improvement in the overall user stickiness of the platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application 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 paying any creative labor.
[0019] Figure 1 is a flowchart of the steps of a virtual resource allocation method in an embodiment of the present application; Figure 2 It is a flowchart of a method for acquiring movie-watching behavior data in an embodiment of the present application; Figure 3 It is a flow chart of a data checking method in an embodiment of the present application; Figure 4 It is a schematic diagram of an implementation process of a virtual resource allocation method in an embodiment of the present application; Figure 5 is a structural diagram of a virtual resource allocation device according to an embodiment of the present application; Figure 6 It is a schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0020] First of all, in order to facilitate understanding of the technical solutions provided by the present application, the main technical concepts involved in the embodiments of the present application are briefly described below.
[0021] User account: The account used by the user to log in to the platform through the user-side device, which can be used to distinguish different users.
[0022] User stickiness: users’ willingness to continue using the platform.
[0023] Blockchain: It records transactions and information through an ever-growing chain of data blocks. Each data block contains the hash value of the previous data block. This chain structure makes it difficult for data to be forged or tampered with, and can ensure the security of data storage.
[0024] Reference Figure 1 FIG. 1 is a flowchart of a method for allocating virtual resources in an embodiment of the present application, the method comprising the following steps: Step S11: receiving user behavior data from a user-side device.
[0025] In specific implementation, the virtual resource allocation method provided in the embodiment of the present application can be executed by a platform side device, such as one or more servers configured by the platform. When a user performs a set user behavior (such as video watching behavior, game behavior or text reading behavior, etc.) through a user side device (such as a smart TV, mobile phone, etc.), the user side device will collect user behavior data accordingly.
[0026] For example, refer to Figure 2 The flowchart of the method for obtaining viewing behavior data is shown. When a user watches a movie on a video platform through a smart TV (i.e., performs viewing behavior), the smart TV can collect the user's viewing behavior data such as the viewing time from the relevant log data, and send the viewing behavior data (i.e., user behavior data) to the video platform side device in real time via the Internet.
[0027] Among them, the user-side device and the platform-side device can use a pre-configured Application Programming Interface (API) to interact with data.
[0028] Optionally, the user-side device reuses the user behavior data to make personalized content recommendations to relevant users, so as to further improve user stickiness.
[0029] Optionally, virtual resource allocation is performed in a protected environment, and during the virtual resource allocation process, various types of data are transmitted in an encrypted manner, and user sensitive data is anonymized to ensure that user privacy is not leaked during data transmission and storage.
[0030] Optionally, before executing the virtual resource allocation, the user is asked whether to participate in the collection of user behavior data to further protect the user's privacy rights and interests.
[0031] Step S12: Determine the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, wherein the duration of the user behavior is positively correlated with the amount of virtual resources required to be allocated.
[0032] Among them, the user behavior data may directly include the duration of the user behavior (i.e., direct characterization information), or the user behavior data may include indirect characterization information such as the start time and end time of the user behavior; the duration may be in hours or seconds, etc., and this application does not impose any specific restrictions on this.
[0033] In specific implementation, it is considered that the longer the duration of user behavior, the greater the current user stickiness of the user to the platform. For example, the longer the user watches a TV series on the video platform, the greater the user stickiness of the user to the video platform, that is, the user is more willing to continue to use the video platform, so a larger amount of virtual resources can be allocated to the user, for example, the product of the duration of the user watching the TV series (that is, the duration of the user behavior) and the set coefficient (the value is greater than 1) is used as the amount of virtual resources required to be allocated to the user (that is, the user account), so that more virtual resources (or sufficient virtual resources when virtual resources are limited) can be used to maintain or further increase the user stickiness of related users with higher user stickiness, thereby improving the overall user stickiness of the platform.
[0034] Step S13: Acquire virtual resources that match the virtual resource amount, encrypt the virtual resources, and write them into the blockchain for storage.
[0035] The virtual resources may be gaming equipment or virtual currency that can be used by users in virtual scenes; or, the virtual resources may be electronic coupons, deposit amounts in electronic accounts, etc. that can be used by users in actual physical scenes. For example, the virtual resources may be electronic movie tickets that can be used to watch movies in a movie theater (i.e., in an actual physical scene).
[0036] In specific implementation, the platform-side device can use data encryption schemes such as public key encryption algorithms to encrypt the acquired virtual resources that meet the virtual resource quantity, and write the encrypted virtual resources into the data block associated with the target account for storage. The data block should contain the hash value of the previous data block (for example, a data block storing virtual resources allocated based on historical user behavior data) to ensure the storage security of virtual resources and avoid the adverse effects of unfair virtual resource allocation caused by data security risks such as data forgery and tampering on user stickiness, thereby further improving the overall user stickiness of the platform.
[0037] It is understandable that each time a user performs a user behavior, he or she will receive a certain amount of virtual resources. This instant virtual resource allocation method can greatly enhance the user's enthusiasm for using the platform; and the total amount of virtual resources allocated to the target user account will increase with the increase in the number of user behaviors performed. The increase is determined by the duration of the relevant user behavior. This can effectively increase the motivation of relevant users who have maintained a high user stickiness for a long time to continue using the platform for a long time, thereby maintaining the overall user stickiness of the platform at a high level.
[0038] Optionally, access permissions to the blockchain are set for selected user accounts (such as system management accounts) to enable them to view detailed read and write information of virtual resources in the blockchain, thereby improving the transparency of the virtual resource allocation process and making it easier for relevant personnel to analyze and maintain the virtual resource allocation process.
[0039] By adopting the technical solution of the embodiment of the present application, virtual resources are allocated to the target user account based on the duration of the user behavior, so that the amount of virtual resources allocated to the target user account each time can be flexibly changed with the current user stickiness by virtue of the duration of the user behavior, thereby realizing real-time dynamic allocation of virtual resources to the target user account, which is conducive to maintaining or further improving the user stickiness of related users with higher user stickiness on the platform; and combining blockchain technology and data encryption technology to securely store the allocated virtual resources can avoid the adverse effects of data security risks such as data forgery and tampering on user stickiness; thus, the present application achieves an effective improvement in the overall user stickiness of the platform.
[0040] As a possible implementation manner, in step S12, determining the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data includes: Step S121: mapping the duration of the user behavior represented by the user behavior data to a target actual amount of physical resources according to a target mapping relationship, wherein the target mapping relationship is a preset mapping relationship between the duration of the user behavior and the actual amount of physical resources.
[0041] In specific implementation, the preset mapping relationship can be flexibly set according to actual business needs. For example, the preset mapping relationship can be expressed as follows: R = T × W Among them, R represents the actual amount of physical resources, T represents the duration of user behavior, and W represents the setting coefficient.
[0042] Step S122: Determine the amount of virtual resources required to be allocated to the target user account by taking the target actual amount of physical resources as the actual amount of physical resources allowed to be consumed for obtaining virtual resources.
[0043] In specific implementation, the actual physical resource amount such as hardware resources (such as storage resources, computing resources), labor costs or time costs required to obtain a unit amount of virtual resources can be determined in advance. For example, the budget amount required to obtain a single electronic movie ticket (i.e., a unit amount of virtual resources) can be determined in advance. Then, the amount of virtual resources to be allocated can be determined according to the following formula: R1= R2×R3 R1 represents the amount of virtual resources required to be allocated, R2 represents the amount of actual physical resources allowed to be consumed to obtain virtual resources, and R3 represents the amount of actual physical resources required to obtain a unit amount of virtual resources.
[0044] In this embodiment, the relationship between virtual resources and actual physical resources is used as a reference to determine the amount of virtual resources to be allocated, which is conducive to achieving reasonable and full utilization of actual physical resources and avoiding the situation where the amount of virtual resources to be allocated is directly determined by the duration of user behavior, resulting in excessive or insufficient consumption of actual physical resources on the platform side.
[0045] Optionally, in step S121, before mapping the duration of the user behavior represented by the user behavior data to a target actual physical resource amount according to the target mapping relationship, the method further includes: Step S123: determining a target mapping relationship from different preset mapping relationships between the duration of the user behavior and the actual amount of physical resources according to the target information represented by the user behavior data; The target information includes at least one of the type of user behavior, the importance of the user behavior, the level of the corresponding user account, and the time period of the user behavior.
[0046] In specific implementation, for different types of user behaviors, such as video watching behavior, game behavior or text reading behavior, or for first-run movie watching behavior and popular movie watching behavior in video watching behavior, the preset mapping relationship (i.e., different preset mapping relationships) between the duration of the corresponding user behavior and the actual amount of physical resources is determined respectively. For example, the above-mentioned set coefficient W corresponding to each different type of user behavior is used to determine different preset mapping relationships respectively. This can achieve more refined virtual resource allocation, which is conducive to maintaining or further improving the user stickiness of related users with high user stickiness and who have performed specific types of behaviors on the platform, so that specific services in the platform (such as viewing services for specific movies) can get more usage opportunities (or exposure opportunities).
[0047] For user behaviors of different importance (flexibly set by platform-side devices), the above-mentioned setting coefficient W that is positively correlated with the importance can be used to determine different preset mapping relationships, thereby achieving more refined virtual resource allocation, which is conducive to maintaining or further improving the user stickiness of related users with high user stickiness and who have performed user behaviors of high importance within the platform, so that important services in the platform (such as reading services for important text content) can get more usage opportunities (or exposure opportunities).
[0048] For different levels of user accounts, the above-mentioned setting coefficients W corresponding to user accounts of different levels can be used to respectively determine different preset mapping relationships, thereby achieving more refined virtual resource allocation, which is conducive to maintaining or further improving the user stickiness of relevant users with high user stickiness and user accounts of specific levels within the platform. Optionally, the level of the user account can be determined based on the user's historical behavior data, such as determining whether the user account has a membership level based on whether the user purchases a membership, or determining what membership level the user account has based on the number or type of membership purchased by the user, or determining what active user level the relevant user account is based on the historical execution frequency of the user behavior, etc.
[0049] For different time periods of user behavior, the above-mentioned setting coefficients W corresponding to different time periods can be used to determine different preset mapping relationships respectively. For example, a larger setting coefficient can be set in time periods with low user traffic to increase the amount of virtual resources required to be allocated to related user accounts, thereby increasing user traffic in that time period.
[0050] Optionally, a machine learning model is trained based on the different preset mapping relationships (such as setting model parameters based on relevant set coefficients), and the target actual physical resource quantity is quickly obtained by inputting user behavior data into the trained machine learning model.
[0051] As a possible implementation manner, in the step S12, before determining the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, the method further includes: Step S14: Check whether the user behavior data includes the set required data fields, and the set required data fields at least include: relevant characterization information of the duration of the user behavior (such as the above-mentioned direct or indirect characterization information).
[0052] In specific implementation, the required data field is flexibly determined according to the data type required for data inspection or virtual resource allocation. For example, the required data field may also include identification information of user behavior to facilitate subsequent data duplication inspection.
[0053] Step S15: If the user behavior data does not include the set required data fields, delete the user behavior data.
[0054] In specific implementation, refer to Figure 3 The flowchart of the data checking method shown in the figure performs a data integrity check on the user behavior data based on the required data field. If the user behavior data does not include the set required data field, it is determined that the data integrity check fails and the user behavior data is deleted (or discarded); if the user behavior data includes the set required data field, it is determined that the data integrity check passes and the user behavior data is used to perform relevant processing for virtual resource allocation, or other checks are continued on the user behavior data. In this way, the integrity of the user behavior data used for virtual resource allocation can be guaranteed.
[0055] Optionally, the duration of the user behavior is represented by the start time and end time of the user behavior in the user behavior data; In the case where the user behavior data includes the set required data fields, the method further includes: Step S16: Check whether the start time and end time of the user behavior meet the set conditions.
[0056] The setting conditions include: a time sequence in which the start time comes first and the end time comes later, and at least one of time interval thresholds (such as an upper time interval limit and / or a lower time interval limit) corresponding to the start time and the end time.
[0057] It is understandable that the setting conditions can be flexibly adjusted or expanded according to actual business needs.
[0058] Step S17: If the start time and end time of the user behavior do not meet the set conditions, delete the user behavior data.
[0059] In specific implementation, the user behavior data is continuously checked for timestamp rationality based on the set conditions, such as checking whether there is confusion between the start time and the end time (such as whether there is an unreasonable jump, resulting in the end time being earlier than the start time in the time dimension), or checking whether the start time and the end time of the user behavior represent a duration of the user behavior that is too long or too short. In this way, the timestamp rationality of the user behavior data used for virtual resource allocation can be ensured.
[0060] Optionally, the user behavior data further includes: identification information of the user behavior; In the case where the user behavior data includes the set required data fields, the method further includes: Step S18: Based on the identification information of the user behavior, check whether there is any historical user behavior data that is associated with the user behavior data and has not been deleted.
[0061] In specific implementation, the identification information is used to distinguish different user behaviors associated with the same user account and can be flexibly set according to actual business needs.
[0062] For example, the identification information of the film can be used to distinguish different viewing behaviors associated with the same user account, such as distinguishing the viewing behaviors of the same user for films A, B, and C.
[0063] Step S19: if there is historical user behavior data associated with the user behavior data and which has not been deleted, delete the user behavior data.
[0064] In a specific implementation, the user behavior data is further checked for data duplication based on the identification information of the user behavior to avoid using the same user behavior data, such as avoiding repeated allocation of virtual resources to the same user account based on the same user behavior data repeatedly sent by the user-side device.
[0065] It should be noted that the above-mentioned data checking process can be implemented based on keyword search or by inputting the user behavior data into a pre-trained machine learning model. The embodiment of the present application does not specifically limit the implementation method of the above-mentioned data checking process.
[0066] As a possible implementation manner, when the user behavior represented by the user behavior data belongs to video viewing behavior, the method further includes: Step S21: shortening the duration of the video viewing behavior represented by the user behavior data according to the relevant information of the set operation in the user behavior data; The setting operation includes at least one of a pause operation, a skip operation and a play rate setting operation on the video stream.
[0067] In this implementation, considering that when a user performs a pause operation on a video stream, the duration of the video viewing behavior represented by the user behavior data will increase erroneously, the duration of the video viewing behavior can be reduced based on information such as the duration of the pause operation to ensure the accuracy of the duration of the video viewing behavior used for virtual resource allocation. And considering that when a user performs a skip operation (such as skipping some video frames) or a playback rate setting operation (such as setting double-speed playback, etc.) on a video stream, it means that the user's interest in the video stream has decreased. At this time, the duration of the video viewing behavior represented by the user behavior data can be reduced based on information such as the skipped video frame length or the playback rate setting value to ensure that the duration of the video viewing behavior accurately measures the user stickiness. In this way, the overall user stickiness of the platform can be further improved.
[0068] As a possible implementation method, refer to Figure 4 The schematic diagram of the implementation process of the virtual resource allocation method shown in FIG. 1 further includes: Step S31: after each increase or decrease of the virtual resources associated with the target user account stored in the blockchain according to the user behavior data or resource usage request from the user-side device, the virtual resource remaining amount record of the target user account is updated.
[0069] In a specific implementation, the platform-side device automatically updates the record of the remaining amount of virtual resources of the target user account after each increase of the virtual resources associated with the target user account stored in the blockchain according to the user behavior data from the user-side device, that is, each time the amount of virtual resources required to be allocated to the target user account is determined according to the user behavior data, and the virtual resources that meet the amount of virtual resources are encrypted and written into the blockchain for storage; and the platform-side device automatically updates the record of the remaining amount of virtual resources of the target user account after each reduction of the virtual resources associated with the target user account stored in the blockchain according to a resource use request from the user-side device (such as a request to use one or more electronic coupons), that is, each time the virtual resources of the corresponding amount of virtual resources are read from the blockchain according to the resource use request, decrypted and sent to the user-side device (or decrypted by the user-side device) for its use.
[0070] Step S32: in response to receiving the resource query request from the user-side device, returning the most recently updated record of the remaining amount of virtual resources of the target user account to the user-side device.
[0071] In this embodiment, the platform-side device provides users with fast and reliable virtual resource query and usage functions based on the read and write operations of the blockchain and the automatic update operations of the virtual resource remaining quantity records, thereby improving the user experience.
[0072] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0073] Figure 5 : is a structural diagram of a virtual resource allocation device according to an embodiment of the present application, the device comprising: A data receiving module, used to receive user behavior data from a user-side device; A resource allocation module, configured to determine the amount of virtual resources to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, wherein the duration of the user behavior is positively correlated with the amount of virtual resources to be allocated; The resource storage module is used to obtain virtual resources that meet the virtual resource quantity, and encrypt the virtual resources and write them into the blockchain for storage.
[0074] By adopting the technical solution of the embodiment of the present application, virtual resources are allocated to the target user account based on the duration of the user behavior, so that the amount of virtual resources allocated to the target user account each time can be flexibly changed with the current user stickiness by virtue of the duration of the user behavior, thereby realizing real-time dynamic allocation of virtual resources to the target user account, which is conducive to maintaining or further improving the user stickiness of related users with higher user stickiness on the platform; and combining blockchain technology and data encryption technology to securely store the allocated virtual resources can avoid the adverse effects of data security risks such as data forgery and tampering on user stickiness; thus, the present application achieves an effective improvement in the overall user stickiness of the platform.
[0075] Optionally, the resource allocation module includes: A first resource allocation module is used to map the duration of the user behavior represented by the user behavior data to a target actual physical resource amount according to a target mapping relationship, wherein the target mapping relationship is a preset mapping relationship between the duration of the user behavior and the actual physical resource amount; The second resource allocation module is used to determine the amount of virtual resources required to be allocated to the target user account by taking the target actual amount of physical resources as the actual amount of physical resources allowed to be consumed for obtaining virtual resources.
[0076] Optionally, the device further comprises: A first processing module is used to determine a target mapping relationship from different preset mapping relationships between the duration of the user behavior and the actual physical resource amount according to the target information represented by the user behavior data before mapping the duration of the user behavior represented by the user behavior data to the target actual physical resource amount according to the target mapping relationship; The target information includes at least one of the type of user behavior, the importance of the user behavior, the level of the corresponding user account, and the time period of the user behavior.
[0077] Optionally, the device further comprises: The first checking module is used to perform the following steps before determining the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data: Checking whether the user behavior data includes a set required data field, wherein the set required data field at least includes: relevant characterization information of the duration of the user behavior; In a case where the user behavior data does not include the set required data fields, the user behavior data is deleted.
[0078] Optionally, the duration of the user behavior is characterized by the start time and end time of the user behavior in the user behavior data; the device further includes: A second checking module is used to check whether the start time and the end time of the user behavior meet the set conditions when the user behavior data includes the set required data field, and the set conditions include: a time sequence in which the start time is earlier and the end time is later, and at least one of a time interval threshold corresponding to the start time and the end time; When the start time and the end time of the user behavior do not meet the set conditions, the user behavior data is deleted.
[0079] Optionally, the user behavior data further includes: identification information of the user behavior; and the device further includes: The third checking module is configured to, when the user behavior data includes the set required data field, perform the following steps: According to the identification information of the user behavior, checking whether there is historical user behavior data associated with the user behavior data and having not been deleted; If there is historical user behavior data associated with the user behavior data and having the same user behavior as the user behavior data and has not been deleted, the user behavior data is deleted.
[0080] Optionally, the device further comprises: A duration reduction module, configured to reduce the duration of the video viewing behavior represented by the user behavior data according to relevant information of the set operation in the user behavior data, when the user behavior represented by the user behavior data belongs to the video viewing behavior; The setting operation includes at least one of a pause operation, a skip operation and a play rate setting operation on the video stream.
[0081] Optionally, the device further comprises: A first management module, configured to update a record of a remaining amount of virtual resources of the target user account after the virtual resources associated with the target user account stored in the blockchain are increased or reduced each time according to user behavior data or resource usage requests from the user-side device; The second management module is used to return the most recently updated record of the remaining amount of virtual resources of the target user account to the user side device in response to receiving a resource query request from the user side device.
[0082] It should be noted that the device embodiment is similar to the method embodiment, so the description is relatively simple, and the relevant parts can be referred to the method embodiment.
[0083] The present application also provides an electronic device, such as Figure 6 As shown, it includes a processor 601, a communication interface 602, a memory 603 and a communication bus 604, wherein the processor 601, the communication interface 602, and the memory 603 communicate with each other through the communication bus 604; Memory 603, used for storing computer programs; The processor 601 is used to execute the program stored in the memory 603, such as the steps of the virtual resource allocation method disclosed in the embodiment of the present application.
[0084] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0085] The communication interface is used for communication between the above terminal and other devices.
[0086] The memory may include a random access memory (RAM) or a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0087] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processing, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0088] The embodiment of the present application also provides a computer-readable storage medium on which a computer program / instruction is stored. When the computer program / instruction is executed by a processor, the virtual resource allocation method disclosed in the embodiment of the present application is implemented.
[0089] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the virtual resource allocation method disclosed in the embodiment of the present application.
[0090] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0091] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0092] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0093] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A virtual resource allocation method, characterized in that: The method comprises: Receiving user behavior data from user-side devices; Determine the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, wherein the duration of the user behavior is positively correlated with the amount of virtual resources required to be allocated; A virtual resource that matches the virtual resource amount is obtained, and the virtual resource is encrypted and written into the blockchain for storage.
2. The method according to claim 1, characterized in that The determining, according to the duration of the user behavior represented by the user behavior data, the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device includes: According to the target mapping relationship, the duration of the user behavior represented by the user behavior data is mapped to the target actual physical resource amount, wherein the target mapping relationship is: a preset mapping relationship between the duration of the user behavior and the actual physical resource amount; The amount of virtual resources required to be allocated to the target user account is determined by taking the target actual amount of physical resources as the actual amount of physical resources allowed to be consumed for obtaining the virtual resources.
3. The method according to claim 2, characterized in that Before mapping the duration of the user behavior represented by the user behavior data to the target actual physical resource amount according to the target mapping relationship, the method further includes: Determining a target mapping relationship from different preset mapping relationships between the duration of the user behavior and the actual amount of physical resources according to the target information represented by the user behavior data; The target information includes at least one of the type of user behavior, the importance of the user behavior, the level of the corresponding user account, and the time period of the user behavior.
4. The method according to claim 1, characterized in that: Before determining the amount of virtual resources required to be allocated to the target user account corresponding to the user-side device according to the duration of the user behavior represented by the user behavior data, the method further includes: Checking whether the user behavior data includes a set required data field, wherein the set required data field at least includes: relevant characterization information of the duration of the user behavior; In a case where the user behavior data does not include the set required data fields, the user behavior data is deleted.
5. The method according to claim 4, characterized in that The duration of the user behavior is represented by the start time and end time of the user behavior in the user behavior data; In the case where the user behavior data includes the set required data fields, the method further includes: Checking whether the start time and the end time of the user behavior meet the set conditions, wherein the set conditions include: a time sequence in which the start time is earlier and the end time is later, and at least one of a time interval threshold corresponding to the start time and the end time; When the start time and the end time of the user behavior do not meet the set conditions, the user behavior data is deleted.
6. The method according to claim 4, characterized in that The user behavior data also includes: identification information of the user behavior; In the case where the user behavior data includes the set required data fields, the method further includes: According to the identification information of the user behavior, checking whether there is historical user behavior data associated with the user behavior data and having not been deleted; If there is historical user behavior data associated with the user behavior data and having the same user behavior as the user behavior data and has not been deleted, the user behavior data is deleted.
7. The method according to any one of claims 1 to 6, characterized in that: In the case where the user behavior represented by the user behavior data is a video viewing behavior, the method further includes: According to the relevant information of the set operation in the user behavior data, shortening the duration of the video viewing behavior represented by the user behavior data; The setting operation includes at least one of a pause operation, a skip operation and a play rate setting operation on the video stream.
8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: After each increase or decrease of the virtual resources associated with the target user account stored in the blockchain according to the user behavior data or resource usage request from the user-side device, updating the record of the remaining amount of the virtual resources of the target user account; In response to receiving the resource query request from the user-side device, returning the most recently updated record of the remaining amount of virtual resources of the target user account to the user-side device.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, configured to implement the virtual resource allocation method according to any one of claims 1 to 8 when executing a program stored in a memory.
10. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instruction is executed by a processor, the virtual resource allocation method according to any one of claims 1 to 8 is implemented.